We need to do it from source to inclue the proper CMake, header, and library files which are otherwise not included in the downloadable installer.
git clone git@github.com:llvm/llvm-project.git
cd llvm-project
git checkout llvmorg-9.0.1
- Open an administrator command line in that directory
- Run the following commands:
mkdir build
cd build
cmake -Thost=x64 ../llvm
cmake --build . --target install
- Wait 100000000 years for it to build.
- Reboot your system.
TODO
Once you've sorted out the dependencies, use the following commands. Alternative on Windows you can open the Visual Studio solution file and switch to the CMake targets or directory view in the solution explorer and build from there.
mkdir build
cd build
cmake ../
cmake --build .
- Download and install LLVM 9.0.0 from here.
- Download pre-built llvm-bw.
- Use CLang to compile C++ to LLVM IR with
clang++ -S -m32 -Ofast -emit-llvm your_code.cpp
. - Run
llvm-bw your_code.ll input_map.scm
.