Skip to content

Commit

Permalink
Merge branch 'main' into feature/simd
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Feb 8, 2024
2 parents 20fc086 + a6f8cc4 commit 76280fd
Show file tree
Hide file tree
Showing 379 changed files with 17,501 additions and 4,361 deletions.
85 changes: 38 additions & 47 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,43 @@ CMakeLists.txt text eol=lf

# Modern tools on Windows can handle Linux LF
# See https://stackoverflow.com/a/13154031/8877 for details
* text=auto eol=lf
.git?* text
* text=auto eol=lf
*.* text=auto eol=lf
.git?* text=auto eol=lf

# Leave known Windows-only text files as CR/LF
*.sln text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf
*.ruleset text eol=crlf

# Text file formats
*.txt text eol=lf
*.md text eol=lf
*.tex text eol=lf
*.?ml text eol=lf
*.kmz binary

# Programming languages
*.htm? text eol=lf
*.css text eol=lf
*.c text eol=lf
*.cc text eol=lf
*.c?? text eol=lf
*.c??m text eol=lf
*.ccm text eol=lf
*.C text eol=lf
*.h?? text eol=lf
*.h text eol=lf
*.hh text eol=lf
*.ixx text eol=lf
*.mpp text eol=lf
*.py text eol=lf
*.pyc binary
# .f and .f90
*.f* text eol=lf
*.m text eol=lf
*.java text eol=lf
*.cs text eol=lf
*.vb text eol=lf
*.js text eol=lf
*.ts text eol=lf
*.pl text eol=lf
*.sh text eol=lf
*.csh text eol=lf
*.sln text eol=crlf
*.dsw text eol=crlf
*.dsp text eol=crlf
*.vcproj text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf
*.ruleset text eol=crlf
*.bat text eol=crlf

######################
# Known binary files

# Python builds with WAF
waf binary

# executables, libraries; yes, sometimes they're part of a repository
*.exe binary
*.out binary
lib*.so* binary
*.dll binary
lib*.a* binary
*.lib binary
*.mex binary
*.pyc binary

# from various unit_test/ directories
*.dat binary
*.*hdr binary
*.flat binary
*.sig binary
*.bin binary
*.dump binary

# images
*.bmp binary
Expand All @@ -71,9 +55,10 @@ CMakeLists.txt text eol=lf
*.jpeg binary
*.png binary
# SVG images are XML
*.svg text eol=lf
*.svg text
*.raw binary
*.hei* binary
*.hei? binary
*.kmz binary

# music
*.mp3 binary
Expand All @@ -90,15 +75,21 @@ CMakeLists.txt text eol=lf
# documents
*.pdf binary
*.dvi binary
*.doc* binary
*.xls* binary
*.ppt* binary
*.doc binary
*.docx binary
*.xls binary
*.xlsx binary
*.ppt binary
*.pptx binary

# SAR
*.h5 binary
*.sio binary
*.hdr binary
*.ntf binary
*.nitf binary
*.si?d binary
*.sidd binary
*.sicd? binary

# containers
*.zip binary
Expand Down
53 changes: 38 additions & 15 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 @@ -58,24 +58,25 @@ jobs:
os: [windows-latest]
platform: [x64]
configuration: [Debug] # Debug turns on more compiler warnings
name: ${{ matrix.os }}-msbuild
avx: [AVX2, 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:
mkdir out
cd out
cmake .. -DCMAKE_INSTALL_PREFIX=install\${{ matrix.platform }}-${{ matrix.configuration }} -DENABLE_PYTHON=OFF
cmake .. -DCMAKE_INSTALL_PREFIX=install\${{ matrix.platform }}-${{ matrix.configuration }} -DENABLE_PYTHON=OFF -DENABLE_${{ matrix.avx }}=ON
- name: build
run: |
cd out
cmake --build . --config ${{ matrix.configuration }} -j
cmake --build . --config ${{ matrix.configuration }} --target install
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1 # 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 @@ -89,17 +90,17 @@ jobs:
# searchFolder: D:\a\nitro\nitro\${{ matrix.platform }}\${{ matrix.configuration }}
# runInParallel: true

build-linux-cmake:
build-linux-cmake-default:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.7']
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 All @@ -109,10 +110,7 @@ jobs:
run: |
env
which python
mkdir target
cd target
export CC=gcc-11
export CXX=g++-11
mkdir target && cd target
cmake .. -DCMAKE_INSTALL_PREFIX=install${{ matrix.os }}CMake-Github -DPYTHON_VERSION=${{ matrix.python-version }} -DENABLE_SWIG=ON
- name: build
run: |
Expand All @@ -129,6 +127,31 @@ jobs:
cd target
cmake --build . --target install
build-linux-cmake:
strategy:
matrix:
os: [ubuntu-latest]
configuration: [Debug, Release]
avx: [AVX2, AVX512F]
name: ${{ matrix.os }}-${{ matrix.configuration }}-${{ matrix.avx }}-CMake
runs-on: ${{ matrix.os }}
steps:
- 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
- name: build
run: |
cd out
# "-j" spawns too many processes causing GCC to crash
cmake --build . --config ${{ matrix.configuration }} -j 12
- name: test
# should run w/o install
run: |
cd out
ctest -C ${{ matrix.configuration }} --output-on-failure
build-waf:
strategy:
matrix:
Expand All @@ -138,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
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,8 @@ if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
if (MSVC)
add_compile_options(/WX) # warnings as errors
add_compile_options(/MP) # multi-processor compile

if (ENABLE_ASAN)
# https://docs.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-160
add_compile_options(/fsanitize=address)
endif()
elseif (UNIX)
add_compile_options(-Werror) # warnings as errors

if (ENABLE_ASAN)
# https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down
13 changes: 12 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# coda-oss Release Notes

## [Release 202?-??-??](https://github.com/mdaus/coda-oss/releases/tag/202?-??-??)
* Update to [HighFive 2.8.0](https://github.com/BlueBrain/HighFive/releases/tag/v2.8.0).

## [Release 2023-10-23](https://github.com/mdaus/coda-oss/releases/tag/2023-10-23)
* Tweaked **.gitattributes**.
* Removed *str::EncodedStringView*; made *str* conversion routines more consistent.
* *FmtX()* uses overloads rather than C-style varargs.
* Add [`std::ssize()`](https://en.cppreference.com/w/cpp/iterator/size).
* `ENABLE_AVX2` and `ENABLE_AVX512F` flags for CMake builds.
* Build cleanly with ASAN.

## [Release 2023-08-18](https://github.com/mdaus/coda-oss/releases/tag/2023-08-18)
* New `sys::OS::getSIMDInstructionSet()` utility routine; SSE2 is required (default with 64-bit builds).
* `types::ComplexInteger` to work-around `std::complex<short>` no longer being [valid C++](https://en.cppreference.com/w/cpp/numeric/complex).
* Another round of reducing various compiler warnings (of note: `NULL` -> `nullptr`).
* Some suport for [`std::numbers`](https://en.cppreference.com/w/cpp/header/numbers) from C++20.
* Some support for [`std::numbers`](https://en.cppreference.com/w/cpp/header/numbers) from C++20.
* Update to [HighFive 2.7.1](https://github.com/BlueBrain/HighFive/releases/tag/v2.7.1).
* Update to [e2fsprogs 1.47.0](https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0).
* Update to [xerces-c 3.2.4](https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12350542&styleName=Text&projectId=10510).
Expand Down
7 changes: 1 addition & 6 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,8 +69,6 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
Expand All @@ -99,8 +95,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
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
2 changes: 2 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 Down
6 changes: 3 additions & 3 deletions build/scripts/makeEnums.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def cmpValues(x, y):
s.write(' %sif (s == "%s")\n value = %s%s;\n' % (i > 0 and 'else ' or '',
n, values.cleanPrefix, item.names[0].replace(' ', '_')))
i += 1
s.write(' else\n throw except::InvalidFormatException(Ctxt(FmtX("Invalid enum value: %s", s.c_str())));\n')
s.write(' else\n throw except::InvalidFormatException(Ctxt(str::Format("Invalid enum value: %s", s.c_str())));\n')
s.write(' }\n\n')

s.write(' //! int constructor\n')
Expand All @@ -123,7 +123,7 @@ def cmpValues(x, y):
try:
idx += 1
except:{}
s.write(' default:\n throw except::InvalidFormatException(Ctxt(FmtX("Invalid enum value: %d", i)));\n')
s.write(' default:\n throw except::InvalidFormatException(Ctxt(str::Format("Invalid enum value: %d", i)));\n')
s.write(' }\n }\n\n')

s.write(' //! destructor\n')
Expand All @@ -142,7 +142,7 @@ def cmpValues(x, y):
try:
idx += 1
except:{}
s.write(' default:\n throw except::InvalidFormatException(Ctxt(FmtX("Invalid enum value: %d", value)));\n')
s.write(' default:\n throw except::InvalidFormatException(Ctxt(str::Format("Invalid enum value: %d", value)));\n')
s.write(' }\n }\n\n')

s.write(' //! assignment operator\n')
Expand Down
Loading

0 comments on commit 76280fd

Please sign in to comment.