Skip to content

Commit

Permalink
Squashed 'externals/coda-oss/' changes from 54033e70e..c2fc5fc66
Browse files Browse the repository at this point in the history
c2fc5fc66 add more projects to coda-oss-lite.vcxproj (#694)
ceb86c186 support $(PlatformToolset) as a "special" environment variable (#693)
d78a8595a OS::getSIMDInstructionSet() utility (#692)
2d2df467d fix `python3 waf dumplib`

git-subtree-dir: externals/coda-oss
git-subtree-split: c2fc5fc660c2794d77fac2b71cf0dfae76c22c3e
  • Loading branch information
Dan Smith authored and Dan Smith committed Jul 5, 2023
1 parent 1ceb8e3 commit ea623b4
Show file tree
Hide file tree
Showing 30 changed files with 402 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ project.sln
*.vcxproj.user

# Unit-tests
TEST_*_TMP.*
TEST_*_TMP*.*
28 changes: 24 additions & 4 deletions UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\hdf5.lite\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;$(SolutionDir)modules\c++\zip\include\;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -71,10 +71,11 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)\out\install\$(Platform)-$(Configuration)\lib\;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -84,7 +85,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\hdf5.lite\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;$(SolutionDir)modules\c++\zip\include\;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -96,12 +97,13 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)\out\install\$(Platform)-$(Configuration)\lib\;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -113,6 +115,18 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\hdf5.lite\unittests\test_hdf5info.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\hdf5.lite\unittests\test_hdf5read.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\hdf5.lite\unittests\test_hdf5write.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\io\unittests\test_streams.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand Down Expand Up @@ -341,9 +355,14 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\zip\unittests\unittest_GZip.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="avx.cpp" />
<ClCompile Include="cli.cpp" />
<ClCompile Include="CppUnitTestAssert.cpp" />
<ClCompile Include="hdf5.lite.cpp" />
<ClCompile Include="io.cpp" />
<ClCompile Include="logging.cpp" />
<ClCompile Include="math.linear.cpp" />
Expand All @@ -361,6 +380,7 @@
<ClCompile Include="sys.cpp" />
<ClCompile Include="types.cpp" />
<ClCompile Include="units.cpp" />
<ClCompile Include="zip.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand Down
24 changes: 24 additions & 0 deletions UnitTest/UnitTest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,24 @@
<ClCompile Include="..\modules\c++\types\unittests\test_complex.cpp">
<Filter>types</Filter>
</ClCompile>
<ClCompile Include="hdf5.lite.cpp">
<Filter>hdf5.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\hdf5.lite\unittests\test_hdf5info.cpp">
<Filter>hdf5.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\hdf5.lite\unittests\test_hdf5read.cpp">
<Filter>hdf5.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\hdf5.lite\unittests\test_hdf5write.cpp">
<Filter>hdf5.lite</Filter>
</ClCompile>
<ClCompile Include="zip.cpp">
<Filter>zip</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\zip\unittests\unittest_GZip.cpp">
<Filter>zip</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand Down Expand Up @@ -276,5 +294,11 @@
<Filter Include="re">
<UniqueIdentifier>{d205c017-7e98-456f-923f-2f78870a3d7d}</UniqueIdentifier>
</Filter>
<Filter Include="hdf5.lite">
<UniqueIdentifier>{5997a3de-0dc5-4439-b068-b351c5f395e3}</UniqueIdentifier>
</Filter>
<Filter Include="zip">
<UniqueIdentifier>{223c163f-0321-4935-8e20-0e05f048adf0}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions UnitTest/hdf5.lite.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <import/hdf5/lite.h>
#include <hdf5/lite/HDF5Exception.h>
#include <hdf5/lite/Info.h>
#include <hdf5/lite/Read.h>
#include <hdf5/lite/Write.h>

namespace hdf5_lite
{

TEST_CLASS(test_hdf5info){ public:
#include "hdf5.lite/unittests/test_hdf5info.cpp"
};

TEST_CLASS(test_hdf5read){ public:
#include "hdf5.lite/unittests/test_hdf5read.cpp"
};

TEST_CLASS(test_hdf5write){ public:
#include "hdf5.lite/unittests/test_hdf5write.cpp"
};

}
2 changes: 2 additions & 0 deletions UnitTest/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
#include <import/logging.h>
#include <import/re.h>
#include "io/StringStream.h"
#include <sys/FileFinder.h>
#include <io/ReadUtils.h>

#include "TestCase.h"

Expand Down
12 changes: 12 additions & 0 deletions UnitTest/zip.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <import/zip.h>

namespace zip
{
TEST_CLASS(unittest_GZip){ public:
#include "zip/unittests/unittest_GZip.cpp"
};

}
12 changes: 7 additions & 5 deletions build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ def configureCompilerOptions(self):
config['cxx']['optz_fast'] = '-O2'
config['cxx']['optz_faster'] = '-O3'
config['cxx']['optz_fastest'] = config['cxx']['optz_faster']
config['cxx']['optz_fastest-possible'] = config['cxx']['optz_fastest'] # TODO: -march=native ?
config['cxx']['optz_fastest-possible'] = config['cxx']['optz_fastest']

#self.env.append_value('LINKFLAGS', '-fPIC -dynamiclib'.split())
self.env.append_value('LINKFLAGS', '-fPIC'.split())
Expand Down Expand Up @@ -907,10 +907,11 @@ def configureCompilerOptions(self):
# https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/x86-Options.html#x86-Options
# "Using -march=native enables all instruction subsets supported by the local machine ..."
config['cxx']['optz_faster'] = '-O3' # no -march=native
config['cxx']['optz_fastest'] = config['cxx']['optz_faster'] # TODO: add -march=native ?
# Haswell is from 2013 ... 10 years ago: https://en.wikipedia.org/wiki/Haswell_%28microarchitecture%29
config['cxx']['optz_fastest'] = [ config['cxx']['optz_faster'], '-march=haswell' ]
# This "should" be part of fastest, but that could cause unexpected floating point differences.
# The "fastest-possible" option is new; see comments above.
config['cxx']['optz_fastest-possible'] = [ config['cxx']['optz_fastest'], '-march=native' ]
config['cxx']['optz_fastest-possible'] = [ config['cxx']['optz_faster'], '-march=native' ] # -march=native instead of haswell

self.env.append_value('CXXFLAGS', '-fPIC'.split())
if not Options.options.enablecpp17:
Expand Down Expand Up @@ -956,10 +957,11 @@ def configureCompilerOptions(self):
# https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/x86-Options.html#x86-Options
# "Using -march=native enables all instruction subsets supported by the local machine ..."
config['cc']['optz_faster'] = '-O3' # no -march=native
config['cc']['optz_fastest'] = config['cc']['optz_faster'] # TODO: add -march=native ?
# Haswell is from 2013 ... 10 years ago: https://en.wikipedia.org/wiki/Haswell_%28microarchitecture%29
config['cc']['optz_fastest'] = [ config['cc']['optz_faster'], '-march=haswell' ]
# This "should" be part of fastest, but that could cause unexpected floating point differences.
# The "fastest-possible" option is new; see comments above.
config['cc']['optz_fastest-possible'] = [ config['cc']['optz_fastest'], '-march=native' ]
config['cc']['optz_fastest-possible'] = [ config['cc']['optz_faster'], '-march=native' ] # -march=native instead of haswell

self.env.append_value('CFLAGS', '-fPIC'.split())
# "gnu99" enables POSIX and BSD
Expand Down
3 changes: 2 additions & 1 deletion build/dumplibimpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def dumpLibImpl(context, raw):

# We need a source file here so it doesn't think it is headers only
topDir = context.top_dir
buildDir = os.path.dirname(os.path.realpath(__file__))
buildDir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'__pycache__')
modArgs['SOURCE_DIR'] = os.path.relpath(buildDir, topDir)
modArgs['SOURCE_EXT'] = 'pyc'
context.module(**modArgs)
Expand Down
Loading

0 comments on commit ea623b4

Please sign in to comment.