-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build NCrystal from Source for OpenMC #3304
base: develop
Are you sure you want to change the base?
Changes from all commits
233064b
b8556c6
72f653a
8eb71c2
ac7b4f2
2be024a
9e900f2
254c4c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,16 +121,8 @@ endmacro() | |
#=============================================================================== | ||
|
||
if(OPENMC_USE_NCRYSTAL) | ||
if(NOT DEFINED "NCrystal_DIR") | ||
#Invocation of "ncrystal-config --show cmakedir" is needed to find NCrystal | ||
#when it is installed from Python wheels: | ||
execute_process( | ||
COMMAND "ncrystal-config" "--show" "cmakedir" | ||
OUTPUT_VARIABLE "NCrystal_DIR" OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
Comment on lines
-127
to
-130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can make it available with a different fallback, right? |
||
endif() | ||
find_package(NCrystal 3.8.0 REQUIRED) | ||
message(STATUS "Found NCrystal: ${NCrystal_DIR} (version ${NCrystal_VERSION})") | ||
find_package(NCrystal 4.0.0 REQUIRED) | ||
message(STATUS "Found NCrystal: ${NCrystal_LIBRARIES} (version ${NCrystal_VERSION})") | ||
endif() | ||
|
||
#=============================================================================== | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,7 @@ if(@OPENMC_USE_DAGMC@) | |
endif() | ||
|
||
if(@OPENMC_USE_NCRYSTAL@) | ||
if(NOT DEFINED "NCrystal_DIR") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is broken. We should set |
||
#Invocation of "ncrystal-config --show cmakedir" is needed to find NCrystal | ||
#when it is installed from Python wheels: | ||
execute_process( | ||
COMMAND "ncrystal-config" "--show" "cmakedir" | ||
OUTPUT_VARIABLE "NCrystal_DIR" OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
endif() | ||
find_package(NCrystal REQUIRED) | ||
message(STATUS "Found NCrystal: ${NCrystal_DIR} (version ${NCrystal_VERSION})") | ||
find_package(NCrystal REQUIRED HINTS @CMAKE_PREFIX_PATH@) | ||
endif() | ||
|
||
if(@OPENMC_USE_LIBMESH@) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# NCrystal Variables | ||
NCRYSTAL_BRANCH='v4.0.0' | ||
NCRYSTAL_REPO='https://github.com/mctools/ncrystal' | ||
NCRYSTAL_INSTALL_DIR=$HOME/NCRYSTAL/ | ||
|
||
CURRENT_DIR=$(pwd) | ||
|
||
# NCrystal Install | ||
cd $HOME | ||
git clone -b $NCRYSTAL_BRANCH $NCRYSTAL_REPO ncrystal | ||
cd ncrystal | ||
mkdir build && cd build | ||
cmake .. \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DNCRYSTAL_NOTOUCH_CMAKE_BUILD_TYPE=ON \ | ||
-DNCRYSTAL_MODIFY_RPATH=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DNCRYSTAL_ENABLE_EXAMPLES=OFF \ | ||
-DNCRYSTAL_ENABLE_SETUPSH=OFF \ | ||
-DNCRYSTAL_ENABLE_DATA=EMBED \ | ||
-DCMAKE_INSTALL_PREFIX="$NCRYSTAL_INSTALL_DIR" | ||
make -j4 && make install | ||
rm -rf $HOME/ncrystal | ||
cd $CURRENT_DIR |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,8 @@ fi | |
|
||
# Install NCrystal if needed | ||
if [[ $NCRYSTAL = 'y' ]]; then | ||
pip install 'ncrystal>=4.0.0' | ||
#Basic quick verification: | ||
nctool --test | ||
chmod +x ./tools/ci/gha-install-ncrystal.sh | ||
./tools/ci/gha-install-ncrystal.sh | ||
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why I need to |
||
fi | ||
|
||
# Install vectfit for WMP generation if needed | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this as it forces the definition of
NCrystal_DIR
, which would break the standard method of defining other CMake variables for NCrystal. However, if this is recommended, please let me know.