Skip to content

Commit 45f8c26

Browse files
authored
Merge pull request #104 from njoy/c++17
C++17
2 parents 9714a86 + b9bb1d8 commit 45f8c26

24 files changed

+343
-162
lines changed

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
[submodule "dependencies/ENDFtk"]
2020
path = dependencies/ENDFtk
2121
url = https://github.com/njoy/ENDFtk.git
22-
[submodule "dependencies/variant-adapter"]
23-
path = dependencies/variant-adapter
24-
url = https://github.com/njoy/variant-adapter.git
2522
[submodule "dependencies/lipservice"]
2623
path = dependencies/lipservice
2724
url = https://github.com/njoy/lipservice.git

.travis.yml

-12
This file was deleted.

.travis/signature.sh

-29
This file was deleted.

CMakeLists.txt

+60-16
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if( NOT ROOT_DIRECTORY )
1515
if ( NOT PYTHON_EXECUTABLE )
1616
find_package( PythonInterp 3.4 )
1717
if ( NOT PYTHONINTERP_FOUND )
18-
message( FATAL_ERROR "Python interpeter installation was not found." )
18+
message( FATAL_ERROR "Python interpreter installation was not found." )
1919
endif()
2020
endif()
2121
execute_process( COMMAND ${PYTHON_EXECUTABLE} "./metaconfigure/fetch_subprojects.py"
@@ -71,7 +71,7 @@ option( profile_generate "Enable binary instrumentation to generation execution
7171

7272
# additional optimizations
7373
option( link_time_optimization "Enable link time optimization in the RELEASE configuration" )
74-
option( profile_use "In the RELEASE configuration, leverage previously generated exeution profile to inform optimization decisions" )
74+
option( profile_use "In the RELEASE configuration, leverage previously generated execution profile to inform optimization decisions" )
7575
option( nonportable_optimization "Enable optimizations which compromise portability of resulting binary in the RELEASE configuration" )
7676

7777
# libraries and linking
@@ -93,7 +93,7 @@ if ( profile_generate )
9393
file( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/profiling" )
9494
endif()
9595

96-
set( njoy21_AppleClang_Darwin_common_flags "-stdlib=libc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++14" )
96+
set( njoy21_AppleClang_Darwin_common_flags "-stdlib=libc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
9797
set( njoy21_AppleClang_Darwin_DEBUG_flags "-O0" "-g" "-gdwarf-3" )
9898
set( njoy21_AppleClang_Darwin_RELEASE_flags "-O3" "-DNDEBUG" )
9999
set( njoy21_AppleClang_Darwin_strict_flags "-Werror" )
@@ -105,7 +105,7 @@ set( njoy21_AppleClang_Darwin_link_time_optimization_flags "-flto" )
105105
set( njoy21_AppleClang_Darwin_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
106106
set( njoy21_AppleClang_Darwin_nonportable_optimization_flags "-march=native" )
107107
set( njoy21_AppleClang_Darwin_static_flags "-static" )
108-
set( njoy21_GNU_Darwin_common_flags "-Wall" "-Wextra" "-Wpedantic" "-std=c++14" )
108+
set( njoy21_GNU_Darwin_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
109109
set( njoy21_GNU_Darwin_DEBUG_flags "-O0" "-g" "-gdwarf-3" "-fsignaling-nans" )
110110
set( njoy21_GNU_Darwin_RELEASE_flags "-O3" "-DNDEBUG" )
111111
set( njoy21_GNU_Darwin_strict_flags "-Werror" )
@@ -117,7 +117,7 @@ set( njoy21_GNU_Darwin_link_time_optimization_flags "-flto" )
117117
set( njoy21_GNU_Darwin_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
118118
set( njoy21_GNU_Darwin_nonportable_optimization_flags "-march=native" )
119119
set( njoy21_GNU_Darwin_static_flags "-static" )
120-
set( njoy21_GNU_Linux_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-Wno-maybe-uninitialized" "-std=c++14" )
120+
set( njoy21_GNU_Linux_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
121121
set( njoy21_GNU_Linux_DEBUG_flags "-O0" "-g" "-gdwarf-3" "-fsignaling-nans" )
122122
set( njoy21_GNU_Linux_RELEASE_flags "-O3" "-DNDEBUG" )
123123
set( njoy21_GNU_Linux_strict_flags "-Werror" )
@@ -129,7 +129,31 @@ set( njoy21_GNU_Linux_link_time_optimization_flags "-flto" )
129129
set( njoy21_GNU_Linux_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
130130
set( njoy21_GNU_Linux_nonportable_optimization_flags "-march=native" )
131131
set( njoy21_GNU_Linux_static_flags "-static" )
132-
set( njoy21_GNU_Windows_common_flags "-Wall" "-Wextra" "-Wpedantic" "-std=c++14" )
132+
set( njoy21_GNU_CYGWIN_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-std=gnu++17" )
133+
set( njoy21_GNU_CYGWIN_DEBUG_flags "-O0" "-g" "-gdwarf-3" "-fsignaling-nans" )
134+
set( njoy21_GNU_CYGWIN_RELEASE_flags "-O3" "-DNDEBUG" )
135+
set( njoy21_GNU_CYGWIN_strict_flags "-Werror" )
136+
set( njoy21_GNU_CYGWIN_coverage_flags "--coverage" )
137+
set( njoy21_GNU_CYGWIN_subproject_flags )
138+
set( njoy21_GNU_CYGWIN_base_project_flags )
139+
set( njoy21_GNU_CYGWIN_profile_generate_flags "-fprofile-generate='${CMAKE_BINARY_DIR}/profiling'" )
140+
set( njoy21_GNU_CYGWIN_link_time_optimization_flags "-flto" )
141+
set( njoy21_GNU_CYGWIN_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
142+
set( njoy21_GNU_CYGWIN_nonportable_optimization_flags "-march=native" )
143+
set( njoy21_GNU_CYGWIN_static_flags "-static" )
144+
set( njoy21_GNU_MinGW_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
145+
set( njoy21_GNU_MinGW_DEBUG_flags "-O0" "-g" "-gdwarf-3" "-fsignaling-nans" )
146+
set( njoy21_GNU_MinGW_RELEASE_flags "-O3" "-DNDEBUG" )
147+
set( njoy21_GNU_MinGW_strict_flags "-Werror" )
148+
set( njoy21_GNU_MinGW_coverage_flags "--coverage" )
149+
set( njoy21_GNU_MinGW_subproject_flags )
150+
set( njoy21_GNU_MinGW_base_project_flags )
151+
set( njoy21_GNU_MinGW_profile_generate_flags "-fprofile-generate='${CMAKE_BINARY_DIR}/profiling'" )
152+
set( njoy21_GNU_MinGW_link_time_optimization_flags "-flto" )
153+
set( njoy21_GNU_MinGW_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
154+
set( njoy21_GNU_MinGW_nonportable_optimization_flags "-march=native" )
155+
set( njoy21_GNU_MinGW_static_flags "-static" )
156+
set( njoy21_GNU_Windows_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
133157
set( njoy21_GNU_Windows_DEBUG_flags "-O0" "-g" "-gdwarf-3" "-fsignaling-nans" )
134158
set( njoy21_GNU_Windows_RELEASE_flags "-O3" "-DNDEBUG" )
135159
set( njoy21_GNU_Windows_strict_flags "-Werror" )
@@ -141,7 +165,7 @@ set( njoy21_GNU_Windows_link_time_optimization_flags "-flto" )
141165
set( njoy21_GNU_Windows_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
142166
set( njoy21_GNU_Windows_nonportable_optimization_flags "-march=native" )
143167
set( njoy21_GNU_Windows_static_flags "-static" )
144-
set( njoy21_Clang_Darwin_common_flags "-stdlib=libc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++14" )
168+
set( njoy21_Clang_Darwin_common_flags "-stdlib=libc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
145169
set( njoy21_Clang_Darwin_DEBUG_flags "-O0" "-g" "-gdwarf-3" )
146170
set( njoy21_Clang_Darwin_RELEASE_flags "-O3" "-DNDEBUG" )
147171
set( njoy21_Clang_Darwin_strict_flags "-Werror" )
@@ -153,7 +177,7 @@ set( njoy21_Clang_Darwin_link_time_optimization_flags "-flto" )
153177
set( njoy21_Clang_Darwin_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
154178
set( njoy21_Clang_Darwin_nonportable_optimization_flags "-march=native" )
155179
set( njoy21_Clang_Darwin_static_flags "-static" )
156-
set( njoy21_Clang_Linux_common_flags "-stdlib=libstdc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++14" )
180+
set( njoy21_Clang_Linux_common_flags "-stdlib=libstdc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
157181
set( njoy21_Clang_Linux_DEBUG_flags "-O0" "-g" "-gdwarf-3" )
158182
set( njoy21_Clang_Linux_RELEASE_flags "-O3" "-DNDEBUG" )
159183
set( njoy21_Clang_Linux_strict_flags "-Werror" )
@@ -165,7 +189,31 @@ set( njoy21_Clang_Linux_link_time_optimization_flags "-flto" )
165189
set( njoy21_Clang_Linux_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
166190
set( njoy21_Clang_Linux_nonportable_optimization_flags "-march=native" )
167191
set( njoy21_Clang_Linux_static_flags "-static" )
168-
set( njoy21_Clang_Windows_common_flags "-stdlib=libc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++14" )
192+
set( njoy21_Clang_CYGWIN_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-std=gnu++17" )
193+
set( njoy21_Clang_CYGWIN_DEBUG_flags "-O0" "-g" "-gdwarf-3" "-fsignaling-nans" )
194+
set( njoy21_Clang_CYGWIN_RELEASE_flags "-O3" "-DNDEBUG" )
195+
set( njoy21_Clang_CYGWIN_strict_flags "-Werror" )
196+
set( njoy21_Clang_CYGWIN_coverage_flags "--coverage" )
197+
set( njoy21_Clang_CYGWIN_subproject_flags )
198+
set( njoy21_Clang_CYGWIN_base_project_flags )
199+
set( njoy21_Clang_CYGWIN_profile_generate_flags "-fprofile-generate='${CMAKE_BINARY_DIR}/profiling'" )
200+
set( njoy21_Clang_CYGWIN_link_time_optimization_flags "-flto" )
201+
set( njoy21_Clang_CYGWIN_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
202+
set( njoy21_Clang_CYGWIN_nonportable_optimization_flags "-march=native" )
203+
set( njoy21_Clang_CYGWIN_static_flags "-static" )
204+
set( njoy21_Clang_MinGW_common_flags "-Wno-subobject-linkage" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
205+
set( njoy21_Clang_MinGW_DEBUG_flags "-O0" "-g" "-gdwarf-3" "-fsignaling-nans" )
206+
set( njoy21_Clang_MinGW_RELEASE_flags "-O3" "-DNDEBUG" )
207+
set( njoy21_Clang_MinGW_strict_flags "-Werror" )
208+
set( njoy21_Clang_MinGW_coverage_flags "--coverage" )
209+
set( njoy21_Clang_MinGW_subproject_flags )
210+
set( njoy21_Clang_MinGW_base_project_flags )
211+
set( njoy21_Clang_MinGW_profile_generate_flags "-fprofile-generate='${CMAKE_BINARY_DIR}/profiling'" )
212+
set( njoy21_Clang_MinGW_link_time_optimization_flags "-flto" )
213+
set( njoy21_Clang_MinGW_profile_use_flags "-fprofile-use='${CMAKE_BINARY_DIR}/profiling'" )
214+
set( njoy21_Clang_MinGW_nonportable_optimization_flags "-march=native" )
215+
set( njoy21_Clang_MinGW_static_flags "-static" )
216+
set( njoy21_Clang_Windows_common_flags "-stdlib=libc++" "-Wall" "-Wextra" "-Wpedantic" "-std=c++17" )
169217
set( njoy21_Clang_Windows_DEBUG_flags "-O0" "-g" "-gdwarf-3" )
170218
set( njoy21_Clang_Windows_RELEASE_flags "-O3" "-DNDEBUG" )
171219
set( njoy21_Clang_Windows_strict_flags "-Werror" )
@@ -227,10 +275,6 @@ if( NOT TARGET header-utilities )
227275
add_subdirectory( ${ROOT_DIRECTORY}/subprojects/header-utilities )
228276
endif()
229277

230-
if( NOT TARGET variant-adapter )
231-
add_subdirectory( ${ROOT_DIRECTORY}/subprojects/variant-adapter )
232-
endif()
233-
234278
if( NOT TARGET ENDFtk )
235279
add_subdirectory( ${ROOT_DIRECTORY}/subprojects/ENDFtk )
236280
endif()
@@ -323,7 +367,7 @@ add_library( njoy21 ${njoy21_library_linkage}
323367
"${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp"
324368
"${CMAKE_CURRENT_BINARY_DIR}/src/njoy21/Signature.hpp" )
325369

326-
target_include_directories( njoy21 PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/src src )
370+
target_include_directories( njoy21 PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/src src/ )
327371

328372
set( PREFIX njoy21_${CMAKE_CXX_COMPILER_ID}_${CMAKE_SYSTEM_NAME} )
329373

@@ -346,7 +390,7 @@ ${CXX_appended_flags} ${njoy21_appended_flags} )
346390

347391
target_link_libraries( njoy21 PUBLIC "$<$<AND:$<CONFIG:RELEASE>,$<BOOL:${link_time_optimization}>>:${${PREFIX}_RELEASE_flags};${${PREFIX}_link_time_optimization_flags}$<$<BOOL:${profile_generate}>:${${PREFIX}_profile_generate_flags};>$<$<BOOL:${profile_use}>:${${PREFIX}_profile_use_flags};>$<$<BOOL:${nonportable_optimization}>:${${PREFIX}_nonportable_optimization_flags};>>$<$<CONFIG:DEBUG>:$<$<BOOL:${coverage}>:${${PREFIX}_coverage_flags};>>$<$<BOOL:CXX_appended_flags>:${CXX_appended_flags};>$<$<BOOL:njoy21_appended_flags>:${njoy21_appended_flags};>" )
348392

349-
target_link_libraries( njoy21 PUBLIC ENDFtk PUBLIC tclap-adapter PUBLIC njoy_c_bindings PUBLIC variant-adapter PUBLIC lipservice PUBLIC dimwits PUBLIC utility )
393+
target_link_libraries( njoy21 PUBLIC ENDFtk PUBLIC tclap-adapter PUBLIC njoy_c_bindings PUBLIC lipservice PUBLIC dimwits PUBLIC utility )
350394

351395
if ( NOT is_subproject )
352396
add_executable( njoy21_executable src/main.cpp )
@@ -400,7 +444,7 @@ install( FILES "${CMAKE_BINARY_DIR}/signature.json"
400444
GROUP_READ
401445
WORLD_READ
402446
)
403-
install( DIRECTORY src/ DESTINATION include
447+
install( DIRECTORY src// DESTINATION include
404448
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
405449
GROUP_READ
406450
WORLD_READ

buildspec.yml

-22
This file was deleted.

dependencies/ENDFtk

Submodule ENDFtk updated 61 files

dependencies/variant-adapter

-1
This file was deleted.

metaconfigure/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Additionally, redistribution and use in source and binary forms, with or without
77
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
88
3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
99

10-
THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10+
THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

metaconfigure/cmake.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def fetch_subprojects(state):
3232
if ( NOT PYTHON_EXECUTABLE )
3333
find_package( PythonInterp 3.4 )
3434
if ( NOT PYTHONINTERP_FOUND )
35-
message( FATAL_ERROR "Python interpeter installation was not found." )
35+
message( FATAL_ERROR "Python interpreter installation was not found." )
3636
endif()
3737
endif()
3838
execute_process( COMMAND ${PYTHON_EXECUTABLE} "./metaconfigure/fetch_subprojects.py"
@@ -172,7 +172,7 @@ def define_options(state):
172172
173173
# additional optimizations
174174
option( link_time_optimization "Enable link time optimization in the RELEASE configuration" )
175-
option( profile_use "In the RELEASE configuration, leverage previously generated exeution profile to inform optimization decisions" )
175+
option( profile_use "In the RELEASE configuration, leverage previously generated execution profile to inform optimization decisions" )
176176
option( nonportable_optimization "Enable optimizations which compromise portability of resulting binary in the RELEASE configuration" )
177177
178178
# libraries and linking

metaconfigure/collect_subprojects.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def traverse_dependencies( destination, traversed ):
2525
"""
2626
if not os.path.isdir( dependency_directory() ):
2727
return
28-
28+
2929
os.chdir( dependency_directory() )
3030

3131
for dependency in os.listdir( os.getcwd() ) :
@@ -48,14 +48,14 @@ def traverse_dependencies( destination, traversed ):
4848

4949
traverse_dependencies( destination, traversed )
5050
os.chdir( ".." )
51-
51+
5252
os.chdir( os.path.join( ".." ) )
5353

5454
def collect_subprojects():
5555
destination = os.path.join( os.getcwd(), "subprojects" )
5656
if not os.path.isdir( destination ):
5757
os.makedirs( destination )
58-
58+
5959
traverse_dependencies( destination, set() )
6060

6161
collect_subprojects()

0 commit comments

Comments
 (0)