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

Fortran language should be required and enabled only if needed #270

Closed
DusanJovic-NOAA opened this issue Oct 11, 2024 · 2 comments · Fixed by #272
Closed

Fortran language should be required and enabled only if needed #270

DusanJovic-NOAA opened this issue Oct 11, 2024 · 2 comments · Fixed by #272
Assignees

Comments

@DusanJovic-NOAA
Copy link

Currently, Fortran language is enabled (and required) unconditionally, even though it is required only if MAKE_FTN_API or USE_IPOLATES are turned on. Both MAKE_FTN_API and USE_IPOLATES are off by default. So by default, Fortran is not required. I suggest this change to be made:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07168a5..5cfda44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.15)
 file(STRINGS "VERSION" pVersion)
 
 # Set up project with version number from VERSION file.
-project(wgrib2 VERSION ${pVersion} LANGUAGES Fortran C)
+project(wgrib2 VERSION ${pVersion} LANGUAGES C)
 
 # Handle user build options.
 option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
@@ -39,6 +39,10 @@ option(BUILD_LIB "Build wgrib2 library?" on)
 option(BUILD_SHARED_LIB "Build shared library?" off)
 option(BUILD_WGRIB "Build wgrib code?" off)
 
+if(MAKE_FTN_API OR USE_IPOLATES)
+  enable_language(Fortran)
+endif()
+
 # Developers can use this option to specify a local directory which
 # holds the test files. They will be copied instead of fetching the
 # files via FTP.
@webisu
Copy link
Collaborator

webisu commented Oct 11, 2024 via email

@edwardhartnett
Copy link
Contributor

All fortran compilers will be 2003 compatible.

In GNU you can set fortran dialect options, so you can check dialect stuff exactly if you want.

@github-project-automation github-project-automation bot moved this from In progress to Done in wgrib2-3.5.0 Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants