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

problems with gfortran module creation and "make -j" #6

Closed
cyrush opened this issue Jul 18, 2016 · 7 comments · Fixed by #304
Closed

problems with gfortran module creation and "make -j" #6

cyrush opened this issue Jul 18, 2016 · 7 comments · Fixed by #304
Labels
Milestone

Comments

@cyrush
Copy link
Member

cyrush commented Jul 18, 2016

It seems the compiler is undermining threaded builds:

Fatal Error: Can't rename module file '../../../fortran/f_conduit_node.mod0' to '../../../fortran/f_conduit_node.mod': No such file or directory
make[2]: *** [tests/conduit/fortran/CMakeFiles/f_conduit_node_obj.dir/f_conduit_node_obj.f.o] Error 1
make[1]: *** [tests/conduit/fortran/CMakeFiles/f_conduit_node_obj.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 76%] /private/var/folders/wj/jjhjt_0d3kg1vmk56d5bq_38001kr8/T/spack-stage/spack-stage-J_e5zR/conduit/src/tests/conduit/fortran/f_conduit_node.f:411.6:

use f_conduit_node
1
Fatal Error: Can't open module file 'f_conduit_node.mod' for reading at (1): No such file or directory
make[2]: *** [tests/conduit/fortran/CMakeFiles/f_conduit_node.dir/f_conduit_node.f.o] Error 1

http://stackoverflow.com/questions/29728867/cmake-parallel-build-for-fortran-90-with-modules

@cyrush
Copy link
Member Author

cyrush commented Jul 18, 2016

I think the problem is cropping up in unit testing. The solution may simply be to create a lib for fruit AND the fortran gtest driver.

@cyrush
Copy link
Member Author

cyrush commented Jul 18, 2016

@cyrush cyrush added the bug label Jul 18, 2016
@cyrush
Copy link
Member Author

cyrush commented Aug 10, 2016

closing, I don't see this any more on OSX 10.11 using gfortran 6.1. Assuming this was resolved by the compiler update.

@cyrush cyrush closed this as completed Aug 10, 2016
@cyrush cyrush reopened this Jun 23, 2018
@cyrush
Copy link
Member Author

cyrush commented Jun 23, 2018

seeing with gfortran 5 (or even 7) so this isn't just the 4.9 bug.

Seems like a chicken vs egg issue. Object libs might help, or setting more fortran flags:

https://stackoverflow.com/questions/43917443/fortran-module-files-not-found-by-cmake

@cyrush
Copy link
Member Author

cyrush commented Jun 23, 2018

@cyrush
Copy link
Member Author

cyrush commented Jun 23, 2018

Try not using a single Fortran_MODULE_DIRECTORY dir, by tweaking
SetupFortran.cmake:

    set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/fortran)
      
      # make sure the fortran compiler can see the module files it
      # generates
      include_directories(${CMAKE_Fortran_MODULE_DIRECTORY})

@cyrush
Copy link
Member Author

cyrush commented Jun 25, 2018

finally got to the bottom of this.

It was a very simple error: I had a copy and paste typo in one of the test modules leading to a name collision.

The t_conduit_node_obj test, was defining a module t_conduit_node instead of t_conduit_node_obj. Since the t_conduit_node test also defines the t_conduit_node module -- they would stomp on each other when compiled in parallel.

@cyrush cyrush added this to the 0.4.0 milestone Jun 25, 2018
billsacks added a commit to billsacks/mac_cime_configuration that referenced this issue Apr 18, 2023
The CFLAGS change (-Wno-error=implicit-function-declaration) was needed
to avoid compilation errors of a lot of C code.

The FFLAGS change (-fallow-argument-mismatch) was needed for some MPI
calls.

These unit tests are still failing in the build, but I'm getting further
now.

One other thing I needed to do is use `--make-j 1` in the call to
run_tests.py (motivated by LLNL/conduit#6).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant