CoreNeuron icon indicating copy to clipboard operation
CoreNeuron copied to clipboard

nrnivmodl errors with NVHPC in system-wide installation

Open olupton opened this issue 3 years ago • 2 comments

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.

olupton avatar Jun 29 '21 11:06 olupton

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.

pramodk avatar Oct 11 '21 13:10 pramodk

@alkino : IIRC, you were looking into this, right?

pramodk avatar Jan 06 '22 11:01 pramodk

@olupton Can you try with last NVHPC? And tell us if this problem still occurs

alkino avatar Aug 18 '22 11:08 alkino

IIRC last time I tried to reproduce this I couldn't -- let's just close it.

olupton avatar Aug 25 '22 07:08 olupton