CoreNeuron
CoreNeuron copied to clipboard
nrnivmodl errors with NVHPC in system-wide installation
Describe the issue In https://github.com/BlueBrain/CoreNeuron/issues/580#issuecomment-869628071 we saw that the NVHPC compilers do not cope with being explicitly told about system include paths:
$ echo "#include <cstdlib>" > foo.cpp && nvc++ -I/usr/include -o foo foo.cpp
"[snipped]/gcc-9.3.0-45gzrp/include/c++/9.3.0/cstdlib", line 75: catastrophic error: cannot open source file "stdlib.h"
#include_next <stdlib.h>
^
1 catastrophic error detected in the compilation of "foo.cpp".
Compilation terminated.
This seems to be a known issue:
To fix, remove the
-I/usr/include
from your compile options.
If CoreNEURON is installed to a system prefix (i.e. -DCMAKE_INSTALL_PREFIX=/usr
) then CoreNEURON adds an explicit -I/usr/include
to the compiler arguments used inside nrnivmodl
, causing similar errors when nrnivmodl
is called.
To Reproduce [Presumably] build NEURON with NVHPC and
cmake .. -DNRN_ENABLE_CORENEURON=ON -DCORENRN_ENABLE_GPU=ON -DCMAKE_INSTALL_PREFIX=/usr
cmake --build . --parallel
cmake --build . --target install
and run /usr/bin/nrnivmodl
.
Expected behavior This should work, or there should be an error message saying that shared/system installations like this are not supported.
A fix might replicate some linker-related logic in this file.
Assigning this to Nico as it would be nice to get this done before next release.
@alkino : I think you can install locally NVHPC SDK or use just Nvidia docker container to reproduce / fix this issue.
@alkino : IIRC, you were looking into this, right?
@olupton Can you try with last NVHPC? And tell us if this problem still occurs
IIRC last time I tried to reproduce this I couldn't -- let's just close it.