I’m a first-time contributor looking to contribute to OpenMC. I’ve been able to follow the install from source instructions on the documentation. Now, I am trying to get my pytest to work. I am following NJOY documentation to install it.
I got everything to work up until the cmake. However, when I try to build by running make, I get a bunch of errors that look like the one below during this step: [ 86%] Building CXX object CMakeFiles/njoy21.dir/src/main.cpp.o
/-----/openmc/NJOY21/bin/_deps/hana-adapter-src/src/include/boost/hana/core/make.hpp:35:28: error: left operand of comma operator has no effect [-Werror,-Wunused-value]
static_assert((sizeof…(X), false),
^~~~~~~~~~~~
and then, it ends with
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/njoy21.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/njoy21.dir/all] Error 2
make: *** [all] Error 2
Hi ywkim1025
That looks like you are making use of the newer NJOY 21
The NJOY used by OpenMC for nuclear data processing is NJOY 2016
Here are some install command for NJOY2016 taken from the openmc dockerfile
cd ~
git clone --single-branch --depth 1 https://github.com/njoy/NJOY2016'
cd NJOY2016
mkdir build
cd build
cmake -Dstatic=on ..
make 2>/dev/null -j install
I tried this out and I still get an error when I use the cmake command:
CMake Error at CMakeLists.txt:37 (message):
Static binaries not supported on OSX
– Configuring incomplete, errors occurred!
I looked the error up and I’m still not sure how to fix it
Might be worth changing the above command a bit, perhaps try
Dstatic=off
Thank you. That fixed it.
However, my pytest still results in the same error of exiting out after:
============================= test session starts ==============================
platform darwin – Python 3.10.9, pytest-7.2.2, pluggy-1.0.0
rootdir: /Users/youngwoo/Desktop/eecs481/hw6/openmc, configfile: pytest.ini
plugins: anyio-3.5.0, cov-4.0.0
collected 767 items / 3 skipped
regression_tests/adj_cell_rotation/test.py F [ 0%]
regression_tests/asymmetric_lattice/test.py F [ 0%]
regression_tests/cmfd_feed/test.py
Do you have any ideas on why this may be happening?
@ywkim1025 This might be related to the following currently open pull request:
openmc-dev:develop
← stchaker:fix_mac_segfault
opened 09:16PM - 04 Apr 23 UTC
You can't reliably use extern "C" std::strings. The python C API ends up basical… ly reinterpret casting path_statepoint, which is an std::string to char*. Depending on the libc++ implementation, this may segfault, as it does on my intel Mac. This failure can be seen in the cmfd_restart test, with this output below.
```
test.py Fatal Python error: Segmentation fault
Current thread 0x00007ff85fd97340 (most recent call first):
File "/Users/sebastiantchakerian/Codes/openmc/openmc/lib/settings.py", line 59 in path_statepoint
File "/Users/sebastiantchakerian/Codes/openmc/openmc/cmfd.py", line 1036 in _configure_cmfd
File "/Users/sebastiantchakerian/Codes/openmc/openmc/cmfd.py", line 837 in init
File "/Users/sebastiantchakerian/Codes/openmc/openmc/cmfd.py", line 812 in run_in_memory
File "/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 119 in __enter__
File "/Users/sebastiantchakerian/Codes/openmc/openmc/cmfd.py", line 778 in run
File "/Users/sebastiantchakerian/Codes/openmc/tests/regression_tests/cmfd_restart/test.py", line 29 in execute_test
File "/Users/sebastiantchakerian/Codes/openmc/tests/testing_harness.py", line 42 in main
File "/Users/sebastiantchakerian/Codes/openmc/tests/regression_tests/cmfd_restart/test.py", line 72 in test_cmfd_restart
File "/usr/local/lib/python3.9/site-packages/_pytest/python.py", line 195 in pytest_pyfunc_call
File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/local/lib/python3.9/site-packages/_pytest/python.py", line 1789 in runtest
File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 167 in pytest_runtest_call
File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 260 in <lambda>
File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 339 in from_call
File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 259 in call_runtest_hook
File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 220 in call_and_report
File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 131 in runtestprotocol
File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 112 in pytest_runtest_protocol
File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 349 in pytest_runtestloop
File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 324 in _main
File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 270 in wrap_session
File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 317 in pytest_cmdline_main
File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py", line 167 in main
File "/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py", line 190 in console_main
File "/usr/local/bin/pytest", line 8 in <module>
[1] 14769 segmentation fault pytest
```
You could try applying the changes from that PR and see if it gets you any further in tests.