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

No rule to make target 'src/frontend/cxx-asttype.def', needed by 'src/frontend/cxx-asttype.c'. Stop. #41

Closed
bhattacharyasarani opened this issue Mar 30, 2022 · 11 comments

Comments

@bhattacharyasarani
Copy link

Hi I am trying to install Nanos6-Mercurium on Ubuntu 20.04 on WSL2:

I install the dependencies and finally configure with the following:
./configure --prefix=$MERCURIUM --enable-ompss-2 --enable-nanos6-bootstrap

The config files are generated, but the make fails saying:
make: *** No rule to make target 'src/frontend/cxx-asttype.def', needed by 'src/frontend/cxx-asttype.c'. Stop.

As a result, make install also fails.
Can you please help me to understand what could solve this issue?

@rofirrim
Copy link
Contributor

Hi, this is a known issue.

Make sure you have bison, flex and gperf installed in your environment. Then run configure again and then make clean and make.

This should fix this issue.

@bhattacharyasarani
Copy link
Author

Hi, thanks for your reply. It was very helpful, but did not solve the problem completely. Hoping you can help me this time as well.

Bison and flex were already installed, I added the installation of gperf.
Now the make progressed a few steps, but stopped with another error.

Pasting the console output for make:

CCBUILD lib/perish.o
CCBUILD lib/tpp.o
CCBUILD lib/tpp
PYTHON src/frontend/cxx-asttype-nodecl.def
TPP src/frontend/cxx-asttype.def
tpp - a tiny preprocessor for mcxx 2.3.0
GEN src/frontend/cxx-asttype.h
GEN src/frontend/cxx-asttype.c
TPP src/frontend/c99.l
tpp - a tiny preprocessor for mcxx 2.3.0
chmod: src/frontend/c99.l: new permissions are r-xrwxrwx, not r-xr-xr-x
make: *** [Makefile:12662: src/frontend/c99.l] Error 1

@rofirrim
Copy link
Contributor

Hi,

src/frontend/c99.l tpp - a tiny preprocessor for mcxx 2.3.0 chmod: src/frontend/c99.l: new permissions are r-xrwxrwx, not r-xr-xr-x make: *** [Makefile:12662: src/frontend/c99.l] Error 1

Not sure what is this problem. Looks like an issue with the umask or maybe the filesystem you are using inside WSL2 does not allow this combination.

@bhattacharyasarani
Copy link
Author

Hi, Thanks you were right. It was indeed a problem of wsl2.
I could manage to install both mercurium and nanos6 in a separate environment.

I could see the compilers generated in mcxx/bin folder.
Thanks :)

But this time I have a followup querry as to how to use this.
Because following the example shown in the nanos github page,
I am trying to simply run a hello world code with the following
$mcxx/bin/mcc -c --ompss-2 hello.c
But it shows the following error
"gcc: fatal error: cannot specify ‘-o’ with ‘-c’, ‘-S’ or ‘-E’ with multiple files"

Am I still missing something? Please let me know what you think.

@rofirrim
Copy link
Contributor

rofirrim commented Apr 1, 2022

Can you run with --v to see how gcc is being invoked by mcc?

@bhattacharyasarani
Copy link
Author

Pasting the full message below:

Loading compiler phases for profile 'mcc'
Compiler phases for profile 'mcc' loaded in 0.04 seconds
Compiling file 'omp_exm.c'
gcc -E -D_OMPSS_2=1 -I -include nanos6.h -std=gnu99 -D_MCC -D_MERCURIUM -o /tmp/mcc_zRRk5X omp_exm.c
gcc: fatal error: cannot specify ‘-o’ with ‘-c’, ‘-S’ or ‘-E’ with multiple files
compilation terminated.
Preprocessing failed. Returned code 1
Preprocess failed for file 'omp_exm.c'
Removing temporary filename '/tmp/mcc_zRRk5X'

@rofirrim
Copy link
Contributor

rofirrim commented Apr 1, 2022

gcc -E -D_OMPSS_2=1 -I -include nanos6.h -std=gnu99 -D_MCC -D_MERCURIUM -o /tmp/mcc_zRRk5X omp_exm.c

This alone -I flag suggests your configuration of Mercurium is not right and doesn't have the right path to nanos6. This is confusing gcc

@bhattacharyasarani
Copy link
Author

Hi, thanks so much for the prompt reply.

Okay I understand the problem, because while configuring I did not mention the location to nanos install directory to break the chicken-egg problem mentioned.

But now how do I explicitly link these two? I mean how to make nanos6.h available to mcc compiler?

@bhattacharyasarani
Copy link
Author

Hi, I was trying more on this. With the following command,
gcc -E -D_OMPSS_2=1 -I -include nanos6.h -std=gnu99 -D_MCC -D_MERCURIUM -o /tmp/mcc_zRRk5X omp_exm.c
if I remove explicitly -E and provide the path to the nanos6.h directory then this works fine and the new executable is stored in /tmp/mcc_OHggqQ
Now my question is, is there a way to change the generation of these flags, in that case which file should I edit?

@rofirrim
Copy link
Contributor

rofirrim commented Apr 4, 2022

But now how do I explicitly link these two? I mean how to make nanos6.h available to mcc compiler?

At configure time you have to pass --with-nanos6 as explained here

https://pm.bsc.es/ftp/ompss-2/doc/user-guide/build/index.html#installation-of-mercurium-compiler

Hope this helps.

@bhattacharyasarani
Copy link
Author

It works perfectly now.
Thank you so much for being so patient and helpful.

@rofirrim rofirrim closed this as completed Apr 4, 2022
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

2 participants