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

OpenMOLCAS interface compilation error #25

Open
lorisercole opened this issue Apr 22, 2024 · 5 comments
Open

OpenMOLCAS interface compilation error #25

lorisercole opened this issue Apr 22, 2024 · 5 comments

Comments

@lorisercole
Copy link

lorisercole commented Apr 22, 2024

Hello,
I am trying to build the OpenMOLCAS Fortran interface with the BUILD_OPENMOLCAS_INTERFACE option, but I get these errors:

/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1071:25:

 1071 |     Call GA_Brdcst(MT_DBL, [res], storage_size(res)/8, 0)
      |                         1
Error: Symbol 'mt_dbl' at (1) has no IMPLICIT type
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:792:27:

  792 |       call GA_Brdcst(MT_DBL, [dmrg_energy%dmrg], storage_size(dmrg_energy%num_sweeps)/8, 0)
      |                           1
Error: Symbol 'mt_dbl' at (1) has no IMPLICIT type
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:797:27:

  797 |       call GA_Brdcst(MT_INT, dmrg_energy%num_sweeps, size(dmrg_energy%num_sweeps)*storage_size(dmrg_energy%num_sweeps)/8, 0)
      |                           1
Error: Symbol 'mt_int' at (1) has no IMPLICIT type
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:680:30:

  680 |         call GA_Brdcst(MT_BYTE, fiedler_order_str, len_fiedler_str, 0)
      |                              1
Error: Symbol 'mt_byte' at (1) has no IMPLICIT type
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:679:29:

  679 |         call GA_Brdcst(MT_INT, [len_fiedler_str], storage_size(len_fiedler_str)/8,0)
      |                             1
Error: Symbol 'mt_int' at (1) has no IMPLICIT type
make[2]: *** [lib/interfaces/openmolcas/CMakeFiles/qcmaquis-driver.dir/build.make:104: lib/interfaces/openmolcas/CMakeFiles/qcmaquis-driver.dir/qcmaquis_interface.f90.o] Error 1
make[2]: Leaving directory '/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-build-e4onxoy'
make[1]: *** [CMakeFiles/Makefile2:271: lib/interfaces/openmolcas/CMakeFiles/qcmaquis-driver.dir/all] Error 2

and a bunch of these warnings:

/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1225:2:

 1225 | #ifdef _MOLCAS_MPP_
      |  1
Warning: Illegal preprocessor directive
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1227:2:

 1227 | #endif
      |  1
Warning: Illegal preprocessor directive
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1235:2:

 1235 | #ifdef _MOLCAS_MPP_
      |  1
Warning: Illegal preprocessor directive
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1237:2:

 1237 | #endif
      |  1
Warning: Illegal preprocessor directive
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1258:2:

 1258 | #ifdef _MOLCAS_MPP_
      |  1
Warning: Illegal preprocessor directive
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1260:2:

 1260 | #endif
      |  1
Warning: Illegal preprocessor directive
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1272:2:

 1272 | #ifdef _MOLCAS_MPP_
      |  1
Warning: Illegal preprocessor directive
/mnt/nvme/tmpscratch/root/spack-stage/spack-stage-scine-qcmaquis-3.1.4-e4onxoy7w5qj5giziaxktohwqcsswbmu/spack-src/dmrg/lib/interfaces/openmolcas/qcmaquis_interface.f90:1274:2:

 1274 | #endif
      |  1
Warning: Illegal preprocessor directive

I tried several different compilers (GCC 9-12, Clang, Intel), but they all fail on the qcmaquis_interface.f90 file.
Do you have any suggestions?

The cmake command is essentially this:

cmake -DBUILD_SYMMETRIES:STRING=SU2U1;SU2U1PG;TwoU1;TwoU1PG -DBUILD_OPENMOLCAS_INTERFACE:BOOL=ON -DQCMAQUIS_TESTS:BOOL=OFF -DLAPACK_64_BIT:BOOL=ON ../src/dmrg'

and I am using MKL libs.
Thank you.

@lorisercole
Copy link
Author

It seems to be a problem with the flags used by Cmake to compile these modules.
The -cpp flag was not used.

@kszenes
Copy link
Member

kszenes commented Apr 24, 2024

Hi Loris,

I have been unable to reproduce the errors you are having on a GCC 10 and GCC 13 compiler.
However, it does seem that your Fortran compiler is not properly registering the C preprocessor macros. This is precisely what the -cpp flag is supposed to do in the Cmake file. One option could be renaming the extension of the 5 Fortran files from .f90 to .F90. This file extensions should automatically trigger the preprocessor. Since I am unable to reproduce your errors, would you mind trying this out and letting me know if this fixed your issue? (You also need to change the file extensions in dmrg/lib/interfaces/openmolcas/CMakeLists.txt). If this fixes the issue that you are experiencing, I could then propagate this down to the main branch.

Best,
Kalman

@lorisercole
Copy link
Author

Hi @kszenes , thanks for our help!
It might be an issue with my compiler (I am actually using spack to build qcmaquis, so it takes care of setting up the compiler).
Anyway, I managed to solve the issue by patching dmrg/lib/interfaces/openmolcas/CMakeLists.txt.
I attach the patch here.

cmake_molcas_interface.patch

@kszenes
Copy link
Member

kszenes commented Apr 24, 2024

Thanks for sharing the patch! I will look into including it directly in the main branch.

I saw that you were working with spack. Are you developing a spack package for qcmaquis? If so, would you mind sharing it with us? This was something I wanted to look into as well.

@lorisercole
Copy link
Author

Yes, actually there is already a recipe available here: https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/scine-qcmaquis/package.py
I am going to push a PR to update it and add this patch with it.

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

2 participants