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

changed to w3emc instead of w3nco #47

Merged
merged 5 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ jobs:
make -j2
make install

- name: checkout-w3nco
- name: checkout-w3emc
uses: actions/checkout@v2
with:
repository: NOAA-EMC/NCEPLIBS-w3nco
path: w3nco
repository: NOAA-EMC/NCEPLIBS-w3emc
path: w3emc
ref: develop

- name: build-w3nco
- name: build-w3emc
run: |
cd w3nco
cd w3emc
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3emc
make -j2
make install

Expand Down
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,10 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|GNU|Clang|AppleClang)$")
message(
WARNING "Compiler not officially supported: ${CMAKE_Fortran_COMPILER_ID}")
endif()

find_package(MPI REQUIRED COMPONENTS Fortran)

find_package(bacio REQUIRED)
find_package(w3nco REQUIRED)
find_package(w3emc 2.9.0 REQUIRED)

add_subdirectory(src)
add_subdirectory(utils)
Expand Down
2 changes: 1 addition & 1 deletion cmake/PackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
include(CMakeFindDependencyMacro)

find_dependency(bacio CONFIG)
find_dependency(w3nco CONFIG)
find_dependency(w3emc CONFIG)
find_dependency(MPI COMPONENTS Fortran)

get_target_property(@PROJECT_NAME@_BUILD_TYPES @PROJECT_NAME@::@PROJECT_NAME@ IMPORTED_CONFIGURATIONS)
Expand Down
11 changes: 8 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is the build file for the src directory of NCEPLIBS-nemsio.
#
# Kyle Gerheiser

set(fortran_src
nemsio_module.f90
nemsio_module_mpi.f90
Expand Down Expand Up @@ -32,7 +36,8 @@ target_include_directories(${lib_name} INTERFACE
$<BUILD_INTERFACE:${module_dir}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

#depends on w3nco and bacio, but users must link their own version
# Nemsio depends on w3emc and bacio, but users must link their own
# version.
target_link_libraries(${lib_name} PRIVATE MPI::MPI_Fortran)
list(APPEND LIB_TARGETS ${lib_name})

Expand All @@ -53,14 +58,14 @@ export(EXPORT ${PROJECT_NAME}Exports
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME}-targets.cmake)

# sigio-config.cmake
# nemsio-config.cmake
configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake/PackageConfig.cmake.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${CONFIG_INSTALL_DESTINATION})
install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-config.cmake
DESTINATION ${CONFIG_INSTALL_DESTINATION})

# sigio-config-version.cmake
# nemsio-config-version.cmake
write_basic_package_version_file(
${CMAKE_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
VERSION ${PROJECT_VERSION}
Expand Down
9 changes: 7 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This is the CMake file for the tests directory of the
# NCEPLIBS-nemsio project.
#
# Kyle Gerheiser

set(tstName read_nemsio)
set(srcName read_nemsio.f90)
set(exeName read_nemsio.x)
Expand All @@ -8,10 +13,10 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink

add_executable(${exeName} ${srcName})
add_dependencies(${exeName} nemsio)
target_link_libraries( ${exeName} PUBLIC nemsio bacio::bacio_4 w3nco::w3nco_d)
target_link_libraries( ${exeName} PUBLIC nemsio bacio::bacio_4 w3emc::w3emc_d)
add_test(NAME ${tstName} COMMAND ${exeName} testdataset)

add_pfunit_ctest (nemsio_test
TEST_SOURCES test_mod.pf
LINK_LIBRARIES nemsio bacio::bacio_4 w3nco::w3nco_d
LINK_LIBRARIES nemsio bacio::bacio_4 w3emc::w3emc_d
)
13 changes: 9 additions & 4 deletions utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# This is the cmake build file for the utils directory of the
# NCEPLIBS-nemsio package.
#
# Kyle Gerheiser

add_executable(nemsio_read nemsio_read.f90)
target_link_libraries(nemsio_read nemsio bacio::bacio_4 w3nco::w3nco_d)
target_link_libraries(nemsio_read nemsio bacio::bacio_4 w3emc::w3emc_d)

add_executable(nemsio_get nemsio_get.f90)
target_link_libraries(nemsio_get nemsio bacio::bacio_4 w3nco::w3nco_d)
target_link_libraries(nemsio_get nemsio bacio::bacio_4 w3emc::w3emc_d)

add_executable(nemsio_chgdate nemsio_chgdate.f90)
target_link_libraries(nemsio_chgdate nemsio bacio::bacio_4 w3nco::w3nco_d)
target_link_libraries(nemsio_chgdate nemsio bacio::bacio_4 w3emc::w3emc_d)

add_executable(mkgfsnemsioctl mkgfsnemsioctl.f90)
target_link_libraries(mkgfsnemsioctl nemsio bacio::bacio_4 w3nco::w3nco_d)
target_link_libraries(mkgfsnemsioctl nemsio bacio::bacio_4 w3emc::w3emc_d)

install(TARGETS nemsio_read nemsio_get nemsio_chgdate mkgfsnemsioctl
RUNTIME DESTINATION bin COMPONENT utilities)
Expand Down