Compilation error on Linux x86-64 with gfortran

Problems with Dalton installation? Find answers or ask for help here
Post Reply
buchwj
Posts: 2
Joined: 30 Jun 2015, 21:21
First name(s): James
Last name(s): Buchwald
Affiliation: Rensselaer Polytechnic Institute
Country: United States

Compilation error on Linux x86-64 with gfortran

Post by buchwj » 30 Jun 2015, 22:35

Hello,

I'm encountering an issue while trying to compile Dalton2015 for a Linux x86-64 machine using the gnu toolchain. After setting MATH_ROOT to the appropriate value and configuring with

Code: Select all

./setup --mpi
I then try to build the code using make and eventually receive the following error message:

Code: Select all

DALTON-Source/DALTON/abacus/rma_windows.F90:15.6:

  use one_sided_communication_wrappers, only: &
      1
Fatal Error: Can't open module file 'one_sided_communication_wrappers.mod' for reading at (1): No such file or directory
make[3]: *** [CMakeFiles/dalton.dir/DALTON/abacus/rma_windows.F90.o] Error 1
make[2]: *** [CMakeFiles/dalton.dir/DALTON/abacus/rma_windows.F90.o.provides] Error 2
make[1]: *** [CMakeFiles/dalton.dir/all] Error 2
make: *** [all] Error 2
I first received this error using gfortran 4.9.1 and OpenMPI 1.8.1, but the same problem occurs when using gfortran 4.8.3, gfortran 4.7.4, or MVAPICH2 2.0.

I thought at first that since it was a communications module causing the issue that maybe there was something wrong with my MPI setup. However, it seems that the setup script is finding the correct mpicc/mpicxx/mpif90, and the "MPI_COMPATIBLE", "MPI_COMPILER_MATCHES", and "MPI_ITYPE_MATCHES" tests are all successful. I'm a bit lost on what to try next - any advice?

Thanks for your help!

bast
Posts: 1197
Joined: 26 Aug 2013, 13:22
First name(s): Radovan
Last name(s): Bast
Affiliation: none
Country: Germany

Re: Compilation error on Linux x86-64 with gfortran

Post by bast » 01 Jul 2015, 09:01

dear James,
i think that there is no problem with your MPI installation.
what cmake version are you using (cmake --version)?
my feeling is that the cmake dependency scanner gets confused with ", only: &" and tries
to build rma_windows.F90 before building the one_sided_communication_wrappers module.
in older cmake versions this used to be more problematic than in more recent
(i cannot reproduce this problem on my machine).
you can test this hypothesis by changing:

Code: Select all

#ifdef VAR_MPI
  use one_sided_communication_wrappers, only: &
      mpixwincreate,                          &
      mpixwinfree
#endif
to

Code: Select all

#ifdef VAR_MPI
  use one_sided_communication_wrappers
#endif
good luck!
radovan

buchwj
Posts: 2
Joined: 30 Jun 2015, 21:21
First name(s): James
Last name(s): Buchwald
Affiliation: Rensselaer Polytechnic Institute
Country: United States

Re: Compilation error on Linux x86-64 with gfortran

Post by buchwj » 01 Jul 2015, 17:02

Radovan,

You're right, it was a CMake dependency problem that occurs with my build of CMake 3.3.0 RC3. Unfortunately the change you recommended didn't fix the problem, but installing CMake 3.1.8 did. So I guess the dependency issues have returned to the latest version of CMake.

Thanks for your help! Much appreciated.

James

bast
Posts: 1197
Joined: 26 Aug 2013, 13:22
First name(s): Radovan
Last name(s): Bast
Affiliation: none
Country: Germany

Re: Compilation error on Linux x86-64 with gfortran

Post by bast » 01 Jul 2015, 17:13

dear James,
thanks for the confirmation.
could also be a problem with preprocessing in the dependency scanner.
i will test it out with latest CMake and in case i hit the same problem,
it's time for me to submit an issue to the CMake repo.
radovan

bast
Posts: 1197
Joined: 26 Aug 2013, 13:22
First name(s): Radovan
Last name(s): Bast
Affiliation: none
Country: Germany

Re: Compilation error on Linux x86-64 with gfortran

Post by bast » 02 Jul 2015, 08:40

I can reproduce this with CMake 3.3.0 RC3
where Fortran module dependency scanning in combination
with preprocessing seems broken (it looks like
CMake scans first and pre(post)processes then).
I will try to create a small test case and submit this to CMake.
We could work around this on the Dalton side but hopefully we
won't have to.

bast
Posts: 1197
Joined: 26 Aug 2013, 13:22
First name(s): Radovan
Last name(s): Bast
Affiliation: none
Country: Germany

Re: Compilation error on Linux x86-64 with gfortran

Post by bast » 06 Jul 2015, 16:08

This was indeed a bug and is now fixed in CMake:
https://github.com/Kitware/CMake/commit ... 7dd24137e2
If it passes nightly testing it will be merged to 'release' for 3.3.
Thanks again for reporting this! Thanks also to Brad King (Kitware) for the bugfix.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests