From 6bd230bf1db33e8c9f92eb6248da518a83d54f8e Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:48:03 -0700 Subject: [PATCH 01/10] trying parallel build --- spack/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/package.py b/spack/package.py index d5c63f67..30c6671a 100644 --- a/spack/package.py +++ b/spack/package.py @@ -189,7 +189,7 @@ def cmake_args(self): class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): # Disable parallel build - parallel = False + parallel = True flag_handler = inject_flags From 034795be5051cacba69d5b8e58a6ab3dc43bb8f1 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:33:45 -0700 Subject: [PATCH 02/10] Update package.py --- spack/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/package.py b/spack/package.py index 30c6671a..d5c63f67 100644 --- a/spack/package.py +++ b/spack/package.py @@ -189,7 +189,7 @@ def cmake_args(self): class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): # Disable parallel build - parallel = True + parallel = False flag_handler = inject_flags From 035f232c5206cdbedaf8eb707a7688ce6034a284 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:11:48 -0700 Subject: [PATCH 03/10] Update package.py --- spack/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/package.py b/spack/package.py index 19975637..8efa0eb5 100644 --- a/spack/package.py +++ b/spack/package.py @@ -101,7 +101,7 @@ def url_for_version(self, version): when="@:3.1", ) # Not currently working for @3.2: - # variant("lib", default=True, description="Build library", when="@3.2:") + variant("lib", default=True, description="Build library", when="@3.2:") variant( "mysql", default=False, From 0e5fd99ab6defdbd6275cd72362a5a5694425b73 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:19:28 -0700 Subject: [PATCH 04/10] Update package.py --- spack/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spack/package.py b/spack/package.py index 8efa0eb5..0421303b 100644 --- a/spack/package.py +++ b/spack/package.py @@ -184,8 +184,8 @@ class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): def cmake_args(self): args = [self.define_from_variant(variant_map[k], k) for k in variant_map] - # args.append(self.define_from_variant("BUILD_LIB", "lib")) - # args.append(self.define_from_variant("BUILD_SHARED_LIB", "shared")) + args.append(self.define_from_variant("BUILD_LIB", "lib")) + args.append(self.define_from_variant("BUILD_SHARED_LIB", "shared")) return args From cea45e473d8d124d8237807361509a65006c300d Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:22:30 -0700 Subject: [PATCH 05/10] uncommented line --- spack/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/package.py b/spack/package.py index 0421303b..dafbdc42 100644 --- a/spack/package.py +++ b/spack/package.py @@ -142,7 +142,7 @@ def url_for_version(self, version): variant("jasper", default=True, description="JPEG compression using Jasper") variant("openmp", default=True, description="OpenMP parallelization") variant("wmo_validation", default=False, description="WMO validation") - # variant("shared", default=False, description="Enable shared library", when="+lib") + variant("shared", default=False, description="Enable shared library", when="+lib") variant("disable_stat", default=False, description="Disable POSIX feature", when="@:3.1") variant("openjpeg", default=False, description="Enable OpenJPEG", when="@:3.1") variant("enable_docs", default=False, description="Build doxygen documentation", when="@3.4.0:") From 70f030ff150356456dae046d2bc236143e955a66 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:30:25 -0700 Subject: [PATCH 06/10] Update package.py --- spack/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spack/package.py b/spack/package.py index dafbdc42..2d06ed26 100644 --- a/spack/package.py +++ b/spack/package.py @@ -180,7 +180,7 @@ def inject_flags(self, name, flags): class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): # Disable parallel build - parallel = False + parallel = True def cmake_args(self): args = [self.define_from_variant(variant_map[k], k) for k in variant_map] @@ -192,7 +192,7 @@ def cmake_args(self): class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): # Disable parallel build - parallel = False + parallel = True flag_handler = inject_flags From c8de58c3e3a5dab11ec491af1af72433bcea7aa1 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:51:02 -0700 Subject: [PATCH 07/10] reverting changes --- spack/package.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spack/package.py b/spack/package.py index 2d06ed26..19975637 100644 --- a/spack/package.py +++ b/spack/package.py @@ -101,7 +101,7 @@ def url_for_version(self, version): when="@:3.1", ) # Not currently working for @3.2: - variant("lib", default=True, description="Build library", when="@3.2:") + # variant("lib", default=True, description="Build library", when="@3.2:") variant( "mysql", default=False, @@ -142,7 +142,7 @@ def url_for_version(self, version): variant("jasper", default=True, description="JPEG compression using Jasper") variant("openmp", default=True, description="OpenMP parallelization") variant("wmo_validation", default=False, description="WMO validation") - variant("shared", default=False, description="Enable shared library", when="+lib") + # variant("shared", default=False, description="Enable shared library", when="+lib") variant("disable_stat", default=False, description="Disable POSIX feature", when="@:3.1") variant("openjpeg", default=False, description="Enable OpenJPEG", when="@:3.1") variant("enable_docs", default=False, description="Build doxygen documentation", when="@3.4.0:") @@ -180,19 +180,19 @@ def inject_flags(self, name, flags): class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): # Disable parallel build - parallel = True + parallel = False def cmake_args(self): args = [self.define_from_variant(variant_map[k], k) for k in variant_map] - args.append(self.define_from_variant("BUILD_LIB", "lib")) - args.append(self.define_from_variant("BUILD_SHARED_LIB", "shared")) + # args.append(self.define_from_variant("BUILD_LIB", "lib")) + # args.append(self.define_from_variant("BUILD_SHARED_LIB", "shared")) return args class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): # Disable parallel build - parallel = True + parallel = False flag_handler = inject_flags From 49cec1fa547195ebd86c6001bfa33aac0391c74f Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:57:28 -0700 Subject: [PATCH 08/10] use ftn_api makefile --- CMakeLists.txt | 4 ++++ wgrib2/CMakeLists.txt | 3 +-- {ftn_api => wgrib2/ftn_api}/CMakeLists.txt | 4 ---- 3 files changed, 5 insertions(+), 6 deletions(-) rename {ftn_api => wgrib2/ftn_api}/CMakeLists.txt (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee33723e..cd88478d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,6 +151,10 @@ message(STATUS "Adding wgrib2, aux_probs subdirectories...") add_subdirectory(wgrib2) add_subdirectory(aux_progs) +if(MAKE_FTN_API AND NOT BUILD_LIB) + message(FATAL_ERROR "MAKE_FTN_API should only be on when building library") +endif() + if(BUILD_LIB) message(STATUS "Adding wgrib2 library build...") ### Package config diff --git a/wgrib2/CMakeLists.txt b/wgrib2/CMakeLists.txt index dfd4881b..a5cd0ee7 100644 --- a/wgrib2/CMakeLists.txt +++ b/wgrib2/CMakeLists.txt @@ -47,8 +47,7 @@ wgrib2_api.c wgrib2.c Wind_dir.c Wind_speed.c Wind_uv.c Write_sec.c Wrt_grib.c wrtieee.c wxtext.c) if(MAKE_FTN_API) - list(APPEND lib_src - ftn_api/fort_wgrib2.c ftn_api/wgrib2api.f90 ftn_api/wgrib2lowapi.f90 ) + add_subdirectory(ftn_api) endif() add_subdirectory(gctpc) diff --git a/ftn_api/CMakeLists.txt b/wgrib2/ftn_api/CMakeLists.txt similarity index 99% rename from ftn_api/CMakeLists.txt rename to wgrib2/ftn_api/CMakeLists.txt index bb938020..96c1dee2 100644 --- a/ftn_api/CMakeLists.txt +++ b/wgrib2/ftn_api/CMakeLists.txt @@ -1,5 +1,4 @@ - set(fortran_src wgrib2api.f90 wgrib2lowapi.f90 @@ -9,14 +8,11 @@ set(c_src fort_wgrib2.c ) - add_library(wgrib2_api ${fortran_src} ${c_src}) set(module_dir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}") set_target_properties(wgrib2_api PROPERTIES Fortran_MODULE_DIRECTORY ${module_dir}) - - target_include_directories(wgrib2_api PUBLIC $ $) From fb1ae7347980360709110848a9738ea0edca3285 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:20:00 -0700 Subject: [PATCH 09/10] Update package.py --- spack/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/package.py b/spack/package.py index 19975637..b86a3319 100644 --- a/spack/package.py +++ b/spack/package.py @@ -98,7 +98,7 @@ def url_for_version(self, version): "fortran_api", default=True, description="Make wgrib2api which allows fortran code to read/write grib2", - when="@:3.1", + when="@3.3:", ) # Not currently working for @3.2: # variant("lib", default=True, description="Build library", when="@3.2:") From e8f0246765dbee365f6170319df3f09f418a5875 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Wed, 31 Jul 2024 09:02:48 -0700 Subject: [PATCH 10/10] added comments to CMakeLists.txt --- wgrib2/ftn_api/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wgrib2/ftn_api/CMakeLists.txt b/wgrib2/ftn_api/CMakeLists.txt index 96c1dee2..7a8a8c3a 100644 --- a/wgrib2/ftn_api/CMakeLists.txt +++ b/wgrib2/ftn_api/CMakeLists.txt @@ -1,3 +1,8 @@ +# This is the CMake file for the ftn_api directory in the wgrib2 +# project. This will only build if MAKE_FTN_API=ON and +# BUILD_LIB=ON +# +# Kyle Gerheiser set(fortran_src wgrib2api.f90