diff --git a/.github/workflows/cmake_build_and_test.yml b/.github/workflows/cmake_build_and_test.yml index a71270f..34fa041 100644 --- a/.github/workflows/cmake_build_and_test.yml +++ b/.github/workflows/cmake_build_and_test.yml @@ -21,7 +21,7 @@ jobs: cd /opt git clone https://github.com/openmc-dev/openmc.git cd openmc - git checkout develop + git checkout v0.14.0 mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=.. .. make diff --git a/.github/workflows/python_package.yml b/.github/workflows/python_package.yml index ca28fa3..d6dda34 100644 --- a/.github/workflows/python_package.yml +++ b/.github/workflows/python_package.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.10 + - name: Set up Python 3.12 uses: actions/setup-python@v2 with: - python-version: 3.10.9 + python-version: 3.12.1 - name: Build plasma source run: | pip install --upgrade pip @@ -36,7 +36,7 @@ jobs: needs: build strategy: matrix: - python-version: [3.9.16, 3.10.9] + python-version: [3.9.16, 3.10.9, 3.11.7, 3.12.1] steps: - uses: actions/checkout@v2 @@ -63,7 +63,7 @@ jobs: needs: build strategy: matrix: - python-version: [3.9.16, 3.10.9] + python-version: [3.9.16, 3.10.9, 3.11.7, 3.12.1] steps: - uses: actions/checkout@v2 @@ -82,7 +82,7 @@ jobs: sudo apt install g++ cmake libhdf5-dev git clone https://github.com/openmc-dev/openmc.git cd openmc - git checkout develop + git checkout v0.14.0 mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=.. .. make diff --git a/README.md b/README.md index ebb0c7b..af06e66 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,13 @@ The package can be built and installed in editable mode by: Compiling of the parametric plasma source from source is another method of using the software. -First clone the openmc repository into your home directory +First clone the openmc repository into your home directory (we currently support OpenMC v0.14.0) + ```bash cd ~ -git clone https://github.com/openmc-dev/openmc.git +git clone -b v0.14.0 --depth 1 https://github.com/openmc-dev/openmc.git ``` + Then clone the parametric plasma source repository ```bash @@ -49,7 +51,7 @@ git clone https://github.com/open-radiation-sources/parametric-plasma-source.git ``` Then create a build folder and compile from the folder. This assumes that -openmc repository was cloned into your home directory ```/opt/openmc```. +openmc repository was cloned into a directory at `/opt/openmc`. ```bash cd parametric-plasma-source diff --git a/parametric_plasma_source/CMakeLists.txt b/parametric_plasma_source/CMakeLists.txt index a29e4c1..e7a3a42 100644 --- a/parametric_plasma_source/CMakeLists.txt +++ b/parametric_plasma_source/CMakeLists.txt @@ -57,13 +57,16 @@ if(OpenMC_FOUND) add_library(source_sampling SHARED ${source_sampling_SOURCES}) + find_package(HDF5 REQUIRED) + find_library(OPENMC_LIB openmc HINTS ${OPENMC_LIB_DIR} OPTIONAL) if (OPENMC_LIB) set_target_properties(source_sampling PROPERTIES PREFIX "") set_target_properties(source_sampling PROPERTIES POSITION_INDEPENDENT_CODE ON) target_include_directories(source_sampling PUBLIC ${OPENMC_INC_DIR}) - target_link_libraries(source_sampling ${OPENMC_LIB} gfortran) + target_include_directories(source_sampling PUBLIC ${HDF5_INCLUDE_DIRS}) + target_link_libraries(source_sampling ${OPENMC_LIB} ${HDF5_LIBRARIES}) endif() # Build source_generator if OpenMC is available @@ -73,8 +76,6 @@ if(OpenMC_FOUND) add_executable(source_generator ${source_generator_SOURCES}) - find_package(HDF5 REQUIRED) - set_target_properties(source_generator PROPERTIES POSITION_INDEPENDENT_CODE ON) target_include_directories(source_generator PUBLIC ${OPENMC_INC_DIR}) target_include_directories(source_generator PUBLIC ${HDF5_INCLUDE_DIRS}) diff --git a/parametric_plasma_source/src/source_generator.cpp b/parametric_plasma_source/src/source_generator.cpp index d7eb50a..f6f01c9 100644 --- a/parametric_plasma_source/src/source_generator.cpp +++ b/parametric_plasma_source/src/source_generator.cpp @@ -141,7 +141,7 @@ int main(int argc, char* argv[]) } std::cout << "Sampling source:" << std::endl; - openmc::model::external_sources.push_back(std::make_unique(path_source_library, source_parameters)); + openmc::model::external_sources.push_back(std::make_unique(path_source_library, source_parameters)); openmc::calculate_work(); openmc::allocate_banks(); openmc::initialize_source(); diff --git a/pybind11 b/pybind11 index d54d6d8..8a099e4 160000 --- a/pybind11 +++ b/pybind11 @@ -1 +1 @@ -Subproject commit d54d6d8c613914a7063897d5ddddc62348ffe74a +Subproject commit 8a099e44b3d5f85b20f05828d919d2332a8de841