Skip to content

Commit

Permalink
Squashed 'externals/nitro/' changes from eae92928f..8d36dde98
Browse files Browse the repository at this point in the history
8d36dde98 Merge commit 'd14472121c74122bc8a8f7f88cec227cb810a6f7' into cpp20
d14472121 Squashed 'externals/coda-oss/' changes from ae5bc9c247..c5769076ad
4c93a4f3b latest from CODA-OSS
7ae6af89a Merge branch 'cpp17' into cpp20
de569ecb5 Merge commit '099e7446fc4a49ead6b820332e823fb2da2cf90b' into cpp20
099e7446f Squashed 'externals/coda-oss/' changes from b4aa8b9218..80ba3dd251
ea785ac17 latest from CODA-OSS
1e71d53b8 Merge branch 'cpp17' into cpp20
f4e1b28e0 Merge branch 'cpp17' into cpp20
ae39b5dd5 Merge commit 'a81fd2ba33231ba78cc7c78e4138a9bb4bc5d85f' into cpp20
a81fd2ba3 Squashed 'externals/coda-oss/' changes from a956f999fe..893d30c9e6
778429f81 latest from CODA-OSS
c07b6c18c Merge branch 'cpp17' into cpp20
b76738a86 Merge commit '97eb985bc9d367e385dbacc6ea092ee834a98a3a' into cpp20
97eb985bc Squashed 'externals/coda-oss/' changes from 5f1e5d353..810befe2d
a1fe4ce4d Merge branch 'cpp17' into cpp20
93924176a Merge commit 'df247a7a9c1033496c064c6b21492f95acc282ad' into cpp20
df247a7a9 Squashed 'externals/coda-oss/' changes from 710754a00..a357c55b9
64e5ec916 Merge branch 'cpp17' into cpp20
0dbcd9d31 restore C++20
e6ec2ea22 merge cpp17
3686b2244 latest from CODA-OSS
a5f79ea96 merge cpp17
f8f12052e Merge branch 'cpp17' into cpp20
5167a8577 Merge commit '107a4cb28d533fa312ea5ceade080978e3c16d8a' into cpp20
107a4cb28 Squashed 'externals/coda-oss/' changes from ddf69c0d54..78e40ace3d
15f59c918 latest from CODA-OSS
7b52ace13 restore C++20
a4c8ce982 Merge branch 'cpp17' into cpp20
d867f5945 restore C++20
e5b77506d use standard CPP
f35253867 Merge commit '2db63af9be4587d5aeb705f7533307825568f9b9' into cpp20
2db63af9b Squashed 'externals/coda-oss/' changes from b3a55d3ed8..d89913d552
fa77157f3 Merge commit 'cffd90c16ff4e2cfdae89e9deee68b3b17b7e8a4' into cpp20
cffd90c16 Squashed 'externals/coda-oss/' changes from 1fe2b7d0dc..b3a55d3ed8
bbcb95f0f latest from CODA-OSS
8275886e0 Merge branch 'cpp17' into cpp20
904392c96 Merge branch 'cpp17' into cpp20
1a539a7b7 Merge commit '4c2eb3242a97bfa4fb9889d7f374eb55b418654d' into cpp20
4c2eb3242 Squashed 'externals/coda-oss/' changes from c9fbbbf6c5..9840e6906c
8ba67a913 latest from CODA-OSS
2f0db85c2 Merge branch 'cpp17' into cpp20
7fd1bb0d9 Merge commit '1834c535bde27a4a0cc77821eaddd76172a0bbdc' into cpp20
1834c535b Squashed 'externals/coda-oss/' changes from cfc5f99f26..11e472854e
342b2260c Merge branch 'cpp17' into cpp20
e9905ffbe Merge commit '5268c9e32a558ca693cb83d34103abe8e9486c57' into cpp20
5268c9e32 Squashed 'externals/coda-oss/' changes from c9b93bd5a1..e71539d27d
3dd56c174 latest from CODA-OSS
bdedb86c9 Merge branch 'cpp17' into cpp20
b4ac1ee10 fix build error
a6d9d002f build with C++20
38b4a673b ToString() specialization already defined
e3f8ae709 Merge commit 'b087bb776d7eff263baeb5f196dde216e33c6aca' into cpp20
b087bb776 Squashed 'externals/coda-oss/' changes from 47c8051958..679725800b
d938973d5 latest from CODA-OSS
79fbd2ec8 copy from cpp20
87752f2e3 Merge branch 'cpp17' into cpp20
777f35b72 only --std=c++20
839434124 Merge commit 'f161cda5539c508cbd83c23b210361483c610898' into cpp20
f161cda55 Squashed 'externals/coda-oss/' changes from b8d501278..21fd7c4c0
d18109903 copy from cpp20
c78fd72e3 Merge branch 'cpp17' into cpp20
bc0e54cc2 Merge commit '2e63b9199e3715707d5421101589776445e13084' into cpp20
2e63b9199 Squashed 'externals/coda-oss/' changes from c800b56478..905bed5f16
4959f54ed latest from coda-oss
8a8b27af4 sync with cpp20
25f560b26 Merge branch 'cpp17' into cpp20
63a694e4e turning "main" into C++14, not C++20

git-subtree-dir: externals/nitro
git-subtree-split: 8d36dde987ae331da4efaa8af2e6f20c517f429f
  • Loading branch information
Dan Smith authored and Dan Smith committed Aug 3, 2023
1 parent f6baf9d commit 6477431
Show file tree
Hide file tree
Showing 47 changed files with 182 additions and 705 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.14)
project(nitro)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 99)
set(C_STANDARD_REQUIRED true)
set(CMAKE_CXX_STANDARD 20)
set(CXX_STANDARD_REQUIRED true)

if (${CMAKE_PROJECT_NAME} STREQUAL nitro)
Expand Down
8 changes: 4 additions & 4 deletions UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<UseStandardPreprocessor>true</UseStandardPreprocessor>
</ClCompile>
<Link>
Expand All @@ -93,8 +93,8 @@
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<UseStandardPreprocessor>true</UseStandardPreprocessor>
</ClCompile>
<Link>
Expand Down
2 changes: 1 addition & 1 deletion copy_externals.csh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/csh -f

rm -r -f tmp && mkdir tmp && cd tmp
git clone --depth 1 -b cpp17 [email protected]:mdaus/coda-oss.git
git clone --depth 1 -b cpp20 [email protected]:mdaus/coda-oss.git
rm -r -f coda-oss/.git

cd ..
Expand Down
14 changes: 6 additions & 8 deletions externals/coda-oss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
cmake_minimum_required(VERSION 3.14)
project(coda-oss)

set(CMAKE_CXX_STANDARD 17)
project(coda-oss)

set(CMAKE_CXX_STANDARD 20)
set(CXX_STANDARD_REQUIRED true)

if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
Expand All @@ -22,13 +24,9 @@ if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
# Always turn on "warnings as errors" to avoid lots of (meaningless?) build output;
# we'll dial-back warnings as necessary.
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()
# set warning level to /W3
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
elseif (UNIX)
add_compile_options(-Werror) # warnings as errors

Expand Down
8 changes: 4 additions & 4 deletions externals/coda-oss/UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
Expand All @@ -99,8 +99,8 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
52 changes: 28 additions & 24 deletions externals/coda-oss/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ def options(opt):
'results. NOOP if junit_xml cannot be imported')


def ensureCpp17Support(self):
def ensureCpp20Support(self):
# DEPRECATED.
# Keeping for now in case downstream code is still looking for it
self.env['cpp11support'] = True
Expand All @@ -830,6 +830,14 @@ def configureCompilerOptions(self):

if ccCompiler == 'msvc':
cxxCompiler = ccCompiler
else:
if ccCompiler == 'gcc':
ccCompiler = 'gcc-10'
self.env['COMPILER_CC'] =ccCompiler

if cxxCompiler == 'g++':
cxxCompiler = 'g++-10'
self.env['COMPILER_CXX'] = cxxCompiler

if not cxxCompiler or not ccCompiler:
self.fatal('Unable to find C/C++ compiler')
Expand Down Expand Up @@ -873,7 +881,7 @@ def configureCompilerOptions(self):
self.env.append_value('CFLAGS', '-fPIC -dynamiclib'.split())

# GCC / ICC (for Linux or Solaris)
elif ccCompiler == 'gcc' or ccCompiler == 'icc':
elif ccCompiler == 'gcc' or ccCompiler == 'gcc-10' or ccCompiler == 'icc':
if not re.match(winRegex, sys_platform):
self.env.append_value('LIB_DL', 'dl')
if not re.match(osxRegex, sys_platform):
Expand All @@ -883,7 +891,7 @@ def configureCompilerOptions(self):
self.check_cc(lib='pthread', mandatory=True)

warningFlags = '-Wall'
if ccCompiler == 'gcc':
if ccCompiler == 'gcc' or ccCompiler == 'gcc-10':
#warningFlags += ' -Wno-deprecated-declarations -Wold-style-cast'
warningFlags += ' -Wno-deprecated-declarations'
else:
Expand All @@ -897,7 +905,13 @@ def configureCompilerOptions(self):
# If you want the plugins to not depend on Intel libraries,
# configure with:
# --with-cflags=-static-intel --with-cxxflags=-static-intel --with-linkflags=-static-intel
if cxxCompiler == 'g++' or cxxCompiler == 'icpc':
if cxxCompiler == 'gcc' or cxxCompiler == 'gcc-10':
config['cxx']['debug'] = '-ggdb3'
config['cxx']['optz_debug'] = '-Og'
elif cxxCompiler == 'icpc':
config['cxx']['debug'] = '-g'
config['cxx']['optz_debug'] = ''
if cxxCompiler == 'g++' or cxxCompiler == 'g++-10' or cxxCompiler == 'icpc':
config['cxx']['warn'] = warningFlags.split()
config['cxx']['verbose'] = '-v'
config['cxx']['64'] = '-m64'
Expand All @@ -913,8 +927,7 @@ def configureCompilerOptions(self):
# The "fastest-possible" option is new; see comments above.
config['cxx']['optz_fastest-possible'] = [ config['cxx']['optz_faster'], '-march=native' ] # -march=native instead of haswell

self.env.append_value('CXXFLAGS', '-fPIC'.split())
gxxCompileFlags='-std=c++17'
gxxCompileFlags='-fPIC -std=c++2a'
self.env.append_value('CXXFLAGS', gxxCompileFlags.split())

# DEFINES and LINKFLAGS will apply to both gcc and g++
Expand All @@ -929,22 +942,13 @@ def configureCompilerOptions(self):

self.env.append_value('LINKFLAGS', linkFlags.split())

if Options.options.debugging:
if cxxCompiler == 'g++':
config['cxx']['debug'] = '-ggdb3'
config['cxx']['optz_debug'] = '-Og'
elif cxxCompiler == 'icpc':
config['cxx']['debug'] = '-g'
config['cxx']['optz_debug'] = ''

if ccCompiler == 'gcc':
config['cc']['debug'] = '-ggdb3'
config['cc']['optz_debug'] = '-Og'
elif ccCompiler == 'icc':
config['cc']['debug'] = '-g'
config['cc']['optz_debug'] = ''

if ccCompiler == 'gcc' or ccCompiler == 'icc':
if ccCompiler == 'gcc' or ccCompiler == 'gcc-10':
config['cc']['debug'] = '-ggdb3'
config['cc']['optz_debug'] = '-Og'
elif ccCompiler == 'icc':
config['cc']['debug'] = '-g'
config['cc']['optz_debug'] = ''
if ccCompiler == 'gcc' or ccCompiler == 'gcc-10' or ccCompiler == 'icc':
config['cc']['warn'] = warningFlags.split()
config['cc']['verbose'] = '-v'
config['cc']['64'] = '-m64'
Expand Down Expand Up @@ -1024,7 +1028,7 @@ def configureCompilerOptions(self):
'_LARGEFILE_SOURCE WIN32 _USE_MATH_DEFINES NOMINMAX WIN32_LEAN_AND_MEAN'.split()
flags = '/UUNICODE /U_UNICODE /EHs /GR'.split()

flags.append('/std:c++17')
flags.append('/std:c++20')

self.env.append_value('DEFINES', defines)
self.env.append_value('CXXFLAGS', flags)
Expand Down Expand Up @@ -1245,7 +1249,7 @@ def configure(self):
if Options.options._defs:
env.append_unique('DEFINES', Options.options._defs.split(','))
configureCompilerOptions(self)
ensureCpp17Support(self)
ensureCpp20Support(self)

env['PLATFORM'] = sys_platform

Expand Down
2 changes: 1 addition & 1 deletion externals/coda-oss/build/config.guess
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
for c in gcc-10 gcc c99 c89 cc; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
Expand Down
9 changes: 4 additions & 5 deletions externals/coda-oss/modules/c++/coda-oss.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<ClInclude Include="coda_oss\include\coda_oss\optional.h" />
<ClInclude Include="coda_oss\include\coda_oss\optional_.h" />
<ClInclude Include="coda_oss\include\coda_oss\span.h" />
<ClInclude Include="coda_oss\include\coda_oss\span_.h" />
<ClInclude Include="coda_oss\include\coda_oss\string.h" />
<ClInclude Include="coda_oss\include\coda_oss\type_traits.h" />
<ClInclude Include="config\include\config\compiler_extensions.h" />
Expand Down Expand Up @@ -594,8 +593,8 @@
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<UseStandardPreprocessor>true</UseStandardPreprocessor>
</ClCompile>
<Link>
Expand Down Expand Up @@ -624,8 +623,8 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<UseStandardPreprocessor>true</UseStandardPreprocessor>
</ClCompile>
<Link>
Expand Down
3 changes: 0 additions & 3 deletions externals/coda-oss/modules/c++/coda-oss.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
<ClInclude Include="coda_oss\include\coda_oss\span.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\span_.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\string.h">
<Filter>coda_oss</Filter>
</ClInclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
#define CODA_OSS_cpp20 (CODA_OSS_cplusplus >= CODA_OSS_cplusplus20)
#define CODA_OSS_cpp23 (CODA_OSS_cplusplus >= CODA_OSS_cplusplus23)

#if !CODA_OSS_cpp17
#error "Must compile with C++17 or greater."
#if !CODA_OSS_cpp20
#error "Must compile with C++20 or greater."
#endif

// Get feature-testing macros: https://en.cppreference.com/w/cpp/feature_test
Expand Down
16 changes: 3 additions & 13 deletions externals/coda-oss/modules/c++/coda_oss/include/coda_oss/bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,14 @@
#include <byteswap.h> // "These functions are GNU extensions."
#endif

#include<bit>
#include <type_traits>

#include "coda_oss/namespace_.h"
namespace coda_oss
{
// https://en.cppreference.com/w/cpp/types/endian
enum class endian
{
#ifdef _WIN32
little = 0,
big = 1,
native = little
#else
little = __ORDER_LITTLE_ENDIAN__,
big = __ORDER_BIG_ENDIAN__,
native = __BYTE_ORDER__
#endif
};
using std::endian;


// https://en.cppreference.com/w/cpp/numeric/byteswap
namespace details
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace coda_oss
{
using byte = std::byte;
using std::byte;
}

#endif // CODA_OSS_coda_oss_cstddef_h_INCLUDED_
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* License along with this program; If not, http://www.gnu.org/licenses/.
*
*/
#pragma once
#ifndef CODA_OSS_coda_oss_namespace__h_INCLUDED_
#define CODA_OSS_coda_oss_namespace__h_INCLUDED_
#pragma once

namespace coda_oss
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,12 @@
#ifndef CODA_OSS_coda_oss_optional_h_INCLUDED_
#define CODA_OSS_coda_oss_optional_h_INCLUDED_

#include "coda_oss/CPlusPlus.h"

// This logic needs to be here rather than <std/optional> so that `coda_oss::optional` will
// be the same as `std::optional`.
#ifndef CODA_OSS_HAVE_std_optional_
#define CODA_OSS_HAVE_std_optional_ 0 // assume no <optional>
#endif
#if CODA_OSS_cpp17 // C++17 for `__has_include()`
#if __has_include(<optional>) // __cpp_lib_optional not until C++20
#include <optional>
#undef CODA_OSS_HAVE_std_optional_
#define CODA_OSS_HAVE_std_optional_ 1 // provided by the implementation, probably C++17
#endif
#endif // CODA_OSS_cpp17

#if !CODA_OSS_HAVE_std_optional_
#include "coda_oss/optional_.h"
#endif
#include <optional>

namespace coda_oss
{
#if CODA_OSS_HAVE_std_optional_
using std::optional;
using std::make_optional;
#else
using details::optional;
using details::make_optional;
#endif
using std::optional;
using std::make_optional;
}

#endif // CODA_OSS_coda_oss_optional_h_INCLUDED_
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef CODA_OSS_coda_oss_span__h_INCLUDED_
#define CODA_OSS_coda_oss_span__h_INCLUDED_
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* License along with this program; If not, http://www.gnu.org/licenses/.
*
*/
#pragma once
#ifndef CODA_OSS_coda_oss_type_traits_h_INCLUDED_
#define CODA_OSS_coda_oss_type_traits_h_INCLUDED_
#pragma once

#include <type_traits>

Expand Down
1 change: 1 addition & 0 deletions externals/coda-oss/modules/c++/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ CODA_OSS_disable_warning_pop
#pragma warning(disable: 26458) // Prefer to use gsl::at() instead of unchecked subscript operator (bounds.4).
#pragma warning(disable: 26482) // Only index into arrays using constant expressions (bounds.2).
#pragma warning(disable: 26481) // Don't use pointer arithmetic. Use span instead (bounds.1).
#pragma warning(disable: 26821) // For '...', consider using gsl::span instead of std::span to guarantee runtime bounds safety (gsl.view).

// Yes, these are our files ... but they don't change very often, and if they do
// change we want to rebuild everything anyway.
Expand Down
Loading

0 comments on commit 6477431

Please sign in to comment.