Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix/rpi-compilation-issue' into …
Browse files Browse the repository at this point in the history
…feature/python-extension
  • Loading branch information
whaeck committed Mar 13, 2024
2 parents 800c5d9 + 590baca commit b03de18
Show file tree
Hide file tree
Showing 885 changed files with 14,847 additions and 17,273 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ContinuousIntegration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
which ${{matrix.cxx}}
${{matrix.cxx}} --version
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: mkdir bin
run: mkdir bin
- name: cmake
Expand Down
67 changes: 42 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
########################################################################
# Preamble
########################################################################

cmake_minimum_required( VERSION 3.14 )
project( ENDFtk LANGUAGES CXX )

set( subproject OFF )
if( DEFINED PROJECT_NAME )
set( subproject ON )
endif()

project( ENDFtk
VERSION 1.0.1
LANGUAGES CXX
)

include( CTest )
include( CMakeDependentOption )
include( GNUInstallDirs )

########################################################################
# Project-wide setup
Expand All @@ -11,18 +25,16 @@ project( ENDFtk LANGUAGES CXX )
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED YES )

option( ENDFtk.tests "Build the ENDFtk unit tests" OFF )
option( ENDFtk.python "Build ENDFtk python bindings" ON )
option( strict_compile
"Treat all warnings as errors." ON
)

# Compile flags
set( common_flags "-Wall" "-Wextra" "-Wpedantic" )
set( strict_flags "-Werror" )
set( release_flags "-O3" )
set( debug_flags "-O0" "-g" )

cmake_dependent_option(
ENDFtk.tests
"Build the ENDFtk unit tests and integrate with ctest" ON
"BUILD_TESTING AND NOT ${subproject}" OFF
)
cmake_dependent_option(
ENDFtk.python
"Build ENDFtk python bindings" ON
"NOT ${subproject}" OFF
)

########################################################################
# Dependencies
Expand Down Expand Up @@ -55,23 +67,28 @@ endif()
# ENDFtk : library
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

include_directories( src/ )

add_library( ENDFtk INTERFACE )
target_include_directories( ENDFtk INTERFACE src/ )
add_library( njoy::ENDFtk ALIAS ENDFtk )
target_include_directories( ENDFtk
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries( ENDFtk
INTERFACE Log
INTERFACE catch-adapter
INTERFACE disco
INTERFACE header-utilities
INTERFACE range-v3
)
INTERFACE
njoy::tools
disco
range-v3
)

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ENDFtk : python bindings
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

if( ENDFtk.python )

FetchContent_MakeAvailable( pybind11 )

pybind11_add_module( ENDFtk.python
${CMAKE_CURRENT_SOURCE_DIR}/python/src/ENDFtk.python.cpp
${CMAKE_CURRENT_SOURCE_DIR}/python/src/record/ControlRecord.python.cpp
Expand Down Expand Up @@ -309,14 +326,14 @@ if( ENDFtk.python )

target_link_libraries( ENDFtk.python PRIVATE ENDFtk )
target_include_directories( ENDFtk.python PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/python/src )
target_compile_options( ENDFtk.python PRIVATE "-fvisibility=hidden" )
target_compile_options( ENDFtk.python PRIVATE -fvisibility=hidden )
set_target_properties( ENDFtk.python PROPERTIES OUTPUT_NAME ENDFtk )
set_target_properties( ENDFtk.python PROPERTIES COMPILE_DEFINITIONS "PYBIND11" )
set_target_properties( ENDFtk.python PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties( ENDFtk.python PROPERTIES POSITION_INDEPENDENT_CODE ON )

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

list( APPEND ENDFTK_PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR} )
list( APPEND ENDFtk_PYTHONPATH ${CMAKE_CURRENT_BINARY_DIR} )

include( cmake/unit_testing_python.cmake )

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# ENDFtk
Toolkit for reading and interacting with ENDF-6 formatted files. This toolkit provides a full C++ library along with python bindings.

## ENDFtk in python
## Release and development versions
For the latest version of ENDFtk and an overview of the latest changes, please see the [Release Notes](ReleaseNotes.md) or the [release](https://github.com/njoy/ENDFtk/releases) page.

The latest release version of ENDFtk can always be found at the head of the [main](https://github.com/njoy/ENDFtk) branch of this repository and every release is associated to a release tag. New versions are released on a regular basis (we aim to provide updates at least every three months). The latest development version of ENDFtk containing the latest updates and changes can be found in at the head of the [develop](https://github.com/njoy/ENDFtk/tree/develop) branch. This development version should be used with caution.

The python bindings for ENDFtk are still work in progress and should be used accordingly. Please report any issues encountered while using the python bindings using the issue tracker on this repository.
## ENDFtk in python

### Installing ENDFtk for python

Expand Down Expand Up @@ -34,6 +37,10 @@ When running python in the build directory directly, none of these steps are req

#### Troubleshooting ####

##### c++: Permission denied #####

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.

##### CMake doesn’t detect the right Python version #####

Taken from the pybind11 FAQ.
Expand Down
18 changes: 18 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Release Notes&mdash;ENDFtk
Given here are some release notes for ENDFtk.

## [ENDFtk v1.0.1](https://github.com/njoy/ENDFtk/pull/xxx)
This update does not add any additional functionality.

This update fixes the following issues:
- A compilation issue in a unit test that still used the old catch-adapter (see issue #193).

## [ENDFtk v1.0.0](https://github.com/njoy/ENDFtk/pull/192)
This release of ENDFtk has the following changes:
- All ZA values in the interface (the ZA value in the HEAD records, the ZAP values in the MF6 and MF26 reaction products, etc.) are now changed to integer types instead of a floating point type
- MF6 and MF26 now have additional functions that allow a user to look for specific reaction products
- MF9 and MF10 now have additional functions that allow a user to look for specific excited states

The CMake files have also been updated to simplify adding new unit tests.

This release cleans up some of the dependencies and updates most of the dependencies to more recent versions. In particular the Catch2 unit testing framework was updated to version 3.3.2. All unit tests were updated to use better floating point comparison available in this version of Catch2. A number of NJOY dependencies have also been consolidated into a single new dependency (the NJOY tools library) to reduce the number of dependencies to a more manageable level.
25 changes: 8 additions & 17 deletions cmake/develop_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ include( FetchContent )
# Declare project dependencies
#######################################################################

FetchContent_Declare( Log
GIT_REPOSITORY https://github.com/njoy/Log
GIT_TAG origin/master
FetchContent_Declare( tools
GIT_REPOSITORY https://github.com/njoy/tools
GIT_TAG v0.2.0
GIT_SHALLOW TRUE
)

FetchContent_Declare( catch-adapter
GIT_REPOSITORY https://github.com/njoy/catch-adapter
GIT_TAG origin/master
FetchContent_Declare( Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2
GIT_TAG v3.3.2
GIT_SHALLOW TRUE
)

Expand All @@ -23,31 +23,22 @@ FetchContent_Declare( disco
GIT_SHALLOW TRUE
)

FetchContent_Declare( header-utilities
GIT_REPOSITORY https://github.com/njoy/header-utilities
GIT_TAG origin/master
GIT_SHALLOW TRUE
)

FetchContent_Declare( range-v3
GIT_REPOSITORY https://github.com/ericniebler/range-v3
GIT_TAG 0.11.0
)

FetchContent_Declare( pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.10.1
GIT_TAG v2.10.4
)

#######################################################################
# Load dependencies
#######################################################################

FetchContent_MakeAvailable(
Log
catch-adapter
tools
disco
header-utilities
range-v3
pybind11
)
31 changes: 14 additions & 17 deletions cmake/release_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,19 @@ FetchContent_Declare( catch-adapter
GIT_TAG fb84b82ebf7a4789aa43cea560680cf745c6ee4f
)

FetchContent_Declare( Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2
GIT_TAG 3f0283de7a9c43200033da996ff9093be3ac84dc # tag: v3.3.2
)

FetchContent_Declare( disco
GIT_REPOSITORY https://github.com/njoy/disco
GIT_TAG 2606933a854bb0269c4ec37143e1236797e27838
)

FetchContent_Declare( header-utilities
GIT_REPOSITORY https://github.com/njoy/header-utilities
GIT_TAG cc2610fee15e255c151e8e22aca1e8b3d1a96b39
)

FetchContent_Declare( Log
GIT_REPOSITORY https://github.com/njoy/Log
GIT_TAG 52962b7796afe37ef1d8f7edb4bf9ecb1b868d15
)

FetchContent_Declare( pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG 80dc998efced8ceb2be59756668a7e90e8bef917 # tag: v2.10.1
GIT_TAG 5b0a6fc2017fcc176545afe3e09c9f9885283242 # tag: v2.10.4
)

FetchContent_Declare( range-v3
Expand All @@ -37,20 +32,22 @@ FetchContent_Declare( range-v3

FetchContent_Declare( spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog
GIT_TAG a51b4856377a71f81b6d74b9af459305c4c644f8
GIT_TAG ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36 # tag: v1.11.0
)
set( SPDLOG_BUILD_PIC CACHE INTERNAL BOOL ON )

FetchContent_Declare( tools
GIT_REPOSITORY https://github.com/njoy/tools
GIT_TAG 25c9273d05601a9644feea6d7539250bf1d1c0dc # tag: v0.2.0
)
set( SPDLOG_BUILD_TESTING CACHE BOOL OFF )

#######################################################################
# Load dependencies
#######################################################################

FetchContent_MakeAvailable(
catch-adapter
disco
header-utilities
Log
pybind11
range-v3
spdlog
tools
)
Loading

0 comments on commit b03de18

Please sign in to comment.