Skip to content
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
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
cmake_minimum_required(VERSION 3.14)
project(nitro)

set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED true)

if (${CMAKE_PROJECT_NAME} STREQUAL nitro)
# we are the top-level project and are responsible for configuration
set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED true)

# Always turn on "warnings as errors" to avoid lots of (meaningless?) build output;
# we'll dial-back warnings as necessary.
Expand Down
44 changes: 32 additions & 12 deletions externals/coda-oss/.github/workflows/build_unittest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
env:
CTEST_TIMEOUT: 120

name: build_unittest

on: [push]
on:
push:
pull_request:
branches:
- main


jobs:
build-cmake-windows:
Expand All @@ -11,6 +19,8 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.python-version }}-CMake
runs-on: ${{ matrix.os }}
steps:
- name: Skip Duplicate Actions
uses: fkirc/skip-duplicate-actions@v5.3.1
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Set up Python
uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python
Expand Down Expand Up @@ -39,10 +49,10 @@ jobs:
- name: test # should run w/o install
run: |
cd target-Release
ctest -C Release --output-on-failure
ctest -C Release --output-on-failure --timeout $env:CTEST_TIMEOUT
cd ..
cd target-Debug
ctest -C Debug --output-on-failure
ctest -C Debug --output-on-failure --timeout $env:CTEST_TIMEOUT
- name: install
run: |
cd target-Release
Expand All @@ -63,6 +73,8 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Skip Duplicate Actions
uses: fkirc/skip-duplicate-actions@v5.3.1
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: configure
run: |
Expand Down Expand Up @@ -93,11 +105,13 @@ jobs:
build-linux-cmake-default:
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
python-version: ['3.7']
name: ${{ matrix.os }}-${{ matrix.python-version }}-CMake
runs-on: ${{ matrix.os }}
steps:
- name: Skip Duplicate Actions
uses: fkirc/skip-duplicate-actions@v5.3.1
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Set up Python
uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python
Expand All @@ -121,7 +135,7 @@ jobs:
# should run w/o install
run: |
cd target
ctest --output-on-failure
ctest --output-on-failure --timeout $CTEST_TIMEOUT
- name: install
run: |
cd target
Expand All @@ -130,50 +144,56 @@ jobs:
build-linux-cmake:
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
configuration: [Debug, Release]
avx: [AVX512F]
name: ${{ matrix.os }}-${{ matrix.configuration }}-${{ matrix.avx }}-CMake
runs-on: ${{ matrix.os }}
steps:
- name: Skip Duplicate Actions
uses: fkirc/skip-duplicate-actions@v5.3.1
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: configure
run: |
mkdir out && cd out
cmake .. -DENABLE_PYTHON=OFF -DENABLE_${{ matrix.avx }}=ON
cmake .. -DENABLE_PYTHON=OFF -DENABLE_${{ matrix.avx }}=ON -DCMAKE_INSTALL_PREFIX=${{ matrix.configuration }}
- name: build
run: |
cd out
# "-j" spawns too many processes causing GCC to crash
cmake --build . --config ${{ matrix.configuration }} -j 12
cmake --build . -j 12
- name: test
# should run w/o install
run: |
cd out
ctest -C ${{ matrix.configuration }} --output-on-failure
ctest --output-on-failure --timeout $CTEST_TIMEOUT

build-waf:
strategy:
matrix:
os: [ubuntu-latest, windows-2019]
os: [
# BROKEN: windows-latest,
ubuntu-22.04]
python-version: ['3.7']
debugging: ['--enable-debugging', '']
name: ${{ matrix.os }}-${{ matrix.python-version }}-waf${{ matrix.debugging }}
runs-on: ${{ matrix.os }}
steps:
- name: Skip Duplicate Actions
uses: fkirc/skip-duplicate-actions@v5.3.1
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Set up Python
uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: configure_with_swig
if: ${{ matrix.os == 'ubuntu-latest' }}
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
pip install numpy
mkdir install${{ matrix.os }}Waf-Github
python waf configure --prefix="$PWD/install${{ matrix.os }}Waf-Github" --enable-swig ${{ matrix.debugging }}
- name: configure_without_swig
if: ${{ matrix.os == 'windows-2019' }}
if: ${{ matrix.os == 'windows-latest' }}
run: |
pip install numpy
mkdir install${{ matrix.os }}Waf-Github
Expand Down
16 changes: 12 additions & 4 deletions externals/coda-oss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
# Author: Scott A. Colcord

cmake_minimum_required(VERSION 3.14)
project(coda-oss)

set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED true)
project(coda-oss VERSION 1.0.0)

if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
# build and package with conan
Expand All @@ -19,6 +16,10 @@ endif()
if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
# this is the top level project

# Allow other project to set different standard.
set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED true)

# Always turn on "warnings as errors" to avoid lots of (meaningless?) build output;
# we'll dial-back warnings as necessary.
if (MSVC)
Expand All @@ -37,6 +38,13 @@ if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
install(DIRECTORY "cmake/"
DESTINATION "${CODA_STD_PROJECT_LIB_DIR}/cmake/"
FILES_MATCHING PATTERN "*.cmake")

# If the package version is defined, write a version file for find_package
set(version_file "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(${version_file} VERSION ${CMAKE_PROJECT_VERSION} COMPATIBILITY SameMajorVersion)
install(FILES ${version_file} DESTINATION "lib/cmake")

endif()

add_subdirectory("modules")
Expand Down
2 changes: 2 additions & 0 deletions externals/coda-oss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
CODA is a set of modules, and each module, while complimentary to one another, has
a very specific and largely independent purpose.

CODA follows [Semantic Versioning](https://semver.org/).

Building CODA
--------------

Expand Down
9 changes: 7 additions & 2 deletions externals/coda-oss/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ def configure(self):
env['install_libdir'] = Options.options.libdir if Options.options.libdir else join(Options.options.prefix, 'lib')
env['install_bindir'] = Options.options.bindir if Options.options.bindir else join(Options.options.prefix, 'bin')
env['install_sharedir'] = Options.options.sharedir if Options.options.sharedir else join(Options.options.prefix, 'share')
env['install_pydir'] = Options.options.pydir if Options.options.pydir else '${PYTHONDIR}'
env['install_pydir'] = Options.options.pydir if Options.options.pydir else join(Options.options.prefix, 'lib/python/site-packages')

# Swig memory leak output
if Options.options.swig_silent_leak:
Expand Down Expand Up @@ -1526,7 +1526,12 @@ def copytree_tgt(tsk):
symlinks = tsk.symlinks
if hasattr(tsk, 'ignore'):
ignore = tsk.ignore
shutil.copytree(tsk.src, dest, symlinks, ignore)

def copytree_helper(src, dst):
Logs.pprint('GREEN', f'- copy {dst} (from {src})')
shutil.copy2(src, dst)

shutil.copytree(tsk.src, dest, symlinks, ignore, copy_function=copytree_helper)

@task_gen
@feature('install_as_tgt')
Expand Down
67 changes: 41 additions & 26 deletions externals/coda-oss/cmake/CodaBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,8 @@ function(coda_generate_package_config)
"cmake/${CMAKE_PROJECT_NAME}Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "lib/cmake"
PATH_VARS ${ARGN}
)
#write_basic_package_version_file(
# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
# VERSION 1.2.3
# COMPATIBILITY SameMajorVersion )
PATH_VARS ${ARGN})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
#"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
DESTINATION "lib/cmake")
endif()
endfunction()
Expand Down Expand Up @@ -314,25 +308,46 @@ function(coda_fetch_driver)
message(FATAL_ERROR "received unexpected argument(s): ${ARG_UNPARSED_ARGUMENTS}")
endif()

set(target_name ${CMAKE_PROJECT_NAME}_${ARG_NAME})
# Use 'FetchContent' to download and unpack the files. Set it up here.
FetchContent_Declare(${target_name}
URL "${CMAKE_CURRENT_SOURCE_DIR}/${ARG_ARCHIVE}"
URL_HASH ${ARG_HASH}
)
FetchContent_GetProperties(${target_name})
# The returned properties use the lower-cased name
string(TOLOWER ${target_name} target_name_lc)
if (NOT ${target_name_lc}_POPULATED) # This makes sure we only fetch once.
message("Populating content for external dependency ${driver_name}")
# Now (at configure time) unpack the content.
FetchContent_Populate(${target_name})
# Remember where we put stuff
set("${target_name_lc}_SOURCE_DIR" "${${target_name_lc}_SOURCE_DIR}"
CACHE INTERNAL "source directory for ${target_name_lc}")
set("${target_name_lc}_BINARY_DIR" "${${target_name_lc}_BINARY_DIR}"
CACHE INTERNAL "binary directory for ${target_name_lc}")
endif()
# Use a new policy context so we can set some policy values that prevent
# warning messages from printing
cmake_policy(PUSH)
if (POLICY CMP0135)
# Newer cmake versions (>=3.24) change how the timestamps of
# extracted files are set. The new behavior is fine but a warning
# is printed if we do not either explicitly set the policy or set
# the minimum cmake version.
cmake_policy(SET CMP0135 NEW)
endif()
if (POLICY CMP0169)
# Newer cmake versions (>=3.30) have deprecated
# FetchContent_Populate and suggest using a different pattern.
# The _Populate version calls add_directory() which we do not want,
# so we cannot use it. Until we find a different solution, just
# ignore this warning.
cmake_policy(SET CMP0169 OLD)
endif()

set(target_name ${CMAKE_PROJECT_NAME}_${ARG_NAME})
# Use 'FetchContent' to download and unpack the files. Set it up here.
FetchContent_Declare(${target_name}
URL "${CMAKE_CURRENT_SOURCE_DIR}/${ARG_ARCHIVE}"
URL_HASH ${ARG_HASH}
)
FetchContent_GetProperties(${target_name})
# The returned properties use the lower-cased name
string(TOLOWER ${target_name} target_name_lc)
if (NOT ${target_name_lc}_POPULATED) # This makes sure we only fetch once.
message("Populating content for external dependency ${driver_name}")
# Now (at configure time) unpack the content.
FetchContent_Populate(${target_name})
# Remember where we put stuff
set("${target_name_lc}_SOURCE_DIR" "${${target_name_lc}_SOURCE_DIR}"
CACHE INTERNAL "source directory for ${target_name_lc}")
set("${target_name_lc}_BINARY_DIR" "${${target_name_lc}_BINARY_DIR}"
CACHE INTERNAL "binary directory for ${target_name_lc}")
endif()
cmake_policy(POP)

endfunction()


Expand Down
3 changes: 3 additions & 0 deletions externals/coda-oss/modules/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ add_subdirectory("hdf5.lite")
add_subdirectory("gsl")
add_subdirectory("std")

if(ENABLE_NLOHMANN)
add_subdirectory("coda_oss.json")
endif()
15 changes: 15 additions & 0 deletions externals/coda-oss/modules/c++/coda_oss.json/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set(MODULE_NAME coda_oss.json)

coda_add_module(${MODULE_NAME}
VERSION 1.0
DEPS math.linear-c++ math.poly-c++ types-c++ mem-c++ nlohmann-c++)

coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "unittests"
UNITTEST
SOURCES
test_json_math.cpp
test_json_mem.cpp
test_json_std.cpp
test_json_types.cpp)
Loading