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

Compiling GRASP using gfortran-10 fails #46

Closed
jagot opened this issue Jul 13, 2020 · 3 comments
Closed

Compiling GRASP using gfortran-10 fails #46

jagot opened this issue Jul 13, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@jagot
Copy link
Member

jagot commented Jul 13, 2020

Compiling with the latest version of gfortran, i.e. 10, fails with the following error:

/tmp/grasp/src/lib/lib9290/iniest2.f90:82:23:

   79 |          CALL DCOPY (NS, VEC(NS*(J-1)+1), 1, BASIS(NCF*(J-1)+1), 1)
      |                         2
......
   82 |       CALL DCOPY (NIV, EIGVAL, 1, BASIS(NIV*NCF+1), 1)
      |                       1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
make[2]: *** [src/lib/lib9290/CMakeFiles/9290.dir/iniest2.f90.o] Error 1
make[1]: *** [src/lib/lib9290/CMakeFiles/9290.dir/all] Error 2
make: *** [all] Error 2

It seems it's the same problem as scipy/scipy#11611

Compiling with version 9 works, i.e. on a Mac where I have multiple versions installed, I can do

> FC=gfortran-9 ./configure.sh
> cd build && make
@mortenpi
Copy link
Member

Thanks for the report and the ref. It might be a while before we fix the underlying issues.

But based on the GCC porting guide it should be sufficient to drop something like this into the CMakeLists.user file:

set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")

to work around the error. Or equivalent into Make.user, for those using Makefiles.

@jongrumer
Copy link
Member

jongrumer commented Sep 30, 2020

Great, I just encountered this as well, and hadn't noticed your issue so created a new one - stupid. Anyway, I found the same workaround as Morten. We have tons of these missmatches around the code unfortunately, both scalar-rank-1 and real-4-real-8 etc. Not sure what to do really, I guess we could add the -fallow-argument-mismatch flag by default, but has to come with an if-statement since it only works for gfortran-10 and not below.

So, as a temporary fix if you're using gfortran-10 (and only then) as Morten suggested, but in non-cmake-lingo, append the FC_FLAG variable with this flag (directly in the terminal before making or in a new file Make.user, automatically read by the Makefile):

export FC_FLAGS="$FC_FLAGS -fallow-argument-mismatch"

@mortenpi
Copy link
Member

Closing this in favour of #77.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants