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

fixing parallel build #180

Merged
merged 14 commits into from
Jul 31, 2024
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,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
Expand Down
2 changes: 1 addition & 1 deletion spack/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:")
Expand Down
3 changes: 1 addition & 2 deletions wgrib2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions ftn_api/CMakeLists.txt → wgrib2/ftn_api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put some comments at the top of all CMakeLists.txt files. Mention that it is a CMake file from the wgrib2 project, and then specify that that CMake file builds. Add an author if you know it (Kyle Gerheiser for all CMake files that were already present in the build. Add your name to the list whenever you make significant changes or additions.

set(fortran_src
wgrib2api.f90
wgrib2lowapi.f90
Expand All @@ -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 $<BUILD_INTERFACE:${module_dir}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}>)
Expand Down
Loading