-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Function install_modules for Fortran modules #11747
Comments
Is there some way to know what the .mod / .smod filename is, at the time that meson configures the build? e.g. is it the same as the library name (libfoo.so and foo.mod)? |
Yes, you can know the basename of .mod / .smod files at configure time. You just need to analyze the Fortran files compiled for a libfoo.so.
, a The module names are different than the library name. |
Ah right, this is just the same problem as the preprocessed However, correct me if I'm wrong... it's valid for the module name to change when editing the Fortran files, without the build system reconfiguring, right? So we have to re-run ... I'm (increasingly) of the idea that |
Yes, you're correct.
It will also solve the issue with files that are preprocessed.
that is preprocessed with the flag |
This should not be a standalone function. Instead it should be a kwarg on the build target like |
@amonstoison, I was thinking about this recently. My preliminary thought is that my two step dependency scanner would actually make this pretty easy to handle, because we could pass the json files to install, and let it find and install the mod files. I have a couple of questions around Fortran:
|
There is no convention on where Fortran modules should be installed, but the most common folder is The main package where we have this issue is GALAHAD.
You don't need to install the modules of Regarding your two-step dependency scanner, I recommend trying it on GALAHAD 😃. The issue is that we need to specify the flags by hand for various compilers, which was quite problematic on Windows with the Intel compilers. Why do they replace |
Describe the bug
When we compile a package developed in Modern Fortran, module files are generated (*.mod / *.smod).
The issue is that Meson doesn't install them and they are required if we want to link our compiled package in another Fortran package.
Expected behavior
It should be great to a have a function similar to
install_headers
.It could take as input a
library
object and install the modules generated during the compilation of this library.The current workaround for our project is to use
meson.add_install_script(script_modules)
where
script_modules = files('install_modules.py')
and the content of the script iscc @Volker-Weissmann
The text was updated successfully, but these errors were encountered: