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

Enhancements and upgrades to Makefile for Improved dependency management #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kasra-keshavarz
Copy link
Collaborator

@kasra-keshavarz kasra-keshavarz commented Feb 11, 2025

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:

  1. 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.

  2. 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.

  3. NetCDF Dependency Management:
    The Makefile now requires nc-config and nf-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.

  4. 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.

  5. Adding debug Target
    Users can now compile a debug version using make 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:

  • Verified compilation with gfortran versions 8 and 14,
  • Tested pkg-config and nf/nc-config tools to ensure correct detection of HDF5 and NetCDF dependencies.
  • Confirmed the ability to set custom *_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 and HDF5_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.

This commit assures that the three main dependencies of the FUSE package
is recognized via pkgconf program as well both `nc-config' and
`nf-config' tools. Furthermore, a PHONY target called `debug' is added
to assure users can do have a debug version using `make debug' command.

Reported-by: Kasra Keshavarz <[email protected]>
This assured probable discrepencies in nc-config and nf-config values
are evaded. Therefore, only the pure paths are accessed, and `FFLAGS'
and `LIBS' values are defined.

Reported-by: Kasra Keshavarz <[email protected]>
…n version 14 and above is treated with -fallow-argument-mismatch
@kasra-keshavarz kasra-keshavarz self-assigned this Feb 11, 2025
@kasra-keshavarz kasra-keshavarz added the enhancement New feature or request label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant