Skip to content

Commit 3a68980

Browse files
Merge pull request #1 from HunterBelanger/develop
Merge Version 0.2.0
2 parents 5594bf1 + ebb9e4d commit 3a68980

File tree

120 files changed

+8022
-1161
lines changed

Some content is hidden

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

120 files changed

+8022
-1161
lines changed

CMakeLists.txt

+56-45
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.9)
22

33
project(PapillonNDL
4-
VERSION "0.1.0"
4+
VERSION "0.2.0"
55
DESCRIPTION "Library to interact with ACE nuclear data"
66
LANGUAGES CXX
77
)
@@ -11,42 +11,47 @@ option(PNDL_GO_FASTER "Enable -Ofast -ffast-math compiler optimizations" OFF)
1111
option(PNDL_PYTHON "Enable Python interface to PapillonNDL" ON)
1212
option(PNDL_TESTS "Build tests" OFF)
1313

14-
# Create PapillonNDL library target
15-
add_library(PapillonNDL SHARED
16-
src/frame.cpp
17-
src/interpolation.cpp
18-
src/integration.cpp
19-
src/region_1d.cpp
20-
src/multi_region_1d.cpp
21-
src/polynomial_1d.cpp
22-
src/ace.cpp
23-
src/isotropic.cpp
24-
src/equiprobable_angle_bins.cpp
25-
src/angle_table.cpp
26-
src/equiprobable_energy_bins.cpp
27-
src/level_inelastic_scatter.cpp
28-
src/general_evaporation.cpp
29-
src/evaporation.cpp
30-
src/maxwellian.cpp
31-
src/watt.cpp
32-
src/tabular_energy.cpp
33-
src/pctable.cpp
34-
src/angle_distribution.cpp
35-
src/uncorrelated.cpp
36-
src/nbody.cpp
37-
src/kalbach_table.cpp
38-
src/kalbach.cpp
39-
src/energy_angle_table.cpp
40-
src/tabular_energy_angle.cpp
41-
src/energy_grid.cpp
42-
src/cross_section.cpp
43-
src/reaction.cpp
44-
src/delayed_group.cpp
45-
src/fission_data.cpp
46-
src/nuclide.cpp
47-
src/version.cpp
14+
set(PNDL_SOURCE_LIST src/frame.cpp
15+
src/region_1d.cpp
16+
src/multi_region_1d.cpp
17+
src/polynomial_1d.cpp
18+
src/ace.cpp
19+
src/isotropic.cpp
20+
src/equiprobable_angle_bins.cpp
21+
src/angle_table.cpp
22+
src/equiprobable_energy_bins.cpp
23+
src/level_inelastic_scatter.cpp
24+
src/general_evaporation.cpp
25+
src/evaporation.cpp
26+
src/maxwellian.cpp
27+
src/watt.cpp
28+
src/tabular_energy.cpp
29+
src/pctable.cpp
30+
src/angle_distribution.cpp
31+
src/uncorrelated.cpp
32+
src/nbody.cpp
33+
src/kalbach_table.cpp
34+
src/kalbach.cpp
35+
src/energy_angle_table.cpp
36+
src/tabular_energy_angle.cpp
37+
src/energy_grid.cpp
38+
src/cross_section.cpp
39+
src/reaction.cpp
40+
src/delayed_group.cpp
41+
src/fission_data.cpp
42+
src/ce_neutron.cpp
43+
src/version.cpp
4844
)
4945

46+
# Create PapillonNDL library target
47+
if(WIN32)
48+
# On windows, make a static lib to avoid errors using cmake
49+
add_library(PapillonNDL STATIC ${PNDL_SOURCE_LIST})
50+
else()
51+
# On Unix-like systems, use a shared lib
52+
add_library(PapillonNDL SHARED ${PNDL_SOURCE_LIST})
53+
endif()
54+
5055
# Add public interface includes directory
5156
target_include_directories(PapillonNDL PUBLIC
5257
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -56,14 +61,17 @@ target_include_directories(PapillonNDL PUBLIC
5661
# Require C++17 standard
5762
target_compile_features(PapillonNDL PRIVATE cxx_std_17)
5863

59-
# Get compiler info (MSVC/Clang/GCC)
60-
# TODO, for now, only support Clang or GCC
61-
62-
# Set compile options for library
63-
target_compile_options(PapillonNDL PRIVATE -W -Wall -Wextra -Wpedantic -Weffc++)
64-
target_compile_options(PapillonNDL PRIVATE $<$<CONFIG:DEBUG>:-g>)
65-
target_compile_options(PapillonNDL PRIVATE $<$<CONFIG:RELEASE>:-O2>)
66-
target_compile_options(PapillonNDL PRIVATE $<$<BOOL:PNDL_GO_FASTER>:-Ofast -ffast-math>)
64+
if(WIN32) # Comile options for Windows
65+
target_compile_options(PapillonNDL PRIVATE /W4)
66+
target_compile_options(PapillonNDL PRIVATE $<$<CONFIG:DEBUG>:/DEBUG>)
67+
target_compile_options(PapillonNDL PRIVATE $<$<CONFIG:RELEASE>:/O2>)
68+
target_compile_options(PapillonNDL PRIVATE $<$<BOOL:PNDL_GO_FASTER>:/O2>)
69+
else() # Compile options for GCC and Clang on Unix-like systems
70+
target_compile_options(PapillonNDL PRIVATE -W -Wall -Wextra -Wpedantic -Weffc++)
71+
target_compile_options(PapillonNDL PRIVATE $<$<CONFIG:DEBUG>:-g>)
72+
target_compile_options(PapillonNDL PRIVATE $<$<CONFIG:RELEASE>:-O2>)
73+
target_compile_options(PapillonNDL PRIVATE $<$<BOOL:PNDL_GO_FASTER>:-Ofast -ffast-math>)
74+
endif()
6775

6876
if(PNDL_TESTS)
6977
add_subdirectory(tests)
@@ -88,10 +96,13 @@ if(PNDL_PYTHON)
8896
src/python/reaction.cpp
8997
src/python/delayed_group.cpp
9098
src/python/fission_data.cpp
91-
src/python/nuclide.cpp
99+
src/python/ce_neutron.cpp
92100
src/python/prng.cpp
93101
)
94-
102+
103+
# Require C++17 standard
104+
target_compile_features(pyPapillonNDL PRIVATE cxx_std_17)
105+
95106
target_link_libraries(pyPapillonNDL PRIVATE PapillonNDL)
96107

97108
# Get location for python lib

README.md

+26-34
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
# Papillon Nuclear Data Library
2+
[![Documentation Status](https://readthedocs.org/projects/papillon-ndl/badge/?version=latest)](https://papillon-ndl.readthedocs.io/en/latest/?badge=latest)
23
![License](https://img.shields.io/badge/License-CeCILL%20v2.1-brightgreen)
34

4-
The Papillon Nuclear Data Library (NDL) is used for reading, sampling,
5-
and interacting with continuous energy nuclear data, stored in the ACE
5+
The Papillon Nuclear Data Library (NDL) is a C++/Python library for reading,
6+
sampling, and interacting with continuous energy nuclear data, stored in the ACE
67
nuclear data format.
78

8-
### Sampling
9-
To sample the angle and energy distributions, an instance of an
10-
```std::function<double()>``` must be passed to the distributions.
11-
This function pointer is the library's access to a pseudo random
12-
number generator. Therefore, if ```rng``` is such an instance, ```rng``` must
13-
meet the requirements that any call of ```rng()``` returns a random double over
14-
the interval [0,1), and it must be possible to call ```rng()``` an indefinite
15-
number of times. If the passed object does not meet these requirements, the
16-
behavior of the library is undefined. Using this mechanism allows greater
17-
flexibility to the user, in choosing the random number generator of their
18-
choice, and allows the library to be completely disconnected from the random
19-
number generation process, allowing the distributions to know how to sample
20-
themselves, but not know or assume anything about random number generation.
9+
For examples of how to use the library in both C++ and Python, take a look at
10+
the [documentation site](https://papillon-ndl.readthedocs.io). That is where you
11+
will also be able to fined more detailed installation instructions.
12+
13+
## License
14+
PapillonNDL is provided under the terms and conditions of the CeCILLv2.1
15+
license. This is a French equivalent of the GPLv3 license, and is explicitly
16+
compatible with both the GPLv2 and v3. The French version of this license is
17+
provided in the LICENSE file, along with the equally valid English version, which
18+
may be found in the LICENSE-ENGLISH file. The CeCILLv2.1 is approved by the FSF.
19+
More information about this license may be found [here](https://cecill.info/).
2120

2221
## Dependencies
23-
To build and install the library a UNIX-like operating system with cmake >= 3.9
22+
To build and install the library a Unix-like operating system with cmake >= 3.9
2423
is required, along with a C++ compiler which supports the C++17 standard. The
25-
recommended compiler is Clang >= 5, though GCC >= 6 should suffice. In order to
24+
recommended compiler is Clang >= 6 or GCC >= 7 should suffice. In order to
2625
build the Python interface, Python >= 3.5 should be installed on your system, in
2726
addition to the Python development libraries and header files.
2827

29-
Building the C++ library on Windows is in theory possible (and likely quite
30-
straight forward), though not currently supported. Building the Python bindings
31-
would likely be less trivial however with a standard Python installation for
32-
Windows. If you are a Windows user, I recommend that you take a look at the
33-
Windows Subsystem for Linux, which will allow you to build the library on your
34-
Windows machine, using the standard Linux build instructions.
28+
There are two posibilities for building the library on Windows. The first is to use
29+
the Windows Subsytem for Linux (WSL), where the library may be installed by following
30+
the simple Linux build instructions, typically without problem. The second option
31+
is to build the library to run natively on Windows. This requires having Visual
32+
Studio installed to compile the library. In addition, if you want to build the
33+
Python bindings for Windows, you need to ensure the Python development kit has been
34+
installed in Visual Studio as well.
3535

3636
Building the unit tests (using ```-DPNDL_TESTS=ON``` when calling cmake)
3737
requires that Google test already be installed on the system, and is not
3838
provided. Tests are not built by default, and should only be needed for
3939
developers, therefore this is not required for most users.
4040

4141
## Install
42-
To build PapillonNDL, navigate to the directory where you would like to keep
43-
the source files, and then run the following commands:
42+
To build PapillonNDL on a Unix-like system, navigate to the directory where you
43+
would like to keep the source files, and then run the following commands:
4444
```
4545
$ git clone https://github.com/HunterBelanger/papillon-ndl.git
4646
$ cd papillon-ndl
@@ -52,12 +52,4 @@ This will install the libraries and header files to the UNIX default locations
5252
in ```/usr/local/```.
5353

5454
If you do NOT want to build the Python bindings for PapillonNDL, then you should
55-
add the flag ```-DPNDL_PYTHON=OFF``` to the cmake command.
56-
57-
## License
58-
PapillonNDL is provided under the terms and conditions of the CeCILLv2.1
59-
license. This is a French equivalent of the GPLv3 license, and is explicitly
60-
compatible with both the GPLv2 and v3. The French version of this license is
61-
provided in the LICENSE file, along with the equally valid English version, which
62-
may be found in the LICENSE-ENGLISH file. The CeCILLv2.1 is approved by the FSF.
63-
More information about this license may be found [here](https://cecill.info/).
55+
add the flag ```-DPNDL_PYTHON=OFF``` to the cmake command.

0 commit comments

Comments
 (0)