NJOY21 build error to get pytest running

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:

You could try applying the changes from that PR and see if it gets you any further in tests.