meelgroup / arjun

CNF minimizer and minimal independent set calculator
Other
15 stars 3 forks source link

static compilation #11

Closed ydotlai closed 5 months ago

ydotlai commented 5 months ago

Would it be possible to provide a tutorial about static compilation?

BTW, it seems that some "cd .." are missed in the building script.

msoos commented 5 months ago

Hi,

You need to use -DSTATICCOMPILE=ON for all of the things compiled with cmake. It will then compile everything perfectly as a static binary!

I hope this helps,

Mate

msoos commented 5 months ago

Thanks for the feedback about the cd .. ! I now fixed it :)

Mate

ydotlai commented 5 months ago

Thanks a lot to Mate.

ydotlai commented 5 months ago

Hi Mate:

I am trying to statically compile Arjun. I encountered some issue when I was compiling cryptominisat:

[ 1%] Building CXX object cmsat5-src/CMakeFiles/cryptominisat5.dir/cnf.cpp.o [ 3%] Building CXX object cmsat5-src/CMakeFiles/cryptominisat5.dir/probe.cpp.o [ 5%] Building CXX object cmsat5-src/CMakeFiles/cryptominisat5.dir/oracle_use.cpp.o [ 7%] Building CXX object cmsat5-src/CMakeFiles/cryptominisat5.dir/backbone.cpp.o /home/mok/work_space/arjun_space/cryptominisat/src/backbone.cpp: In member function ‘bool CMSat::Solver::backbone_simpl(int64_t, bool&)’: /home/mok/work_space/arjun_space/cryptominisat/src/backbone.cpp:53:29: error: too few arguments to function ‘int CadiBack::doit(const std::vector&, int, std::vector&, std::vector&)’ 53 | int sat = CadiBack::doit(cnf, conf.verbosity, ret); | ~~~~^~~~~~~~ In file included from /home/mok/work_space/arjun_space/cryptominisat/src/backbone.cpp:24: /home/mok/work_space/arjun_space/cryptominisat/../cadiback/cadiback.h:5:5: note: declared here 5 | int doit (const std::vector& cnf, | ^~~~ /home/mok/work_space/arjun_space/cryptominisat/src/backbone.cpp:28:37: warning: unused parameter ‘orig_max_confl’ [-Wunused-parameter] 28 | bool Solver::backbone_simpl(int64_t orig_max_confl, bool& finished) | ~~^~~~ make[2]: [cmsat5-src/CMakeFiles/cryptominisat5.dir/build.make:118: cmsat5-src/CMakeFiles/cryptominisat5.dir/backbone.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:157: cmsat5-src/CMakeFiles/cryptominisat5.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

msoos commented 5 months ago

I see. You need to use 69255f55e411207c4bdea02c6c2ab1ef29740ce1 of CadiBack -- I added a new feature yesterday. Sorry!

Mate

ydotlai commented 5 months ago

It works now. Thank Mate.