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

configuration with Intel compilers is broken #202

Open
tjhei opened this issue Jun 23, 2021 · 8 comments · May be fixed by #245
Open

configuration with Intel compilers is broken #202

tjhei opened this issue Jun 23, 2021 · 8 comments · May be fixed by #245
Assignees

Comments

@tjhei
Copy link
Member

tjhei commented Jun 23, 2021

Intel compilers do not configure correctly due to #159

We used to do

FC=mpiifort CXX=mpiicpc CC=mpiicc cmake -D DEAL_II_WITH_MPI:BOOL=ON ..

which works correctly. But, according to dealii/dealii#11478 (comment) I should do:

CXX=icpc CC=icc cmake -D DEAL_II_WITH_MPI=ON -D MPI_CXX_COMPILER=mpiicpc -D MPI_C_COMPILER=mpiicc ..

but this fails with:

Imported target "MPI::MPI_C" includes non-existent path

    "/home/heister/deal.ii-candi/tmp/unpack/deal.II-v9.3.0/'/software/external/intelmpi/oneapi/mpi/2021.1.1/include'"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

Not setting CXX also fails (it picks up the system g++ and bails).

How do I know when to set CXX to the mpi wrapper and automatically?

cmake 3.16.3, intel 19.1.3

@koecher
Copy link
Contributor

koecher commented Jun 24, 2021

How do I know when to set CXX to the mpi wrapper and automatically?

I think there are compilers out there, for which we can't know it automatically. I remember having issues with an older intel compiler series.

Maybe we should introduce a special case for intel compilers, as you suggested.

Or, we undo #159 and find a different solution to that. In the comments of #159 I remarked that this may lead to issues for some compilers.

@masterleinad
Copy link
Member

"/home/heister/deal.ii-candi/tmp/unpack/deal.II-v9.3.0/'/software/external/intelmpi/oneapi/mpi/2021.1.1/include'"

It's pretty weird that there are additional apostrophes in that path. I guess it should just be /software/external/intelmpi/oneapi/mpi/2021.1.1/include?

@tamiko
Copy link
Member

tamiko commented Jun 24, 2021

@tjhei There is definitely something funny with the toolchain.

Testing your configuration line

CXX=icpc CC=icc cmake -D DEAL_II_WITH_MPI=ON -D MPI_CXX_COMPILER=mpiicpc -D MPI_C_COMPILER=mpiicc ..

works like a charm on TACC resources (the only intel compiler I have access to).

The mpiicc, mpicpc wrappers are simple shell scripts. Just for confirmation - what happens with the following (assuming intelmpi)?

% export CC=icc
% export CXX=icpc
% export I_MPI_CC=icc
% export I_MPI_CXX=icpc
% mpicc -V
Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.1.217 Build 20200306
% cmake -DWITH_MPI=ON ..

@tjhei
Copy link
Member Author

tjhei commented Jun 24, 2021

works like a charm on TACC resources (the only intel compiler I have access to).

@zjiaqi2018 this did not work for you on frontera but hangs in DEAL_II_HAVE_USABLE_FLAGS_DEBUG right?

@tjhei
Copy link
Member Author

tjhei commented Jun 24, 2021

It's pretty weird that there are additional apostrophes in that path.

Yes, but I can not find it in env, so I wonder if the cmake MPI detection is broken.

@zjiaqi2018
Copy link

works like a charm on TACC resources (the only intel compiler I have access to).

@zjiaqi2018 this did not work for you on frontera but hangs in DEAL_II_HAVE_USABLE_FLAGS_DEBUG right?

Yes, after more than half an hour, still here...

@tjhei
Copy link
Member Author

tjhei commented Jun 24, 2021

The mpiicc, mpicpc wrappers are simple shell scripts. Just for confirmation - what happens with the following (assuming intelmpi)?

Same error with the broken include path. I guess it would work if that path wasn't there.
I think the broken path is because of the apostrophe in:

$ mpicxx -show
g++ -I'/software/external/intelmpi/oneapi/mpi/2021.1.1/include' -L'/software/external/intelmpi/oneapi/mpi/2021.1.1/lib/release' -L'/software/external/intelmpi/oneapi/mpi/2021.1.1/lib' -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker '/software/external/intelmpi/oneapi/mpi/2021.1.1/lib/release' -Xlinker -rpath -Xlinker '/software/external/intelmpi/oneapi/mpi/2021.1.1/lib' -lmpicxx -lmpifort -lmpi -lrt -lpthread -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -Xlinker --enable-new-dtags -ldl
$ I_MPI_CXX=icpc mpicxx -show
icpc -I'/software/external/intelmpi/oneapi/mpi/2021.1.1/include' -L'/software/external/intelmpi/oneapi/mpi/2021.1.1/lib/release' -L'/software/external/intelmpi/oneapi/mpi/2021.1.1/lib' -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker '/software/external/intelmpi/oneapi/mpi/2021.1.1/lib/release' -Xlinker -rpath -Xlinker '/software/external/intelmpi/oneapi/mpi/2021.1.1/lib' -lmpicxx -lmpifort -lmpi -ldl -lrt -lpthread

but I still blame cmake for that.

@tjhei
Copy link
Member Author

tjhei commented Jun 26, 2021

Updating cmake from 3.16 to 3.20 fixes it... :-(

tjhei added a commit to tjhei/candi that referenced this issue Jun 28, 2021
Setting the compiler wrapper in CMake instead of in CC and CXX is
recommended, but only works for recent CMake versions (one configuration
I tested requires CMake 3.20 for the intel compiler).
With 9.3.1 deal.II supports setting CXX=mpicxx again, so only do the
above when a setting in candi.cfg is specified.
Works around dealii#202
and fixes feature introduced in dealii#159
tjhei added a commit that referenced this issue Jun 28, 2021
Setting the compiler wrapper in CMake instead of in CC and CXX is
recommended, but only works for recent CMake versions (one configuration
I tested requires CMake 3.20 for the intel compiler).
With 9.3.1 deal.II supports setting CXX=mpicxx again, so only do the
above when a setting in candi.cfg is specified.
Works around #202
and fixes feature introduced in #159
@koecher koecher mentioned this issue Jun 30, 2021
@koecher koecher linked a pull request Jul 9, 2021 that will close this issue
16 tasks
@koecher koecher linked a pull request Jul 9, 2021 that will close this issue
16 tasks
@koecher koecher self-assigned this Jul 9, 2021
maxrudolph pushed a commit to maxrudolph/candi that referenced this issue Nov 2, 2022
Setting the compiler wrapper in CMake instead of in CC and CXX is
recommended, but only works for recent CMake versions (one configuration
I tested requires CMake 3.20 for the intel compiler).
With 9.3.1 deal.II supports setting CXX=mpicxx again, so only do the
above when a setting in candi.cfg is specified.
Works around dealii#202
and fixes feature introduced in dealii#159
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

Successfully merging a pull request may close this issue.

5 participants