njoy/NJOY21

Build error on macOS

harterj opened this issue · 14 comments

Hello,

I'm trying to build NJOY21 on MacOS Mojave. I successfully built and ran tests with NJOY2016, but I'm interested in this version. My compilers:

$CC -> /opt/moose/mpich-3.3/clang-8.0.0/bin/mpicc
$CXX -> /opt/moose/mpich-3.3/clang-8.0.0/bin/mpicxx
$FC-> /opt/moose/mpich-3.3/clang-8.0.0/bin/mpif90

Python version is 2.7.16. I realize this isn't up to the standard, but I assumed since I got NJOY2016 to compile with it, it might work for NJOY21. Here are the error messages I'm seeing:

[ 84%] Building CXX object CMakeFiles/njoy21.dir/src/main.cpp.o
In file included from /Users/hartjr/projects/NJOY21/src/main.cpp:1:
In file included from /Users/hartjr/projects/NJOY21/src/njoy21.hpp:11:
/opt/moose/llvm-8.0.0/bin/../include/c++/v1/experimental/optional:18:3: error: "<experimental/optional> has been removed. Use optional instead." [-Werror,-W#warnings] # warning "<experimental/optional> has been removed. Use optional instead."
In file included from /Users/hartjr/projects/NJOY21/src/main.cpp:1:
In file included from /Users/hartjr/projects/NJOY21/src/njoy21.hpp:25:
In file included from /Users/hartjr/projects/NJOY21/subprojects/ENDFtk/src/ENDFtk.hpp:82:
In file included from /Users/hartjr/projects/NJOY21/subprojects/ENDFtk/src/ENDFtk/resonanceParameters.hpp:5:
/Users/hartjr/projects/NJOY21/subprojects/ENDFtk/src/ENDFtk/resonanceParameters/src/readAPE.hpp:7:5: error: no template named 'optional' in namespace 'std'; did you mean 'ranges::optional'?
std::optional< TAB1 >{ TAB1( it, end, lineNumber, MAT, MF, MT ) } :
^~~~~~~~~~~~~
ranges::optional

And so on, it stops after 20 errors. Do you have any advice on this, please? I'm not extremely knowledgeable about compiler issues, so my apologies in advance.

Thanks!

Jackson

@harterj Right now, we only support building with clang version 3.8. That is the problem. If you have gcc 6.4 or higher it should work (although we find the clang compiler to produce a better compiled binary.) There are many options for installing compilers including homebrew and spack, which we have used here at LANL.

Try a different compiler an let us know how well it works.

@jlconlin I'll do that, thank you!

@harterj Have you had any success with a different compiler?

@jlconlin I was just trying this out again this morning, but still having trouble. I switch to GCC 8.3, removed extraneous pathing I had for MOOSE in an effort to single this out. This screenshot should help a bit, I hope:
Screen Shot 2019-07-02 at 9 56 51 AM

I've followed the directions up to the "make" command so far, from the github. The procedure was similar for the 2016 version. Here's the start of make, though:
Screen Shot 2019-07-02 at 9 59 27 AM

Any potential advice for me?

Thanks,
Jackson

@harterj I noticed this as well when I tried to build NJOY21 recently. This is definitely an issue that we are going to have to figure out.

In the meantime, are you able to build by using one of our signature files?

@jlconlin I'll play around with it a little today. Do you mean to just use a previous signature file, located at https://github.com/njoy/signatures ? And do I only need the NJOY21 signature?

If I can't get NJOY21 to build, I can definitely use NJOY2016, I just wanted to use and read the C++ version 🦑

We just made a change to NJOY21 that may help with this. It was addressed in Pull Request #93. Please try it out and let me know if it helps.

@jlconlin I will give this a shot this week, thank you! I was on travel.

Any news on this?

Sorry on the delay with this @jlconlin -- I've been busy prepping for some things..still getting an error
Screen Shot 2019-09-19 at 1 47 07 PM

This is using the recent signature 1.0.5-NJOY21.json

Screen Shot 2019-09-19 at 1 49 30 PM
Here's from cmake

@harterj can you start over from scratch (i.e., with a freshly cloned repository)? It's likely that some underlying component is still broken. We've made a number of changes to the underlying components.

The instructions we provide online are for those who really care about the specific version of NJOY21 they are using. If you don't care and just want the latest and greatest the instructions are easier:

mkdir bin
cd bin
make  -D CMAKE_BUILD+TYPE=Release ../
make
ctest

Going this route, there is no need to run fetch_subprojects.py before doing cmake.

That worked! Compiled just fine followed by successful tests. Thanks so much for the help @jlconlin

Glad everything is working.