Skip to content

Commit 0d031c8

Browse files
authored
Merge pull request #192 from njoy/develop
ENDFtk v1.0.0
2 parents cee0f66 + 32f392f commit 0d031c8

File tree

882 files changed

+14802
-17252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

882 files changed

+14802
-17252
lines changed

CMakeLists.txt

+42-25
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
########################################################################
22
# Preamble
33
########################################################################
4+
45
cmake_minimum_required( VERSION 3.14 )
5-
project( ENDFtk LANGUAGES CXX )
6+
7+
set( subproject OFF )
8+
if( DEFINED PROJECT_NAME )
9+
set( subproject ON )
10+
endif()
11+
12+
project( ENDFtk
13+
VERSION 1.0.0
14+
LANGUAGES CXX
15+
)
16+
17+
include( CTest )
18+
include( CMakeDependentOption )
19+
include( GNUInstallDirs )
620

721
########################################################################
822
# Project-wide setup
@@ -11,18 +25,16 @@ project( ENDFtk LANGUAGES CXX )
1125
set( CMAKE_CXX_STANDARD 17 )
1226
set( CMAKE_CXX_STANDARD_REQUIRED YES )
1327

14-
option( ENDFtk.tests "Build the ENDFtk unit tests" OFF )
15-
option( ENDFtk.python "Build ENDFtk python bindings" ON )
16-
option( strict_compile
17-
"Treat all warnings as errors." ON
18-
)
19-
20-
# Compile flags
21-
set( common_flags "-Wall" "-Wextra" "-Wpedantic" )
22-
set( strict_flags "-Werror" )
23-
set( release_flags "-O3" )
24-
set( debug_flags "-O0" "-g" )
25-
28+
cmake_dependent_option(
29+
ENDFtk.tests
30+
"Build the ENDFtk unit tests and integrate with ctest" ON
31+
"BUILD_TESTING AND NOT ${subproject}" OFF
32+
)
33+
cmake_dependent_option(
34+
ENDFtk.python
35+
"Build ENDFtk python bindings" ON
36+
"NOT ${subproject}" OFF
37+
)
2638

2739
########################################################################
2840
# Dependencies
@@ -55,23 +67,28 @@ endif()
5567
# ENDFtk : library
5668
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5769

58-
include_directories( src/ )
59-
6070
add_library( ENDFtk INTERFACE )
61-
target_include_directories( ENDFtk INTERFACE src/ )
71+
add_library( njoy::ENDFtk ALIAS ENDFtk )
72+
target_include_directories( ENDFtk
73+
INTERFACE
74+
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>
75+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
76+
)
6277
target_link_libraries( ENDFtk
63-
INTERFACE Log
64-
INTERFACE catch-adapter
65-
INTERFACE disco
66-
INTERFACE header-utilities
67-
INTERFACE range-v3
68-
)
78+
INTERFACE
79+
njoy::tools
80+
disco
81+
range-v3
82+
)
6983

7084
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7185
# ENDFtk : python bindings
7286
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7387

7488
if( ENDFtk.python )
89+
90+
FetchContent_MakeAvailable( pybind11 )
91+
7592
pybind11_add_module( ENDFtk.python
7693
${CMAKE_CURRENT_SOURCE_DIR}/python/src/ENDFtk.python.cpp
7794
${CMAKE_CURRENT_SOURCE_DIR}/python/src/record/ControlRecord.python.cpp
@@ -309,14 +326,14 @@ if( ENDFtk.python )
309326

310327
target_link_libraries( ENDFtk.python PRIVATE ENDFtk )
311328
target_include_directories( ENDFtk.python PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/python/src )
312-
target_compile_options( ENDFtk.python PRIVATE "-fvisibility=hidden" )
329+
target_compile_options( ENDFtk.python PRIVATE -fvisibility=hidden )
313330
set_target_properties( ENDFtk.python PROPERTIES OUTPUT_NAME ENDFtk )
314331
set_target_properties( ENDFtk.python PROPERTIES COMPILE_DEFINITIONS "PYBIND11" )
315-
set_target_properties( ENDFtk.python PROPERTIES POSITION_INDEPENDENT_CODE ON)
332+
set_target_properties( ENDFtk.python PROPERTIES POSITION_INDEPENDENT_CODE ON )
316333

317334
message( STATUS "Building ENDFtk's python API" )
318335

319-
list( APPEND ENDFTK_PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR} )
336+
list( APPEND ENDFtk_PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR} )
320337

321338
include( cmake/unit_testing_python.cmake )
322339

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ When running python in the build directory directly, none of these steps are req
3232

3333
#### Troubleshooting ####
3434

35+
##### c++: Permission denied #####
36+
37+
On MacOS, an error may occur when using `make -j8` telling the user that there is no permission to execute the compiler (the error message will contain the full path to the compiler executable). This error is related to an issue with the MacOS system default make installation not allowing parallel compilation (the `-j8` part of the make command). Executing `make` without a parallel option will function, but the user should consider installing a different version of make (e.g. using homebrew) to get around this.
38+
3539
##### CMake doesn’t detect the right Python version #####
3640

3741
Taken from the pybind11 FAQ.

cmake/develop_dependencies.cmake

+8-17
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ include( FetchContent )
55
# Declare project dependencies
66
#######################################################################
77

8-
FetchContent_Declare( Log
9-
GIT_REPOSITORY https://github.com/njoy/Log
10-
GIT_TAG origin/master
8+
FetchContent_Declare( tools
9+
GIT_REPOSITORY https://github.com/njoy/tools
10+
GIT_TAG v0.2.0
1111
GIT_SHALLOW TRUE
1212
)
1313

14-
FetchContent_Declare( catch-adapter
15-
GIT_REPOSITORY https://github.com/njoy/catch-adapter
16-
GIT_TAG origin/master
14+
FetchContent_Declare( Catch2
15+
GIT_REPOSITORY https://github.com/catchorg/Catch2
16+
GIT_TAG v3.3.2
1717
GIT_SHALLOW TRUE
1818
)
1919

@@ -23,31 +23,22 @@ FetchContent_Declare( disco
2323
GIT_SHALLOW TRUE
2424
)
2525

26-
FetchContent_Declare( header-utilities
27-
GIT_REPOSITORY https://github.com/njoy/header-utilities
28-
GIT_TAG origin/master
29-
GIT_SHALLOW TRUE
30-
)
31-
3226
FetchContent_Declare( range-v3
3327
GIT_REPOSITORY https://github.com/ericniebler/range-v3
3428
GIT_TAG 0.11.0
3529
)
3630

3731
FetchContent_Declare( pybind11
3832
GIT_REPOSITORY https://github.com/pybind/pybind11
39-
GIT_TAG v2.10.1
33+
GIT_TAG v2.10.4
4034
)
4135

4236
#######################################################################
4337
# Load dependencies
4438
#######################################################################
4539

4640
FetchContent_MakeAvailable(
47-
Log
48-
catch-adapter
41+
tools
4942
disco
50-
header-utilities
5143
range-v3
52-
pybind11
5344
)

cmake/release_dependencies.cmake

+14-17
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,19 @@ FetchContent_Declare( catch-adapter
1010
GIT_TAG fb84b82ebf7a4789aa43cea560680cf745c6ee4f
1111
)
1212

13+
FetchContent_Declare( Catch2
14+
GIT_REPOSITORY https://github.com/catchorg/Catch2
15+
GIT_TAG 3f0283de7a9c43200033da996ff9093be3ac84dc # tag: v3.3.2
16+
)
17+
1318
FetchContent_Declare( disco
1419
GIT_REPOSITORY https://github.com/njoy/disco
1520
GIT_TAG 2606933a854bb0269c4ec37143e1236797e27838
1621
)
1722

18-
FetchContent_Declare( header-utilities
19-
GIT_REPOSITORY https://github.com/njoy/header-utilities
20-
GIT_TAG cc2610fee15e255c151e8e22aca1e8b3d1a96b39
21-
)
22-
23-
FetchContent_Declare( Log
24-
GIT_REPOSITORY https://github.com/njoy/Log
25-
GIT_TAG 52962b7796afe37ef1d8f7edb4bf9ecb1b868d15
26-
)
27-
2823
FetchContent_Declare( pybind11
2924
GIT_REPOSITORY https://github.com/pybind/pybind11
30-
GIT_TAG 80dc998efced8ceb2be59756668a7e90e8bef917 # tag: v2.10.1
25+
GIT_TAG 5b0a6fc2017fcc176545afe3e09c9f9885283242 # tag: v2.10.4
3126
)
3227

3328
FetchContent_Declare( range-v3
@@ -37,20 +32,22 @@ FetchContent_Declare( range-v3
3732

3833
FetchContent_Declare( spdlog
3934
GIT_REPOSITORY https://github.com/gabime/spdlog
40-
GIT_TAG a51b4856377a71f81b6d74b9af459305c4c644f8
35+
GIT_TAG ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36 # tag: v1.11.0
36+
)
37+
set( SPDLOG_BUILD_PIC CACHE INTERNAL BOOL ON )
38+
39+
FetchContent_Declare( tools
40+
GIT_REPOSITORY https://github.com/njoy/tools
41+
GIT_TAG 25c9273d05601a9644feea6d7539250bf1d1c0dc # tag: v0.2.0
4142
)
42-
set( SPDLOG_BUILD_TESTING CACHE BOOL OFF )
4343

4444
#######################################################################
4545
# Load dependencies
4646
#######################################################################
4747

4848
FetchContent_MakeAvailable(
49-
catch-adapter
5049
disco
51-
header-utilities
52-
Log
53-
pybind11
5450
range-v3
5551
spdlog
52+
tools
5653
)

0 commit comments

Comments
 (0)