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

Cmake error when compiling Trilinos on Ubuntu 18.04 through Candi #185

Closed
blaisb opened this issue Jun 2, 2021 · 13 comments
Closed

Cmake error when compiling Trilinos on Ubuntu 18.04 through Candi #185

blaisb opened this issue Jun 2, 2021 · 13 comments

Comments

@blaisb
Copy link
Member

blaisb commented Jun 2, 2021

Dear all,
When trying to compile Trilinos on Ubuntu 18.04 through Candi master branch I get the following error:
CMake Error: Unknown argument -O5 CMake Error: Run 'cmake --help' for all supported options. Failure with exit status: 1 Exit message: There was a problem configuring trilinos 12-18-1

The CMake version on my machine is 3.20.3 (installed through snap)
And my compiler is gcc 7.5
I can compile Trilinos manually using CMake elsewhere and I used to be able to do it through candi. Was this flag recently introduced?

The following SO post seems to mention that this means this flag was always ignored?
https://stackoverflow.com/questions/67390153/cmake-error-unknown-argument-vv-when-installing-trilinos

@koecher
Copy link
Contributor

koecher commented Jun 2, 2021

@blaisb can you try it with the candi package cmake? This was recently updated to 3.16 from 3.11 and I read that there are issues with cmake 3.20.

@koecher
Copy link
Contributor

koecher commented Jun 2, 2021

@tjhei I believe that the -O5 setting in the trilinos package for the fortran compiler should be corrected.

@blaisb
Copy link
Member Author

blaisb commented Jun 2, 2021

@blaisb can you try it with the candi package cmake? This was recently updated to 3.16 from 3.11 and I read that there are issues with cmake 3.20.

Is there a way to force candi to use the bundled CMAKE? Otherwise I can uninstall cmake on my machine and reinstall it if you want.

@koecher
Copy link
Contributor

koecher commented Jun 2, 2021

candi sets automaticly the path correctly during its run, you only have to use it before the trilinos package

@koecher
Copy link
Contributor

koecher commented Jun 2, 2021

@blaisb enable line 54 in the candi.cfg file

@blaisb
Copy link
Member Author

blaisb commented Jun 2, 2021

@blaisb enable line 54 in the candi.cfg file

This works (at least for Trilinos)
It would be worth it though to start preparing for cmake 3.20 :). I can help with that if you want.
Thanks for the help!

@koecher
Copy link
Contributor

koecher commented Jun 2, 2021

@blaisb nice. I think I had the same issue two weeks ago and the fix was changing O5 to O3, but I forget the PR and the details. Would be cool if you can test this.

@blaisb
Copy link
Member Author

blaisb commented Jun 2, 2021

@blaisb nice. I think I had the same issue two weeks ago and the fix was changing O5 to O3, but I forget the PR and the details. Would be cool if you can test this.

Yeah sure, i'll try to dig into it and propose a PR that changes the Trilinos flag. My students use candi a lot to build since they are generally less familiar with CMake, so I'd be glad to help in maintaining it :).

@tjhei
Copy link
Member

tjhei commented Jun 3, 2021

We are talking about

-D CMAKE_FORTRAN_FLAGS:STRING=-g -O5 \

right? It looks like there are quotes around these options missing as well or am I totally confused?

@koecher
Copy link
Contributor

koecher commented Jun 4, 2021

@tjhei yes this line. For me, setting O5 to O3 was working, at least I don't know O5; cf.

https://gcc.gnu.org/onlinedocs/gcc-8.2.0/gcc/Optimize-Options.html

@blaisb
Copy link
Member Author

blaisb commented Jun 4, 2021

@tjhei yes this line. For me, setting O5 to O3 was working, at least I don't know O5; cf.

https://gcc.gnu.org/onlinedocs/gcc-8.2.0/gcc/Optimize-Options.html

Yeah so I don't think that O5 is recognized as an option for the Fortran flag. In the past (CMAKE <3.20) this is means it was just ignored, but now if the flag is not accepted by the compiler, CMake aborts. Hence it just means that this flag was most likely never really used for most platforms/compilers. Would be a good idea to switch to O3.

@tjhei
Copy link
Member

tjhei commented Jun 4, 2021

Yeah, makes sense.

This was referenced Jun 18, 2021
@ghost
Copy link

ghost commented Jun 21, 2021

We replaced the compiler flag O5 to O3 in #192.

@tjhei tjhei closed this as completed Jun 21, 2021
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