Enhancements and upgrades to Makefile
for Improved dependency management
#1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR introduces several enhancements and upgrades to the Makefile to improve compatibility with modern toolchains and streamline dependency management. The key changes include:
gfortran >14 Compatibility:
Added the
-fallow-argument-mismatch
flag to support gfortran versions greater than 14, as the Fortran code is not fully compatible with these versions. This compromise ensures the code can still be compiled with newer compilers.HDF5 Library Detection:
The Makefile now uses
pkg-config
to locate HDF5 library paths and include directories, improving robustness and flexibility in finding the correct HDF5 installation.NetCDF Dependency Management:
The Makefile now requires
nc-config
andnf-config
(provided by netcdf-c and netcdf-fortran, respectively) to locate necessary header/module files and shared libraries. This ensures proper linking and compilation with NetCDF dependencies.User Flexibility for Dependency Paths:
Preliminary error-checking mechanisms have been added to ensure users have the flexibility to set the
_PREFIX
value for the three main dependencies: HDF5, NetCDF-C, and NetCDF-Fortran. This provides better control over custom installations and paths.Adding
debug
TargetUsers can now compile a
debug
version usingmake debug
These changes aim to improve the build process, enhance compatibility with modern toolchains, and provide a more user-friendly experience for setting up and compiling the project.
Testing:
pkg-config
andnf/nc-config
tools to ensure correct detection of HDF5 and NetCDF dependencies.*_PREFIX
values for dependencies.Notes:
Users are encouraged to update their local installations of HDF5, NetCDF-C, and NetCDF-Fortran to ensure compatibility with these changes. If necessary libraries are not found, users are able to set the following environment variables prior to compiling the program
NETCDF_C_PREFIX
NETCDF_F_PREFIX
HDF5_LIB_DIR
andHDF5_INCLUDE_DIR
Let me know if there are any questions or additional feedback!
I think it makes sense if Cyril and Nico give this
PR
a test and contribute to it if necessary.