Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while compiling CREST : base/basic_types.cc #5

Open
uwevil opened this issue Jan 14, 2017 · 7 comments
Open

Error while compiling CREST : base/basic_types.cc #5

uwevil opened this issue Jan 14, 2017 · 7 comments

Comments

@uwevil
Copy link

uwevil commented Jan 14, 2017

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

@jburnim
Copy link
Owner

jburnim commented Feb 13, 2017

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.

@liartist
Copy link

liartist commented Jul 27, 2018

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.

@jburnim
Copy link
Owner

jburnim commented Jul 27, 2018

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?

@liartist
Copy link

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
Copy link

liartist commented Jul 31, 2018

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
Copy link

liartist commented Jul 31, 2018

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.

@quinzio
Copy link

quinzio commented Jul 3, 2019

Yep, -no-pie is the cure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants