I tried to build solidity compiler (solc) from source code, which was cloned from Solidity Git Repository. I followed the instructions in Solidity Documentation, but I ran into an error when execute:
cmake .. && make. The cmake error is as follows:
[ 42%] Building CXX object libsolidity/CMakeFiles/solidity.dir/formal/Z3Interface.cpp.o /my/path/to/solidity/libsolidity/formal/Z3Interface.cpp: In member function ‘z3::expr dev::solidity::smt::Z3Interface::toZ3Expr(const dev::solidity::smt::Expression&)’: /my/path/to/solidity/libsolidity/formal/Z3Interface.cpp:166:14: error: ‘mod’ is not a member of ‘z3’ return z3::mod(arguments, arguments); ^~~ /my/path/to/solidity/libsolidity/formal/Z3Interface.cpp:166:14: note: suggested alternative: ‘cond’ return z3::mod(arguments, arguments); ^~~ cond libsolidity/CMakeFiles/solidity.dir/build.make:1166: recipe for target 'libsolidity/CMakeFiles/solidity.dir/formal/Z3Interface.cpp.o' failed make: *** [libsolidity/CMakeFiles/solidity.dir/formal/Z3Interface.cpp.o] Error 1 CMakeFiles/Makefile2:389: recipe for target 'libsolidity/CMakeFiles/solidity.dir/all' failed make: *** [libsolidity/CMakeFiles/solidity.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2
I have installed z3 prover with pre-built binaries (version 4.8.4 - 64 bit - build hashcode d6df51951f4c) provided here and z3/bin has been included in my PATH variable.
I was using Ubuntu 18.04.
Did I install z3 in a wrong way? Solidity Documentation mentions that z3 is optional, so I don't think this error is related to my z3 installation.
Can anybody help? Thanks very much!