Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

CMake cannot find fortran after restoring from the cache #10

Closed
sanguinariojoe opened this issue Oct 22, 2022 · 7 comments
Closed

CMake cannot find fortran after restoring from the cache #10

sanguinariojoe opened this issue Oct 22, 2022 · 7 comments
Assignees

Comments

@sanguinariojoe
Copy link

See https://github.com/sanguinariojoe/MoorDyn/actions/runs/3302454942/jobs/5449849001

It works just fine when installing from scratch (https://github.com/sanguinariojoe/MoorDyn/actions/runs/3273534330/jobs/5385863752)

@sanguinariojoe
Copy link
Author

I ran it again printing the CMake logs afterwards:

https://github.com/sanguinariojoe/MoorDyn/actions/runs/3302867330/jobs/5450148949

@wpbonelli
Copy link
Member

wpbonelli commented Oct 24, 2022

@sanguinariojoe I verified this still occurs despite ifort.exe being on the PATH and FC=ifort set. I also tried setting the -DCMAKE_Fortran_COMPILER=ifort option (and CMAKE_FORTRAN_COMPILER etc to check for case sensitivity) with no luck.

I wonder if using a different CMake version might make any difference. There seem to be similar issues reported elsewhere with CMake detecting ifort. Since MODFLOW does not use CMake this is not at the top of my queue but I will let you know if I make any further headway. Apologies for the trouble.

@sanguinariojoe
Copy link
Author

Just for the record, I printed all the env vars with and without cache, and everything looks the same. I will further investigate...

@wpbonelli
Copy link
Member

wpbonelli commented Nov 9, 2022

@sanguinariojoe

Maybe some tentative progress here. Adding some options allows the CMAKE setup step to pass even after cache restore:

  • -DCMAKE_Fortran_COMPILER="C:/Program Files (x86)/Intel/oneAPI/compiler/2022.2.0/windows/bin/intel64/ifort.exe": tell CMAKE exactly where ifort is (not found otherwise, even though it's on the path)
  • -G "MinGW Makefiles" : use the MinGW makefile generator (I think this defaults to visual studio on Windows, which the docs say is compatible with Intel fortran, but probably some more environment tweaks needed to work on Windows runners)

@wpbonelli
Copy link
Member

@scharlton2
Copy link

@sanguinariojoe

  • Another alternative is to use the ninja generator: -G Ninja or -G Ninja Multi-Config on windows. I believe the reason cmake doesn't work under windows when cached is that the windows registry is not cached (which is difficult to do).

@sanguinariojoe
Copy link
Author

The ninja trick seemed to work fine. Now it is using intel compiler for everything, but I suppose that is not really a problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants