FlorentAvellaneda / EvalMaxSAT

State-of-the-art MaxSAT Solver & Library Based on Unsat Core Guided Techniques
GNU General Public License v3.0
15 stars 5 forks source link

Error when buid EvalMaxSAT #2

Closed TheCrott closed 3 years ago

TheCrott commented 3 years ago

I'm building EvalMaxSAT as optimin dependency with pre-built llvm 11 and 12 on ubuntu 20.04 got an error. Stack traces in this gist https://gist.github.com/TheCrott/ab7a21f9c862d0838f5cb65843906c2a

FlorentAvellaneda commented 3 years ago

I don't see any compile error of EvalMaxSAT in the log except the return "Error 2" from the makefile you use. What command do you use to compile? I can try on my side.

TheCrott commented 3 years ago

I don't see any compile error of EvalMaxSAT in the log except the return "Error 2" from the makefile you use. What command do you use to compile? I can try on my side.

First install AFL++ then go to utils/optimin dir then run ./build_optimin.sh

FlorentAvellaneda commented 3 years ago

The compilation works in my side (Ubuntu 20.04.2 LTS) : https://gist.github.com/FlorentAvellaneda/41fba17de3f3526a095ffa6209e93b61

If you try to compile EvalMaxSAT without the "./build_optimin.sh" script, does it work?

git clone https://github.com/FlorentAvellaneda/EvalMaxSAT.git
mkdir EvalMaxSAT/build
cd EvalMaxSAT/build
cmake ..
make
TheCrott commented 3 years ago

The compilation works in my side (Ubuntu 20.04.2 LTS) : https://gist.github.com/FlorentAvellaneda/41fba17de3f3526a095ffa6209e93b61

If you try to compile EvalMaxSAT without the "./build_optimin.sh" script, does it work?

git clone https://github.com/FlorentAvellaneda/EvalMaxSAT.git
mkdir EvalMaxSAT/build
cd EvalMaxSAT/build
cmake ..
make

I'm able to build EvalMaxSAT without build_optimin.sh script with LLVM 11

FlorentAvellaneda commented 3 years ago

Maybe try installing zlib, I just saw that it doesn't seem to be installed on your computer: sudo apt install zlib1g-dev And also try to compile from "AFLplusplus/utils/optimin/build/EvalMaxSAT".

TheCrott commented 3 years ago

Maybe try installing zlib, I just saw that it doesn't seem to be installed on your computer: sudo apt install zlib1g-dev And also try to compile from "AFLplusplus/utils/optimin/build/EvalMaxSAT".

Before installing AFL++ and EvalMaxSAT I already install zlib1g-dev Compile EvalMaxSAT from AFLplusplus/utils/optimin/build/EvalMaxSAT success, not error Seems the error occured only when install EvalMaxSAT using build_optimin.sh script

FlorentAvellaneda commented 3 years ago

OK, we seem to be getting closer to the problem. It seems that:

cmake .. -DLLVM_DIR=`$LLVM_CONFIG --cmakedir` || exit 1
make -j$CORES || exit 1

from build.sh is problematic.

Maybe it's the multithreaded compilation that is the cause ? Try with or without the -j option

cd /home/aldo/AFLplusplus/utils/optimin/build
make -j4 # Error occurs ?
make     # Fix the problem ?
TheCrott commented 3 years ago

OK, we seem to be getting closer to the problem. It seems that:

cmake .. -DLLVM_DIR=`$LLVM_CONFIG --cmakedir` || exit 1
make -j$CORES || exit 1

from build.sh is problematic.

Maybe it's the multithreaded compilation that is the cause ? Try with or without the -j option

cd /home/aldo/AFLplusplus/utils/optimin/build
make -j4 # Error occurs ?
make     # Fix the problem ?

It give me error too both make and make -j2 in /home/aldo/AFLplusplus/utils/optimin/build and optimin directory

When I make symlink to llvm 12 lld by typing sudo ln -s /usr/local/clang_12.0.0/bin/ld.lld /usr/bin/ld it give me this error

ld: error: undefined symbol: typeinfo for llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x5E48)
>>> did you mean: vtable for llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >
>>> defined in: /usr/local/clang_12.0.0/lib/libLLVMSupport.a(CommandLine.cpp.o)

ld: error: undefined symbol: typeinfo for llvm::cl::Option
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x5EF8)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x7378)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x42FD8)
>>> referenced 12 more times
>>> did you mean: vtable for llvm::cl::Option
>>> defined in: /usr/local/clang_12.0.0/lib/libLLVMSupport.a(CommandLine.cpp.o)

ld: error: undefined symbol: typeinfo for llvm::cl::basic_parser_impl
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x84F8)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x85F8)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x86F8)
>>> referenced 2 more times

ld: error: undefined symbol: typeinfo for llvm::MemoryBuffer
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x90C8)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x9448)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x9478)
>>> referenced 4 more times

ld: error: undefined symbol: typeinfo for llvm::raw_ostream
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0xA2A8)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0xA318)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0xA388)
>>> referenced 48 more times

ld: error: undefined symbol: typeinfo for llvm::ErrorInfoBase
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x14C28)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x4AB68)

ld: error: undefined symbol: typeinfo for llvm::cl::opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, false, llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x42F48)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x45508)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x45738)
>>> referenced 2 more times

ld: error: undefined symbol: typeinfo for llvm::cl::opt<bool, false, llvm::cl::parser<bool> >
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x44468)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x453B8)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(.data+0x46AF8)

ld: error: undefined symbol: typeinfo for llvm::cl::GenericOptionValue
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(typeinfo for llvm::cl::OptionValueCopy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)
>>> referenced by OptiMin.cpp
>>>               CMakeFiles/optimin.dir/OptiMin.cpp.o:(typeinfo for llvm::cl::OptionValueCopy<bool>)
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/CMakeFiles/optimin.dir/build.make:92: src/optimin] Error 1
make[1]: *** [CMakeFiles/Makefile2:415: src/CMakeFiles/optimin.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
60 warnings generated.
[100%] Linking CXX executable EvalMaxSAT_bin
[100%] Built target EvalMaxSAT_bin
make: *** [Makefile:130: all] Error 2
FlorentAvellaneda commented 3 years ago

OK, so the problem is not with EvalMaxSAT, but seems to come from OptiMin.cpp. The error I'm seeing seems to suggest that there is a problem with loading the libllvm.

I suggest you post this last error message on https://github.com/AFLplusplus/AFLplusplus/issues/1069

TheCrott commented 3 years ago

OK, so the problem is not with EvalMaxSAT, but seems to come from OptiMin.cpp. The error I'm seeing seems to suggest that there is a problem with loading the libllvm.

I suggest you post this last error message on AFLplusplus/AFLplusplus#1069

Okay, thanks for the help