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

Cannot do parallel builds #196

Open
pbosler opened this issue Feb 6, 2024 · 1 comment
Open

Cannot do parallel builds #196

pbosler opened this issue Feb 6, 2024 · 1 comment

Comments

@pbosler
Copy link

pbosler commented Feb 6, 2024

Running make -j so that PartMC is built in parallel decreases compilation times, but is currently unavailable. Errors like

f951: Fatal Error: Cannot rename module file ‘pmc_util.mod0’ to ‘pmc_util.mod’: No such file or directory
compilation terminated.

imply that a module that depends on pmc_util.mod is being built before pmc_util.mod has been compiled. Several errors like this (but with different specific filenames) suggest that CMake is having a hard time resolving dependencies between different PartMC modules.

Serial builds (with just make) work fine.

@slayoo
Copy link
Collaborator

slayoo commented Feb 6, 2024

Thanks for reporting it.

This seems to be a known CMake issue:

It seems that CMake does not support "-j" for Fortran code without refactoring the CMake instructions to be concurrency-safe. PartMC has a lot of module-providing sources, so IIUC, we would need to refactor CMakeLists.txt in a way that essentially each .F90 file has its own target with Fortran_MODULE_DIRECTORY and target_include_directories set accordingly to a "private" module directory (i.e., 50+ new targets).

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