{"id":18728724,"url":"https://github.com/rubyonworld/llvm-cbe","last_synced_at":"2026-04-10T16:33:46.910Z","repository":{"id":174007986,"uuid":"533346588","full_name":"RubyOnWorld/llvm-cbe","owner":"RubyOnWorld","description":"This LLVM C backend has been resurrected by Julia Computing with various improvements.","archived":false,"fork":false,"pushed_at":"2022-09-12T14:24:34.000Z","size":1074,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T19:37:27.753Z","etag":null,"topics":["cbe","improve","julia","llvm"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-06T13:51:16.000Z","updated_at":"2022-09-27T22:13:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"aea3c715-f1c1-4baa-bfc4-9b013efdfc1c","html_url":"https://github.com/RubyOnWorld/llvm-cbe","commit_stats":null,"previous_names":["rubyonworld/llvm-cbe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubyOnWorld/llvm-cbe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fllvm-cbe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fllvm-cbe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fllvm-cbe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fllvm-cbe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/llvm-cbe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fllvm-cbe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261789228,"owners_count":23209774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cbe","improve","julia","llvm"],"created_at":"2024-11-07T14:23:55.780Z","updated_at":"2026-04-10T16:33:46.874Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"llvm-cbe\n========\n\nThis LLVM C backend has been resurrected by Julia Computing with various improvements.\n\nInstallation instructions\n=========================\n\nThis version of the LLVM C backend works with LLVM 10.0, and has preliminary support for LLVM 11.0.\n\nStep 1: Installing LLVM\n=======================\n\nEither install the LLVM packages on your system:\n--------------------------------------------\n\nOn macOS, use [pkgsrc](http://pkgsrc.joyent.com/install-on-osx/) and run the following commands:\n```\n    pkgin in llvm clang\n```\n\nOn CentOS, install the llvm-devel package:\n```\n    dnf install llvm-devel clang\n```\n\nOn Debian and derivatives, install the llvm-dev package via:\n```\n    apt install llvm-dev clang\n```\n\nOr compile LLVM yourself:\n-----------------------------\nNote: to convert C to LLVM IR to run the tests, you will also need a C compiler using the LLVM infrastructure, such as clang.\n\nThe first step is to compile LLVM on your machine\n(this assumes an in-tree build, but out-of-tree will also work):\n\n\n     git clone https://github.com/llvm/llvm-project.git\n     cd llvm-project\n     git checkout release/8.x\n     mkdir llvm/build\n     cd llvm/build\n     cmake ..\n     make\n\nTo run tests, you need to build `lli`.\n\n\nStep 2: Compiling LLVM-CBE\n==========================\n\nNow you can download and compile llvm-cbe.\n\nIf you built LLVM yourself, put it in the same folder you built LLVM in:\n\n    cd $HOME/llvm-project/llvm/projects\n    git clone https://github.com/JuliaComputing/llvm-cbe\n    cd ../build\n    cmake -S ..\n    make llvm-cbe\n\nIf you used your distribution's package, put it wherever you feel like:\n\n    git clone https://github.com/JuliaComputing/llvm-cbe\n    cd llvm-cbe \u0026\u0026 mkdir build \u0026\u0026 cd build\n    cmake -S ..\n    make llvm-cbe\n\nStep 3: Usage Examples\n======================\n\nIf llvm-cbe compiles, you should be able to run it with the following commands.\n```\n$ cd $HOME/llvm-project/llvm/projects/llvm-cbe/test/selectionsort\n$ ls\nmain.c\n$ clang -S -emit-llvm -g main.c\n$ ls\nmain.c main.ll\n$ $(HOME)/llvm/build/bin/llvm-cbe main.ll\n```\n\nYou can find options to configure the C backend's output with `llvm-cbe --help`.\nLook for options beginning with `--cbe-`.\n\nCompile Generated C Code and Run\n================================\n\n```\n$ gcc -o main.cbe main.cbe.c\n$ ls\nmain.c  main.cbe  main.cbe.c  main.ll\n$ ./main.cbe\n```\n\nRunning tests\n==================\n\nUnit tests:\n\n```sh\n    $ cd $HOME/llvm-project/llvm/build\n    $ make CBEUnitTests \u0026\u0026 projects/llvm-cbe/unittests/CWriterTest\n```\n\nNote that you need to have passed `-DLLVM_INCLUDE_TESTS=1` to cmake if you used\nyour distribution's LLVM package. You also will need to install gtest (on Debian\nderivatives: `apt install libgtest-dev`).\n\nOther tests:\n\nFirst, compile llvm-cbe, and install pytest (e.g. `pip install pytest`). Then:\n\n```sh\n    $ cd $HOME/llvm-project/llvm/projects/llvm-cbe\n    $ pytest\n```\n\nYou might have to adjust the llvm-cbe and lli paths in that configuration.\n\nIf you want the tests to run faster, installing `pytest-xdist` will allow you to run the test suite in parallel, e.g. `pytest -n 4` if you want to use 4 cores.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fllvm-cbe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fllvm-cbe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fllvm-cbe/lists"}