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

an error occurred when 'make' #83

Open
whoisleehom opened this issue Jul 22, 2020 · 6 comments
Open

an error occurred when 'make' #83

whoisleehom opened this issue Jul 22, 2020 · 6 comments

Comments

@whoisleehom
Copy link

icc -c -Wall -std=c11 -I cafe -I libtree -I libcommon -fopenmp -O3 -DNDEBUG -o release/cafe_family.o cafe/cafe_family.c
cafe/cafe_family.c(188): error: expected an expression
for (int i = 0; i < pcf->num_species; i++)
^

cafe/cafe_family.c(188): error: identifier "i" is undefined
for (int i = 0; i < pcf->num_species; i++)
^

cafe/cafe_family.c(214): error: expected an expression
for (int i = 0; i< ptree->nlist->size; i++) {
^

cafe/cafe_family.c(214): error: identifier "i" is undefined
for (int i = 0; i< ptree->nlist->size; i++) {
^

cafe/cafe_family.c(229): error: expected an expression
for (int i = 0 ; i < pcf->num_species ; i++ )
^

compilation aborted for cafe/cafe_family.c (code 2)
make: *** [release/cafe_family.o] Error 2

This problem happens when I make the source codes of v4.2 and v4.2.1.

@benfulton
Copy link
Member

benfulton commented Jul 22, 2020 via email

@whoisleehom
Copy link
Author

I’m not sure how you got your std flag to be c11, but it should be c++11. The error indicates that a very old language compatibility is being used – C89 I believe.

-- Ben Fulton Indiana University From: whoisleehom [email protected] Sent: Wednesday, July 22, 2020 6:23 AM To: hahnlab/CAFE [email protected] Cc: Subscribed [email protected] Subject: [hahnlab/CAFE] an error occurred when 'make' (#83) icc -c -Wall -std=c11 -I cafe -I libtree -I libcommon -fopenmp -O3 -DNDEBUG -o release/cafe_family.o cafe/cafe_family.c cafe/cafe_family.c(188): error: expected an expression for (int i = 0; i < pcf->num_species; i++) ^ cafe/cafe_family.c(188): error: identifier "i" is undefined for (int i = 0; i < pcf->num_species; i++) ^ cafe/cafe_family.c(214): error: expected an expression for (int i = 0; i< ptree->nlist->size; i++) { ^ cafe/cafe_family.c(214): error: identifier "i" is undefined for (int i = 0; i< ptree->nlist->size; i++) { ^ cafe/cafe_family.c(229): error: expected an expression for (int i = 0 ; i < pcf->num_species ; i++ ) ^ compilation aborted for cafe/cafe_family.c (code 2) make: *** [release/cafe_family.o] Error 2 This problem happens when I make the source codes of v4.2 and v4.2.1. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<#83>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAALIMAYMSKKXGOA6BB5MLLR424ZJANCNFSM4PER3A4Q.

There are two lines in my Makefile:
CFLAGS = -Wall -std=c11 $(INCLUDE) -fopenmp
CXXFLAGS = -Wall -std=c++11 $(INCLUDE) -fopenmp

Is there anything wrong with it?

@shanyunfeng
Copy link

I just meet this problem. How did you resolve it? Thanks

@shanyunfeng
Copy link

I changed gcc version from 4.47 to 5.22 by adding
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/public/software/gcc-5.2.0/include
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/public/software/gcc-5.2.0/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/public/software/gcc-5.2.0/lib64:/public/software/gcc-5.2.0/mpc-0.8.1/lib:/public/software/gcc-5.2.0/l$
export LIBRARY_PATH=$LIBRARY_PATH:/public/software/gcc-5.2.0/lib64:/public/software/gcc-5.2.0/mpc-0.8.1/lib:/public/software/gcc-5.2.0/lib:/pu$
export PATH=/public/software/gcc-5.2.0/bin:$PATH

to my path

@shanyunfeng
Copy link

It still does not work.

make, then showed the same message as above.

@benfulton
Copy link
Member

What is the output of

$ gcc --version
$ gcc -c -Wall -std=c11 -I cafe -I libtree -I libcommon -fopenmp -O3 -DNDEBUG -o release/cafe_family.o cafe/cafe_family.c

?

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

3 participants