Code Monkey home page Code Monkey logo

Comments (4)

vanhauser-thc avatar vanhauser-thc commented on June 11, 2024 1

This works, thanks :)
I recommend to switch the CMakeLists.txt to c++-17 so it compiles with modern compilers + distros.

from ttexplore.

JonathanSalwan avatar JonathanSalwan commented on June 11, 2024

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 ..

from ttexplore.

vanhauser-thc avatar vanhauser-thc commented on June 11, 2024

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

from ttexplore.

JonathanSalwan avatar JonathanSalwan commented on June 11, 2024

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:

  • Remove the line ctx.setSolver(SOLVER_BITWUZLA); if you do not want to use bitwuzla in the harness
  • Compile Triton with the Bitwuzla support

Add bitwuzla to the Triton library

# 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 \
        ..

from ttexplore.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.