|
23 | 23 | fi |
24 | 24 |
|
25 | 25 | eval $(SHELL=bash opam env --switch=$OPTIMUZZ_OPAM_SWITCH) |
| 26 | +export OPAMSWITCH=$OPTIMUZZ_OPAM_SWITCH |
26 | 27 | opam pin https://github.com/prosyslab/logger.git |
27 | | -opam install -j $NCPU dune ctypes domainslib progress ocamlgraph ocamlformat merlin ocp-index ocp-indent ocaml-lsp-server |
28 | | -scripts/llvm20.sh |
29 | | -scripts/alive.sh |
| 28 | +opam install -j $NCPU dune ctypes ocamlgraph ocamlformat merlin ocp-index ocp-indent ocaml-lsp-server |
| 29 | + |
| 30 | +if [ -z "$LLVM_PATH" ]; then |
| 31 | + echo "LLVM_PATH is not set. Please set it to the path of your LLVM installation." |
| 32 | + exit 1 |
| 33 | +fi |
| 34 | + |
| 35 | +install_llvm() { |
| 36 | + git clone https://github.com/llvm/llvm-project.git $LLVM_PATH |
| 37 | + pushd $LLVM_PATH |
| 38 | + git checkout llvmorg-20.1.1 |
| 39 | + mkdir -p build |
| 40 | + pushd build |
| 41 | + # Alive2 requires ASSERTIONS to be enabled |
| 42 | + cmake -G Ninja ../llvm \ |
| 43 | + -DLLVM_ENABLE_PROJECTS="llvm;lld;clang" \ |
| 44 | + -DLLVM_ENABLE_BINDINGS=ON \ |
| 45 | + -DCMAKE_BUILD_TYPE=Release \ |
| 46 | + -DLLVM_ENABLE_RTTI=ON \ |
| 47 | + -DLLVM_ENABLE_ASSERTIONS=ON \ |
| 48 | + -DLLVM_ENABLE_SPHINX=OFF \ |
| 49 | + -DLLVM_ENABLE_DOXYGEN=OFF \ |
| 50 | + -DLLVM_ENABLE_OCAMLDOC=OFF \ |
| 51 | + -DLLVM_TARGETS_TO_BUILD="X86" \ |
| 52 | + -DLLVM_OCAML_INSTALL_PATH="$(opam var lib)" |
| 53 | + ninja |
| 54 | + |
| 55 | + # This installs LLVM-20 bindings to the current opam switch |
| 56 | + sudo ninja install |
| 57 | + popd |
| 58 | + popd |
| 59 | +} |
| 60 | + |
| 61 | + |
| 62 | +install_alive2() { |
| 63 | + git submodule update --init --remote alive2 |
| 64 | + pushd alive2 |
| 65 | + git checkout v20.0 |
| 66 | + |
| 67 | + rm -rf build |
| 68 | + mkdir -p build |
| 69 | + |
| 70 | + pushd build |
| 71 | + cmake -GNinja -DCMAKE_PREFIX_PATH="$LLVM_PATH" -DBUILD_TV=1 -DCMAKE_BUILD_TYPE=Release .. |
| 72 | + ninja |
| 73 | + sudo ninja install |
| 74 | + popd |
| 75 | + popd |
| 76 | +} |
| 77 | + |
| 78 | + |
| 79 | +echo "LLVM_PATH: $LLVM_PATH" |
| 80 | + |
| 81 | +if [ ! -x "$LLVM_PATH/build/bin/opt" ]; then |
| 82 | + echo "No LLVM is found built. Installing LLVM..." |
| 83 | + install_llvm |
| 84 | +else |
| 85 | + echo "Built LLVM found. Skipping LLVM build." |
| 86 | + pushd $LLVM_PATH/build |
| 87 | + sudo ninja install |
| 88 | + popd |
| 89 | +fi |
| 90 | + |
| 91 | +install_alive2 |
30 | 92 |
|
31 | 93 | make |
32 | | -# opam install -j $NCPU llvm.16.0.6+nnp |
33 | | -# make |
|
0 commit comments