Closed vanhauser-thc closed 1 year ago
and true there is no tritonConfig.cmake, but why wasnt it created?
The tritonConfig
is generated when calling make install
. Use -DCMAKE_INSTALL_PREFIX
if you want to install Triton in a specific directory. Then, you can use -DCMAKE_PREFIX_PATH
for libraries that need Triton.
Maybe something like this?:
# Triton
$ cmake -DCMAKE_INSTALL_PREFIX=/my/path/where/installing/triton ..
$ make install
# ttexplore
$ cmake -DCMAKE_PREFIX_PATH=/my/path/where/installing/triton ..
Ah that works :)
Now I get:
/prg/ttexplore/build (main) # make
[ 6%] Building CXX object CMakeFiles/ttexplore.dir/lib/ttexplore.cpp.o
/prg/ttexplore/lib/ttexplore.cpp: In member function ‘void triton::engines::exploration::SymbolicExplorator::initWorklist()’:
/prg/ttexplore/lib/ttexplore.cpp:82:14: error: ‘std::filesystem’ has not been declared
82 | std::filesystem::create_directories(config.workspace + "/corpus");
| ^~~~~~~~~~
/prg/ttexplore/lib/ttexplore.cpp:83:14: error: ‘std::filesystem’ has not been declared
83 | std::filesystem::create_directories(config.workspace + "/crashes");
| ^~~~~~~~~~
/prg/ttexplore/lib/ttexplore.cpp:84:14: error: ‘std::filesystem’ has not been declared
84 | std::filesystem::create_directories(config.workspace + "/coverage");
| ^~~~~~~~~~
make[2]: *** [CMakeFiles/ttexplore.dir/build.make:76: CMakeFiles/ttexplore.dir/lib/ttexplore.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/ttexplore.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
this was with gcc-12
I can fix this with switching to clang++-14 and:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,10 +46,10 @@ target_link_libraries(harness4 ttexplore)
target_link_libraries(harness5 ttexplore)
target_link_libraries(harness6 ttexplore)
-target_compile_options(ttexplore PRIVATE -std=c++14)
-target_compile_options(harness1 PRIVATE -std=c++14)
-target_compile_options(harness2 PRIVATE -std=c++14)
-target_compile_options(harness3 PRIVATE -std=c++14)
-target_compile_options(harness4 PRIVATE -std=c++14)
-target_compile_options(harness5 PRIVATE -std=c++14)
-target_compile_options(harness6 PRIVATE -std=c++14)
+target_compile_options(ttexplore PRIVATE -std=c++17)
+target_compile_options(harness1 PRIVATE -std=c++17)
+target_compile_options(harness2 PRIVATE -std=c++17)
+target_compile_options(harness3 PRIVATE -std=c++17)
+target_compile_options(harness4 PRIVATE -std=c++17)
+target_compile_options(harness5 PRIVATE -std=c++17)
+target_compile_options(harness6 PRIVATE -std=c++17)
then I get stuck here:
Consolidate compiler generated dependencies of target harness5
[ 80%] Building CXX object CMakeFiles/harness5.dir/harness/5/harness.cpp.o
/prg/ttexplore/harness/5/harness.cpp:23:42: error: no member named 'SOLVER_BITWUZLA' in namespace 'triton::engines::solver'
ctx.setSolver(triton::engines::solver::SOLVER_BITWUZLA);
~~~~~~~~~~~~~~~~~~~~~~~~~^
1 error generated.
make[2]: *** [CMakeFiles/harness5.dir/build.make:76: CMakeFiles/harness5.dir/harness/5/harness.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:225: CMakeFiles/harness5.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
can fix this with switching to clang++-14 and:
woot :)
then I get stuck here:
Bitwuzla is a SMT solver (faster than z3 for BV logic) that is optional when compiling Triton. Two solutions:
ctx.setSolver(SOLVER_BITWUZLA);
if you do not want to use bitwuzla in the harness# Install of bitwuzla
$ git clone https://github.com/bitwuzla/bitwuzla
$ cd bitwuzla
$ ./contrib/setup-cadical.sh
$ ./contrib/setup-btor2tools.sh
$ ./contrib/setup-symfpu.sh
$ ./configure.sh --shared
$ sudo make -C build install
# Then, when compiling Triton:
$ cmake -DBITWUZLA_INTERFACE=ON ..
If Triton does not find the bitwuzla library and its include, you can define their paths:
# when compiling Triton
$ cmake -DBITWUZLA_INTERFACE=ON \
-DBITWUZLA_INCLUDE_DIRS=/path/to/my/bitwuzla/include \
-DBITWUZLA_LIBRARIES=/path/to/my/bitwuzla.so \
..
This works, thanks :) I recommend to switch the CMakeLists.txt to c++-17 so it compiles with modern compilers + distros.
Thank you for this! I want to experiment with it, however I already fail at cmake.
I built Triton:
Now I try to configure ttexplore:
and true there is no tritonConfig.cmake, but why wasnt it created?