ecmwf / multio

MultIO is a runtime-configurable multiplexer for Weather Model output of GRIB data
Apache License 2.0
7 stars 8 forks source link

multio fortran modules are not installled #4

Closed suvarchal closed 7 months ago

suvarchal commented 1 year ago

Fortran modules are not installed in INSTALL_PREFIX on make install for both master and develop branches, they sit in the build directory/module, I guess it is because CMAKE_Fortran_MODULE_DIRECTORY is not set.

I would prefer to install them in install-include directory inline with general Fortran library practice used in other libraries like NetCDF, even eccodes etc. This makes it easier to use in other libraries by setting one variable LIBX_ROOT=/path/to/libroot and include and lib directories can be hard coded as $LIBX_ROOT/include and $LIBX_ROOT/lib inline with other libraries like NetCDF etc. Not a big thing to use other paths $LIBX_ROOT/module but just preference/standard practice for elegance.

tlmquintino commented 1 year ago

note that Fortran modules are compiler dependent so they should not be installed in the /include

tlmquintino commented 1 year ago

a possibility is to install it to /lib but then its a bit odd that the compiler will be including that in the list of include directories (as in -I/lib )

suvarchal commented 1 year ago

note that Fortran modules are compiler dependent so they should not be installed in the /include

I guess it is matter of convention mostly coming from C, where there are uses for C headers without libs, hence can be installed separately without need for any compilation. I haven't seen anyone doing it in Fortran world.

I guess in the end it is just about what is the default, and any other user can customize it with -DCMAKE_Fortran_MODULE_DIRECTORY, i am guessing ecbuild respects it too.

suvarchal commented 1 year ago

a possibility is to install it to /lib but then its a bit odd that the compiler will be including that in the list of include directories (as in -I/lib )

right lib feels awkward, unintuitive to most Fortran developers to have mod files.