Skip to content

Commit

Permalink
Merge branch 'main' into feature/xml.dom
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Jan 24, 2024
2 parents b939d55 + d723792 commit 47ac70b
Show file tree
Hide file tree
Showing 67 changed files with 1,912 additions and 415 deletions.
18 changes: 9 additions & 9 deletions .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 @@ -63,7 +63,7 @@ jobs:
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 @@ -136,7 +136,7 @@ jobs:
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
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: 6 additions & 2 deletions UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down Expand Up @@ -71,6 +69,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -96,6 +95,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -325,6 +325,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\sys\unittests\test_ximd.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\types\unittests\test_complex.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand Down
9 changes: 6 additions & 3 deletions UnitTest/UnitTest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,15 @@
<ClCompile Include="..\modules\drivers\highfive\unittests\tests_high_five_base.cpp">
<Filter>hdf5.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.dom\unittests\test_xmldom.cpp">
<Filter>xml.dom</Filter>
<ClCompile Include="..\modules\c++\sys\unittests\test_ximd.cpp">
<Filter>sys</Filter>
</ClCompile>
<ClCompile Include="xml.dom.cpp">
<Filter>xml.dom</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.dom\unittests\test_xmldom.cpp">
<Filter>xml.dom</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand Down Expand Up @@ -325,7 +328,7 @@
<UniqueIdentifier>{f4dfc761-e468-4305-84dc-f3579e46107e}</UniqueIdentifier>
</Filter>
<Filter Include="xml.dom">
<UniqueIdentifier>{4a813331-5c94-46e0-96f5-1f2f6ee17df2}</UniqueIdentifier>
<UniqueIdentifier>{d5f6325a-efb3-4f2f-a26a-6afc5e83a1df}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions 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
7 changes: 7 additions & 0 deletions 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 All @@ -21,6 +23,7 @@
#include <sys/DateTime.h>
#include <sys/Conf.h>
#include <sys/Path.h>
#include <sys/Ximd.h>

namespace sys
{
Expand Down Expand Up @@ -56,4 +59,8 @@ TEST_CLASS(test_path){ public:
#include "sys/unittests/test_path.cpp"
};

TEST_CLASS(test_ximd){ public:
#include "sys/unittests/test_ximd.cpp"
};

}
15 changes: 15 additions & 0 deletions cmake/CodaBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ macro(coda_initialize_build)
option(BUILD_SHARED_LIBS "Build shared libraries instead of static." OFF)
if(BUILD_SHARED_LIBS)
set(CODA_LIBRARY_TYPE "shared")
add_definitions(-DCODA_OSS_LIBRARY_SHARED=1)
add_definitions(-UCODA_OSS_LIBRARY_STATIC)
else()
set(CODA_LIBRARY_TYPE "static")
add_definitions(-DCODA_OSS_LIBRARY_STATIC=1)
add_definitions(-UCODA_OSS_LIBRARY_SHARED)
endif()

option(CODA_BUILD_TESTS "build tests" ON)
Expand All @@ -142,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
16 changes: 11 additions & 5 deletions modules/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ set(TARGET_LANGUAGE c++)
if (MSVC)
# By default, there is a /W3 on the command-line from somewhere (?); adding
# /Wn results in a compiler warning.
#add_compile_options(/W4) # /Wall
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # /Wall
#
# https://github.com/microsoft/STL/wiki/Changelog#vs-2022-179-preview-1
# > *Note*: `/Wall` is not intended for regular production use, as it contains a large number of
# > 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)
# 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 @@ -26,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
13 changes: 9 additions & 4 deletions modules/c++/coda-oss.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<ClInclude Include="coda_oss\include\coda_oss\bit.h" />
<ClInclude Include="coda_oss\include\coda_oss\CPlusPlus.h" />
<ClInclude Include="coda_oss\include\coda_oss\cstddef.h" />
<ClInclude Include="coda_oss\include\coda_oss\mdspan.h" />
<ClInclude Include="coda_oss\include\coda_oss\mdspan_.h" />
<ClInclude Include="coda_oss\include\coda_oss\namespace_.h" />
<ClInclude Include="coda_oss\include\coda_oss\numbers.h" />
<ClInclude Include="coda_oss\include\coda_oss\optional.h" />
Expand Down Expand Up @@ -283,6 +285,7 @@
<ClInclude Include="sys\include\sys\ThreadWin32.h" />
<ClInclude Include="sys\include\sys\TimeStamp.h" />
<ClInclude Include="sys\include\sys\UTCDateTime.h" />
<ClInclude Include="sys\include\sys\Ximd.h" />
<ClInclude Include="tiff\include\tiff\Common.h" />
<ClInclude Include="tiff\include\tiff\FileReader.h" />
<ClInclude Include="tiff\include\tiff\FileWriter.h" />
Expand Down Expand Up @@ -521,6 +524,7 @@
<None Include="std\include\std\bit" />
<None Include="std\include\std\cstddef" />
<None Include="std\include\std\filesystem" />
<None Include="std\include\std\mdspan" />
<None Include="std\include\std\memory" />
<None Include="std\include\std\numbers" />
<None Include="std\include\std\optional" />
Expand Down Expand Up @@ -576,9 +580,9 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>EnableAllWarnings</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_EXPORTS;CODA_OSS_LIBRARY_SHARED=1</PreprocessorDefinitions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>cli\include;coda_oss\include;config\include;dbi\include;except\include;gsl\include;hdf5.lite\include;io\include;logging\include;math\include;math.linear\include;math.poly\include;mem\include;mt\include;net\include;net.ssl\include;plugin\include;polygon\include;re\include;sio.lite\include;std\include;str\include;sys\include;tiff\include;types\include;unique\include;units\include;xml.lite\include;zip\include;$(ProjectDir)include;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)externals\$(ProjectName)\out\install\$(Platform)-$(Configuration)\include</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand All @@ -605,11 +609,10 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_EXPORTS;CODA_OSS_LIBRARY_SHARED=1</PreprocessorDefinitions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>cli\include;coda_oss\include;config\include;dbi\include;except\include;gsl\include;hdf5.lite\include;io\include;logging\include;math\include;math.linear\include;math.poly\include;mem\include;mt\include;net\include;net.ssl\include;plugin\include;polygon\include;re\include;sio.lite\include;std\include;str\include;sys\include;tiff\include;types\include;unique\include;units\include;xml.lite\include;zip\include;$(ProjectDir)include;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)externals\$(ProjectName)\out\install\$(Platform)-$(Configuration)\include</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand All @@ -621,6 +624,8 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>
Expand Down
14 changes: 13 additions & 1 deletion modules/c++/coda-oss.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,15 @@
<ClInclude Include="str\include\str\W1252string.h">
<Filter>str</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\mdspan.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\mdspan_.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="sys\include\sys\Ximd.h">
<Filter>sys</Filter>
</ClInclude>
<ClInclude Include="xml.dom\include\xml\dom\DOMConfiguration.h">
<Filter>xml.dom</Filter>
</ClInclude>
Expand Down Expand Up @@ -1530,7 +1539,7 @@
<UniqueIdentifier>{59f3d9a1-06d3-4779-aef2-cc55223c3017}</UniqueIdentifier>
</Filter>
<Filter Include="xml.dom">
<UniqueIdentifier>{21b90236-d753-42d5-977c-4e507e878a1f}</UniqueIdentifier>
<UniqueIdentifier>{666d5271-6843-4358-87dd-2fac8f851f63}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -1598,5 +1607,8 @@
<None Include="sys\source\CppUnitTestAssert_.cpp_">
<Filter>sys</Filter>
</None>
<None Include="std\include\std\mdspan">
<Filter>std</Filter>
</None>
</ItemGroup>
</Project>
Loading

0 comments on commit 47ac70b

Please sign in to comment.