crest icon indicating copy to clipboard operation
crest copied to clipboard

Error while compiling CREST : base/basic_types.cc

Open uwevil opened this issue 8 years ago • 7 comments

Hello, I'am starting using CREST but as subject, I have a problem of "narrowing conversion" as follow

vagrant@vagrant:~/vagrant_data/tools/jburnim-crest-f5ff7fc/src$ make g++ -I. -I../../yices-1.0.40/include -Wall -O2 -c -o base/basic_types.o base/basic_types.cc base/basic_types.cc:96:1: error: narrowing conversion of '18446744073709551615u' from 'long unsigned int' to 'crest::value_t {aka long long int}' inside { } [-Wnarrowing] }; ^ base/basic_types.cc:96:1: error: narrowing conversion of '18446744073709551615ull' from 'long long unsigned int' to 'crest::value_t {aka long long int}' inside { } [-Wnarrowing] : recipe for target 'base/basic_types.o' failed make: *** [base/basic_types.o] Error 1

How is it? Does anyone have same problem?

I'm using Lubuntu 16.10, running on VM.

Thank you for your help. uwevil

uwevil avatar Jan 14 '17 17:01 uwevil

What version of g++ are you using? In particular, what is the output of running g++ --version?

It looks like gcc6 now treats "narrowing conversions" as an error rather than a warning. You should be able to work around this issue by either using an earlier version of gcc or by adding -std=gnu++98 to CFLAGS in crest/src/Makefile.

jburnim avatar Feb 13 '17 01:02 jburnim

I encountered same problem with uwevil, and solved it. But as I proceed,

g++ -I. -I/home/Desktop/yices-1.0.40/include -Wall -O2 -std=gnu++98 -c -o base/yices_solver.o base/yices_solver.cc base/yices_solver.cc:18:10: fatal error: yices_c.h: No such file or directory #include <yices_c.h> ^~~~~~~~~~~ compilation terminated. <builtin>: recipe for target 'base/yices_solver.o' failed make: *** [base/yices_solver.o] Error 1

this error came out, so I edited the location of yices_c.h in yices_solver.cc to my yices directory. then,

/usr/bin/x86_64-linux-gnu-ld: cannot find -lyices collect2: error: ld returned 1 exit status <builtin>: recipe for target 'run_crest/run_crest' failed make: *** [run_crest/run_crest] Error 1

this new error came out and I can't solve it since there's not enough info. Can you suggest some solutions for me? Since I just made new VM environment, some essential materials are not installed so it could be a problem. I'm using Ubuntu 18.04.1 +. I tested same routine with Ubuntu 16.04.4, and same things happened.

liartist avatar Jul 27 '18 06:07 liartist

this error came out, so I edited the location of yices_c.h in yices_solver.cc to my yices directory. then

Have you set YICES_DIR in crest/src/Makefile to point to the directory containing Yices on your machine?

What version of Yices have you downloaded?

jburnim avatar Jul 27 '18 16:07 jburnim

Thank you for the reply! I downloaded last release of Yices1(version 1.0.40) tar file and extracted at the VM, and edited YICES_DIR in crest/src/Makefile to be connected with my extracted Yices directory. I also downloaded and installed GMP(GNU Multiprecision library) as Yices download page says, but I'm not sure it solved any problems I have.

liartist avatar Jul 30 '18 09:07 liartist

here's the full error message

lartist@ubuntu:~/Desktop/crest-master/src$ make g++ -I. -I/home/lartist/Desktop/yices-1.0.40-x86_64-unknown-linux-gnu-static-gmp/yices-1.0.40/include -Wall -O2 -Wno-deprecated -L/home/lartist/Desktop/yices-1.0.40-x86_64-unknown-linux-gnu-static-gmp/yices-1.0.40/lib run_crest/run_crest.cc run_crest/concolic_search.o base/basic_types.o base/symbolic_execution.o base/symbolic_interpreter.o base/symbolic_path.o base/symbolic_predicate.o base/symbolic_expression.o base/yices_solver.o -lyices -o run_crest/run_crest /usr/bin/x86_64-linux-gnu-ld: /home/lartist/Desktop/yices-1.0.40-x86_64-unknown-linux-gnu-static-gmp/yices-1.0.40/lib/libyices.a(yices.o): relocation R_X86_64_32 against symbol '_ZNSt8__detail12__prime_listE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status <builtin>: recipe for target 'run_crest/run_crest' failed make: *** [run_crest/run_crest] Error 1

liartist avatar Jul 31 '18 07:07 liartist

I added -no-pie option to src/makefile and it seems working! I can proceed now. Thanks!

+. Ubuntu version 18 has package crush issue. 16 was fine

++. I found silly situation. I installed many things like GMP, updated every packages so that the installation process encountered many problems. However, when I re-installed with simple guidelines(extract yices, edit YICES_DIR, installed ocaml and g++-multilib), not much errors came out and CREST running process was fine.

liartist avatar Jul 31 '18 08:07 liartist

Yep, -no-pie is the cure.

quinzio avatar Jul 03 '19 21:07 quinzio