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
91 changes: 48 additions & 43 deletions externals/coda-oss/.github/workflows/build_unittest.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
env:
CTEST_TIMEOUT: 120

name: build_unittest

on:
Expand Down Expand Up @@ -46,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 Down Expand Up @@ -132,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 @@ -141,7 +144,7 @@ jobs:
build-linux-cmake:
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-22.04, ubuntu-24.04]
configuration: [Debug, Release]
avx: [AVX512F]
name: ${{ matrix.os }}-${{ matrix.configuration }}-${{ matrix.avx }}-CMake
Expand All @@ -163,43 +166,45 @@ jobs:
# should run w/o install
run: |
cd out
ctest --output-on-failure

build-waf:
strategy:
matrix:
os: [windows-2019, 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-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' }}
run: |
pip install numpy
mkdir install${{ matrix.os }}Waf-Github
python waf configure --prefix="$PWD/install${{ matrix.os }}Waf-Github" ${{ matrix.debugging }}
- name: build
run: |
python waf build
- name: install
run: |
python waf install
- name: test
run: |
python waf install --alltests
ctest --output-on-failure --timeout $CTEST_TIMEOUT
# Plan to remove waf soon - disable build and see who complains
# build-waf:
# strategy:
# matrix:
# 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-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-latest' }}
# run: |
# pip install numpy
# mkdir install${{ matrix.os }}Waf-Github
# python waf configure --prefix="$PWD/install${{ matrix.os }}Waf-Github" ${{ matrix.debugging }}
# - name: build
# run: |
# python waf build
# - name: install
# run: |
# python waf install
# - name: test
# run: |
# python waf install --alltests

14 changes: 11 additions & 3 deletions externals/coda-oss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Author: Scott A. Colcord

cmake_minimum_required(VERSION 3.14)
project(coda-oss)
project(coda-oss VERSION 1.0.0)

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

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

Expand All @@ -25,8 +25,9 @@ if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
if (MSVC)
add_compile_options(/WX) # warnings as errors
add_compile_options(/MP) # multi-processor compile
elseif (UNIX)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-Werror) # warnings as errors
add_compile_options(-Wno-error=c++20-compat)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand All @@ -38,6 +39,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
7 changes: 6 additions & 1 deletion externals/coda-oss/build/build.py
Original file line number Diff line number Diff line change
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
8 changes: 1 addition & 7 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
11 changes: 7 additions & 4 deletions externals/coda-oss/modules/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (MSVC)
# > extremely noisy and low-value warnings. In general, the STL does not attempt to be `/Wall` clean.
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # add_compile_options(/W4)

elseif (UNIX)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
#add_compile_options(-Werror) # Make all warnings into errors
add_compile_options(-Wall -Wextra -Wpedantic -pedantic-errors -Wunused)
Expand All @@ -19,8 +19,6 @@ elseif (UNIX)
add_compile_options(-Wsuggest-override)
add_compile_options(-Woverloaded-virtual)
#add_compile_options(-Warray-bounds)
add_compile_options(-Wduplicated-branches -Wduplicated-cond)
add_compile_options(-Wtrampolines)
add_compile_options(-Wshadow)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
#add_compile_options(-Wfloat-equal)
Expand All @@ -30,7 +28,12 @@ elseif (UNIX)
add_compile_options(-Wno-double-promotion) # implicit conversion of `float` to `double` is fine

add_compile_options(-Wno-array-bounds) # TODO: fix the code!
add_compile_options(-Wno-maybe-uninitialized) # TODO: fix the code!

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wduplicated-branches -Wduplicated-cond)
add_compile_options(-Wtrampolines)
add_compile_options(-Wno-maybe-uninitialized) # TODO: fix the code!
endif()

# Need a newer compiler than GCC 9
#add_compile_options(-Wnrvo)
Expand Down
11 changes: 6 additions & 5 deletions externals/coda-oss/modules/c++/gsl/include/gsl/assert
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@
// Hopefully temporary until suppression standardization occurs
//
#if defined(__clang__)
#define GSL_SUPPRESS(x) [[gsl::suppress("x")]]
#else
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
#define GSL_SUPPRESS(x) [[gsl::suppress(#x)]]
#elif defined(_MSC_VER) && _MSC_VER >= 1950
// Visual Studio versions after 2022 (_MSC_VER > 1944) support the justification message.
#define GSL_SUPPRESS(x) [[gsl::suppress(#x)]]
#elif defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__NVCC__)
#define GSL_SUPPRESS(x) [[gsl::suppress(x)]]
#else
#define GSL_SUPPRESS(x)
#endif // _MSC_VER
#endif // __clang__
#endif // defined(__clang__)

#define GSL_STRINGIFY_DETAIL(x) #x
#define GSL_STRINGIFY(x) GSL_STRINGIFY_DETAIL(x)
Expand Down
13 changes: 7 additions & 6 deletions externals/coda-oss/modules/c++/gsl/include/gsl/byte
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@
#define GSL_BYTE_H

//
// make suppress attributes work for some compilers
// make suppress attributes parse for some compilers
// Hopefully temporary until suppression standardization occurs
//
#if defined(__clang__)
#define GSL_SUPPRESS(x) [[gsl::suppress("x")]]
#else
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
#define GSL_SUPPRESS(x) [[gsl::suppress(#x)]]
#elif defined(_MSC_VER) && _MSC_VER >= 1950
// Visual Studio versions after 2022 (_MSC_VER > 1944) support the justification message.
#define GSL_SUPPRESS(x) [[gsl::suppress(#x)]]
#elif defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__NVCC__)
#define GSL_SUPPRESS(x) [[gsl::suppress(x)]]
#else
#define GSL_SUPPRESS(x)
#endif // _MSC_VER
#endif // __clang__
#endif // defined(__clang__)

#include <type_traits>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2025-26 ARKA Group, L.P. All rights reserved
*
* logging-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -28,6 +29,8 @@
#define CODA_OSS_logging_Handler_h_INCLUDED_

#include <string>
#include <mutex>

#include "config/Exports.h"
#include "logging/LogRecord.h"
#include "logging/Formatter.h"
Expand Down Expand Up @@ -94,7 +97,7 @@ struct CODA_OSS_API Handler : public Filterer
virtual void emitRecord(const LogRecord* record) = 0;

LogLevel mLevel = LogLevel::LOG_NOTSET;
sys::Mutex mHandlerLock;
std::recursive_mutex mHandlerLock;
Formatter* mFormatter = nullptr;
StandardFormatter mDefaultFormatter;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2025-26 ARKA Group, L.P. All rights reserved
*
* logging-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -142,6 +143,14 @@ struct CODA_OSS_API Logger : public Filterer
return mName;
}

/*!
* Returns the current log level of the first handler, if any. Otherwise
* returns LogLevel::LOG_NOTSET. Note that each handler may have a
* different log level. However, the setLevel function changes the level
* of all handlers attached to this logger.
*/
LogLevel getLevel();

//! Removes all handlers
void reset();

Expand Down
3 changes: 2 additions & 1 deletion externals/coda-oss/modules/c++/logging/source/Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2025-26 ARKA Group, L.P. All rights reserved
*
* logging-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -57,7 +58,7 @@ bool Handler::handle(const LogRecord* record)
if (filter(record))
{
//acquire lock
mt::CriticalSection<sys::Mutex> lock(&mHandlerLock);
mt::CriticalSection<decltype(mHandlerLock)> lock(&mHandlerLock);
try
{
emitRecord(record);
Expand Down
14 changes: 14 additions & 0 deletions externals/coda-oss/modules/c++/logging/source/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2025-26 ARKA Group, L.P. All rights reserved
*
* logging-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -239,3 +240,16 @@ void logging::Logger::reset()
}
mHandlers.clear();
}

logging::LogLevel logging::Logger::getLevel()
{
LogLevel level = LogLevel::LOG_NOTSET;
if (!mHandlers.empty())
{
Handler_T handler = mHandlers.front();
level = handler.first->getLevel();
}

return level;
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2025-26 ARKA Group, L.P. All rights reserved
*
* logging-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -111,7 +112,7 @@ void StreamHandler::write(const std::string& str)
if (!str.empty())
{
//acquire lock
mt::CriticalSection<sys::Mutex> lock(&mHandlerLock);
mt::CriticalSection<decltype(mHandlerLock)> lock(&mHandlerLock);

// write to stream
mStream->write(str);
Expand Down
Loading
Loading