Skip to content

Commit

Permalink
Squashed 'externals/nitro/' changes from 3118941cc..00c30348d
Browse files Browse the repository at this point in the history
00c30348d NITRO-2.11.6 (#609)

git-subtree-dir: externals/nitro
git-subtree-split: 00c30348d90124ac53804e98236b198dd75ece65
  • Loading branch information
Dan Smith committed Mar 18, 2024
1 parent 35be198 commit bb523ae
Show file tree
Hide file tree
Showing 25 changed files with 573 additions and 278 deletions.
6 changes: 6 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# NITRO (NITF i/o) Release Notes

## [Version 2.11.6](https://github.com/mdaus/nitro/releases/tag/NITRO-2.11.6); March 18, 2024
* [coda-oss](https://github.com/mdaus/coda-oss) release [2024-03-18](https://github.com/mdaus/coda-oss/releases/tag/2024-03-18)
* TREs can now be statically ["pre-loaded"](https://github.com/mdaus/nitro/pull/601), no need to set NITF_PLUGIN_PATH.
* Be sure TRE field padding is done properly.
* Allow shared-libraries (DLLs) to be build; disabled by default.

## [Version 2.11.5](https://github.com/mdaus/nitro/releases/tag/NITRO-2.11.5); October 23, 2023
* [coda-oss](https://github.com/mdaus/coda-oss) release [2023-10-23](https://github.com/mdaus/coda-oss/releases/tag/2023-10-23)
* Fix some ASAN diagnostics, still more to do.
Expand Down
1 change: 1 addition & 0 deletions UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
24 changes: 12 additions & 12 deletions externals/coda-oss/.github/workflows/build_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.python-version }}-CMake
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
Expand Down Expand Up @@ -58,12 +58,12 @@ jobs:
os: [windows-latest]
platform: [x64]
configuration: [Debug] # Debug turns on more compiler warnings
avx: [AVX2, AVX512F]
avx: [AVX512F]
name: ${{ matrix.os }}-${{ matrix.avx }}-msbuild
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: configure
run: |
ls env:
Expand All @@ -76,7 +76,7 @@ jobs:
cmake --build . --config ${{ matrix.configuration }} -j
cmake --build . --config ${{ matrix.configuration }} --target install
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2 # https://github.com/marketplace/actions/setup-msbuild
uses: microsoft/setup-msbuild@v1.1 # https://github.com/marketplace/actions/setup-msbuild
with:
msbuild-architecture: x64
- name: msbuild
Expand All @@ -98,9 +98,9 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.python-version }}-CMake
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
Expand Down Expand Up @@ -132,15 +132,15 @@ jobs:
matrix:
os: [ubuntu-latest]
configuration: [Debug, Release]
avx: [AVX2, AVX512F]
avx: [AVX512F]
name: ${{ matrix.os }}-${{ matrix.configuration }}-${{ matrix.avx }}-CMake
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: configure
run: |
mkdir out && cd out
cmake .. -DENABLE_PYTHON=OFF -DENABLE_ASAN=ON -DENABLE_${{ matrix.avx }}=ON
cmake .. -DENABLE_PYTHON=OFF -DENABLE_${{ matrix.avx }}=ON
- name: build
run: |
cd out
Expand All @@ -161,9 +161,9 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.python-version }}-waf${{ matrix.debugging }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: configure_with_swig
Expand Down
8 changes: 7 additions & 1 deletion externals/coda-oss/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# coda-oss Release Notes

## [Release 202?-??-??](https://github.com/mdaus/coda-oss/releases/tag/202?-??-??)
## [Release 2024-03-18](https://github.com/mdaus/coda-oss/releases/tag/2024-03-18)
* Update to [HighFive 2.8.0](https://github.com/BlueBrain/HighFive/releases/tag/v2.8.0).
* Use lookup tables for converting between character encodings and upper/lower-case.
* [`sys::Transform(std::execution)`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t) for C++14.
* Infrastructure to support SIMD processing.
* Simple/incomplete [`std::mdspan`](https://en.cppreference.com/w/cpp/container/mdspan) implementation.
* Support for building as a shared library/DLL, disabled by default.
* Create/destroy Xerces just once per process.

## [Release 2023-10-23](https://github.com/mdaus/coda-oss/releases/tag/2023-10-23)
* Tweaked **.gitattributes**.
Expand Down
3 changes: 3 additions & 0 deletions externals/coda-oss/UnitTest/mt.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <sys/ByteSwap.h>

#include <mt/CriticalSection.h>
#include <mt/ThreadPlanner.h>
#include <mt/ThreadGroup.h>
Expand All @@ -11,6 +13,7 @@
#include <mt/ThreadPoolException.h>
#include <mt/GenerationThreadPool.h>
#include <mt/ThreadedByteSwap.h>
#include <mt/Algorithm.h>

namespace mt
{
Expand Down
2 changes: 2 additions & 0 deletions externals/coda-oss/UnitTest/sys.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <coda_oss/numbers.h>

#include <import/sys.h>
#include <sys/Runnable.h>
#include <sys/Thread.h>
Expand Down
11 changes: 11 additions & 0 deletions externals/coda-oss/cmake/CodaBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ macro(coda_initialize_build)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Turn on AVX2 by default ... it's from 2013.
# Well, no :-( ... it seems to cause crashes w/older
# compilers on build servers. :-(
set(ENABLE_AVX2 false)
set(ENABLE_AVX512F false)
#if (NOT ENABLE_AVX512F)
# if (NOT DISABLE_AVX2)
# set(ENABLE_AVX2 true)
# endif()
#endif()

# MSVC-specific flags and options.
if (MSVC)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down
9 changes: 6 additions & 3 deletions externals/coda-oss/modules/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ if (MSVC)

elseif (UNIX)
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
add_compile_options(-Werror) # Make all warnings into errors
#add_compile_options(-Werror) # Make all warnings into errors
add_compile_options(-Wall -Wextra -Wpedantic -pedantic-errors -Wunused)

add_compile_options(-Wzero-as-null-pointer-constant)
add_compile_options(-Wsuggest-final-types -Wsuggest-final-methods)
#add_compile_options(-Wsuggest-final-types -Wsuggest-final-methods)
add_compile_options(-Wsuggest-override)
add_compile_options(-Woverloaded-virtual)
add_compile_options(-Warray-bounds)
#add_compile_options(-Warray-bounds)
add_compile_options(-Wduplicated-branches -Wduplicated-cond)
add_compile_options(-Wtrampolines)
add_compile_options(-Wshadow)
Expand All @@ -29,6 +29,9 @@ 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!

# Need a newer compiler than GCC 9
#add_compile_options(-Wnrvo)
endif()
Expand Down
28 changes: 21 additions & 7 deletions externals/coda-oss/modules/c++/avx/unittests/test_m256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,24 @@ TEST_CASE(test_getSIMDInstructionSet)
{
// This is the reverse of getSIMDInstructionSet(): it uses the macros to generate a value.
constexpr auto simdInstructionSet = sys::getSIMDInstructionSet();
#if __AVX512F__
static_assert(simdInstructionSet == sys::SIMDInstructionSet::AVX512F, "getSIMDInstructionSet()");
#elif __AVX2__
static_assert(simdInstructionSet == sys::SIMDInstructionSet::AVX2, "getSIMDInstructionSet()");
#if CODA_OSS_ENABLE_SIMD
#if __AVX512F__
static_assert(simdInstructionSet == sys::SIMDInstructionSet::AVX512F, "getSIMDInstructionSet()");
#elif __AVX2__
static_assert(simdInstructionSet == sys::SIMDInstructionSet::AVX2, "getSIMDInstructionSet()");
#else
static_assert(simdInstructionSet == sys::SIMDInstructionSet::SSE2, "getSIMDInstructionSet()");
#endif
#else
static_assert(simdInstructionSet == sys::SIMDInstructionSet::SSE2, "getSIMDInstructionSet()");
#endif
static_assert(simdInstructionSet == sys::SIMDInstructionSet::Disabled, "getSIMDInstructionSet()");
#endif // CODA_OSS_ENABLE_SIMD

CODA_OSS_disable_warning_push
#if _MSC_VER
#pragma warning(disable: 4127) // conditional expression is constant
#endif

switch (sys::getSIMDInstructionSet()) // run-time value
switch (sys::getSIMDInstructionSet()) // run-time value (well, not really, but it could be)
{
case sys::SIMDInstructionSet::SSE2:
{
Expand All @@ -86,6 +90,16 @@ TEST_CASE(test_getSIMDInstructionSet)
TEST_ASSERT(simdInstructionSet == sys::SIMDInstructionSet::AVX512F);
break;
}
case sys::SIMDInstructionSet::Disabled:
{
TEST_ASSERT(simdInstructionSet == sys::SIMDInstructionSet::Disabled);
break;
}
case sys::SIMDInstructionSet::Unknown:
{
TEST_ASSERT(simdInstructionSet == sys::SIMDInstructionSet::Unknown);
break;
}
default:
{
TEST_FAIL;
Expand Down
6 changes: 3 additions & 3 deletions externals/coda-oss/modules/c++/coda-oss.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +1442,6 @@
<Filter Include="math.poly">
<UniqueIdentifier>{15f9b62f-d17e-4d84-bc34-de6fd5fbcb33}</UniqueIdentifier>
</Filter>
<Filter Include="polygon">
<UniqueIdentifier>{f2544ccb-0933-44c7-af39-cd986982af3d}</UniqueIdentifier>
</Filter>
<Filter Include="include">
<UniqueIdentifier>{9050a469-23a5-4da0-92b1-a07a8e52e9fc}</UniqueIdentifier>
</Filter>
Expand Down Expand Up @@ -1499,6 +1496,9 @@
<Filter Include="coda_oss">
<UniqueIdentifier>{59f3d9a1-06d3-4779-aef2-cc55223c3017}</UniqueIdentifier>
</Filter>
<Filter Include="polygon">
<UniqueIdentifier>{f2544ccb-0933-44c7-af39-cd986982af3d}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="gsl\include\gsl\algorithm">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ static_assert(CODA_OSS_MAKE_VERSION_MMPB(9999, 9999, 9999, 9999) <= UINT64_MAX,

// Do this ala C++ ... we don't currently have major/minor/patch
//#define CODA_OSS_VERSION_ 20210910L // c.f. __cplusplus
#define CODA_OSS_VERSION_ 2023 ## 0010 ## 0023 ## 0000 ## L
#define CODA_OSS_VERSION_ 2024 ## 0003 ## 0018 ## 0000 ## L

// Use the same macros other projects might want to use; overkill for us.
#define CODA_OSS_VERSION_MAJOR 2023
#define CODA_OSS_VERSION_MINOR 10
#define CODA_OSS_VERSION_PATCH 23 // a.k.a. "point," but too similar to "patch."
#define CODA_OSS_VERSION_MAJOR 2024
#define CODA_OSS_VERSION_MINOR 3
#define CODA_OSS_VERSION_PATCH 18 // a.k.a. "point," but too similar to "patch."
#define CODA_OSS_VERSION_BUILD 0 // a.k.a. "patch," but too similar to "point."
#define CODA_OSS_VERSION CODA_OSS_MAKE_VERSION_MMPB(CODA_OSS_VERSION_MAJOR, CODA_OSS_VERSION_MINOR, CODA_OSS_VERSION_PATCH, CODA_OSS_VERSION_BUILD)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <stdexcept>
#include <vector>

#include "types/RowCol.h"

#include "H5_.h"
#include "SpanRC.h"

Expand Down
18 changes: 7 additions & 11 deletions externals/coda-oss/modules/c++/logging/source/Setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
std::unique_ptr<logging::Logger>
logging::setupLogger(const path& program_,
const std::string& logLevel,
const path& logFile_,
const path& logFile,
const std::string& logFormat,
size_t logCount,
size_t logBytes)
Expand All @@ -44,29 +44,25 @@ logging::setupLogger(const path& program_,
std::unique_ptr<logging::Logger> log(new logging::Logger(program));

// setup logging level
std::string lev = logLevel;
str::upper(lev);
auto lev = str::upper(logLevel);
str::trim(lev);
logging::LogLevel level = (lev.empty()) ? logging::LogLevel::LOG_WARNING :
logging::LogLevel(lev);
const auto level = lev.empty() ? logging::LogLevel::LOG_WARNING : logging::LogLevel(lev);

// setup logging formatter
std::unique_ptr <logging::Formatter> formatter;
const auto logFile = logFile_.string();
const auto file = str::lower(logFile);
const auto file = str::lower(logFile.string());
if (str::endsWith(file, ".xml"))
{
formatter.reset(
new logging::XMLFormatter("", "<Log image=\"" + program + "\">"));
formatter = std::make_unique<logging::XMLFormatter>("", "<Log image=\"" + program + "\">");
}
else
{
formatter.reset(new logging::StandardFormatter(logFormat));
formatter = std::make_unique<logging::StandardFormatter>(logFormat);
}

// setup logging handler
std::unique_ptr<logging::Handler> logHandler;
if (file.empty() || file == "console")
if (file.empty() || (file == "console") || (file == "-"))
logHandler.reset(new logging::StreamHandler());
else
{
Expand Down
Loading

0 comments on commit bb523ae

Please sign in to comment.