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

Fails to build with cmake>=3.27 + Ninja #461

Open
MehdiChinoune opened this issue Mar 16, 2024 · 4 comments
Open

Fails to build with cmake>=3.27 + Ninja #461

MehdiChinoune opened this issue Mar 16, 2024 · 4 comments

Comments

@MehdiChinoune
Copy link

[1351/1468] Building Fortran object src/funit/CMakeFiles/funit-main.dir/FUnit.F90.o
 FAILED: src/funit/CMakeFiles/funit-main.dir/FUnit.F90.o src/funit/mod/funit.mod 
 /usr/bin/f95 -I/pFUnit/src/funit -I/pFUnit/build/src/funit/mod -I/pFUnit/include -I/pFUnit/build/extern/fArgParse/extern/gFTL-shared/extern/gFTL/include/v1 -I/pFUnit/build/extern/fArgParse/extern/gFTL-shared/src/v1/mod -I/pFUnit/build/extern/fArgParse/mod -I/pFUnit/build/extern/fArgParse/extern/gFTL-shared/extern/gFTL/include/v2 -I/pFUnit/extern/fArgParse/extern/gFTL-shared/extern/gFTL/include/v2 -I/pFUnit/build/extern/fArgParse/extern/gFTL-shared/src/v2/mod -g -cpp -O0 -ffree-line-length-none -fallow-argument-mismatch -fbacktrace -Jsrc/funit/mod -fPIC -fopenmp -fpreprocessed -c src/funit/CMakeFiles/funit-main.dir/FUnit.F90-pp.f90 -o src/funit/CMakeFiles/funit-main.dir/FUnit.F90.o
 /pFUnit/src/funit/FUnit.F90:4:8:
 
     4 |    use PF_Assert
       |        1
 Fatal Error: Cannot open module file 'pf_assert.mod' for reading at (1): No such file or directory

It succeeds with GCC 12.3.0, but fails with GCC 13.2.0 and 14.0.1 (dev).
I thought It is some issues with paralled building, but It fails when using a single job!

@MehdiChinoune
Copy link
Author

Actually It's because of Ninja generator!

@tclune
Copy link
Member

tclune commented Mar 18, 2024

Ah - good. I finally had a successful build with 13.2 a couple of weeks ago, but did not have any build issues. Just some run-time issues where F2008 polymorphic assignment had to be reverted to F2003 ALLOCATE statements. (And even that was only in some of the pFUnit dependencies I think.

Cheers.

@MehdiChinoune MehdiChinoune reopened this Mar 22, 2024
@MehdiChinoune MehdiChinoune changed the title Fails to build with GCC>=13 Fails to build with cmake>=3.27 + Ninja Mar 22, 2024
@MehdiChinoune
Copy link
Author

We have reported the issue to CMake, they say that pFUnit should use target_link_libraries() instead of add_dependencies() if there is a module dependency.
see: https://gitlab.kitware.com/cmake/cmake/-/issues/25788#note_1497239

I could open a PR if there is no required CLA.

@tclune
Copy link
Member

tclune commented Mar 22, 2024

Please do. I've given up on the CLA.

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