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

Fix argument mismatches in the code base #77

Open
mortenpi opened this issue Nov 22, 2021 · 0 comments
Open

Fix argument mismatches in the code base #77

mortenpi opened this issue Nov 22, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@mortenpi
Copy link
Member

mortenpi commented Nov 22, 2021

As evident from #46 and #76, we have some argument mismatches in the code base. GCC 10 is just finally strict enough to catch these. This leads to errors like:

/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

As suggested in the GCC manual, we should investigate and fix them (rather than disabling the warning/error):

Depending on their nature, argument mismatches have the potential to cause the generation of invalid code and, hence, should be investigated.

As a workaround, however, it is still possible to build GRASP on GCC 10 if -fallow-argument-mismatch is passed. With CMake, this can be done by configuring the build as:

mkdir build/
cd build/
cmake .. -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch"

And with the Makefile-based build (ref: #46 (comment)) it should be sufficient to set the following before calling make:

export FC_FLAGS="$FC_FLAGS -fallow-argument-mismatch"
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

1 participant