Replies: 3 comments
-
Regarding the HDF5 metapackage, this is not the case: the metapackage automatically defines all HDF5 Fortran modules as Lines 1879 to 1900 in 448d47c If there are any missing module names, please open an Issue page so we can implement fixes as needed. The examples in the CI test for the base |
Beta Was this translation helpful? Give feedback.
-
Yes, I saw this code before. For well-known packages like hdf5 as meta-packages, the fpm team hardcodes the *.mod names of these packages into the fpm source code, so users no longer need to declare them in |
Beta Was this translation helpful? Give feedback.
-
Correct: external modules are those for which a source file is not available. |
Beta Was this translation helpful? Give feedback.
-
Introduction
From my personal experience using fpm, I have found that currently, fpm's usage experience in handling external link dependencies and operating system environments is relatively troublesome. The former involves two situations:
These libraries may be libraries of the open source community or inhouse link libraries of small teams. Currently, fpm cannot handle external link dependencies with mod files well, mainly involving the following three points:
-l
/-L
to link the link library;-I
to introduce the header file path;build.external-modules
in fpm.toml to declare external mod file references.Hope brought by the hdf5 meta-package and pkg-config
The implementation of the hdf5 meta-package, through pkg-config, has achieved references to external packages such as hdf5. This enables us to use hdf5 as a meta-package and thus correctly link the hdf5 link library. Meson and CMake also have the ability to query external dependencies through pkg-config. Using pkg-config is a good way forward.
However, compared to Meson, fpm needs to explicitly declare the correct
build.external-modules
. Otherwise, fpm will report an error, which is equivalent to fpm intercepting such errors instead of the compiler. This leads to when packages with Fortran 90 interfaces such as hdf5 and netcdf are used as meta-packages of fpm, we need to hardcode all the *.mod names of packages like hdf5 into fpm. This leads to a problem. Fpm cannot infinitely increase potential meta-packages and constantly track and recordbuild.external-modules
. Moreover, the fpm team also needs to test them in CI.Above all, this raises two questions:
Statement: I'm not quite sure if my description of CMake is correct. I only have a basic understanding of it.
Beta Was this translation helpful? Give feedback.
All reactions