Unable to build NEURON v8 with CoreNeuron and GPU support

Post Reply
deka10
Posts: 3
Joined: Sun May 30, 2021 2:31 am

Unable to build NEURON v8 with CoreNeuron and GPU support

Post by deka10 »

Hi,

As a newbie, I am unable to build NEURON v8 with CoreNeuron and GPU support, in Ubuntu 20.04. My system has a GeForce MX330, with CUDA v11.2, nvc v21.3, nvc++ v21.3 from NVIDIA HPC SDK.


Configuring cmake with the options :


-DPYTHON_EXECUTABLE=`which python3` \
-DNRN_ENABLE_BINARY_SPECIAL=ON \
-DNRN_ENABLE_INTERNAL_READLINE=ON \
-DNRN_ENABLE_RX3D=ON \
-DNRN_ENABLE_INTERVIEWS=ON \
-DNRN_ENABLE_MPI=ON \
-DNRN_ENABLE_TESTS=ON \
-DNRN_ENABLE_CORENEURON=ON \
-DCORENRN_ENABLE_GPU=ON \
-DCORENRN_GPU_CUDA_COMPUTE_CAPABILITY:STRING=60;61 \
-DCMAKE_C_COMPILER=nvc \
-DCMAKE_CXX_COMPILER=nvc++


gives following errors :

CMake Error at external/coreneuron/CMake/OpenAccHelper.cmake:54 (message):
GPU support is available via OpenACC using PGI/NVIDIA compilers. Use
NVIDIA HPC SDK with -DCMAKE_C_COMPILER=nvc -DCMAKE_CXX_COMPILER=nvc++
Call Stack (most recent call first):
external/coreneuron/CMakeLists.txt:113 (include)

-- Configuring incomplete, errors occurred!
See also "/home/kaushik/nrn/build/CMakeFiles/CMakeOutput.log".
See also "/home/kaushik/nrn/build/CMakeFiles/CMakeError.log".
61: command not found

CMakeError.log :

Determining if files osfcn.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_fda6c/fast && /usr/bin/make -f CMakeFiles/cmTC_fda6c.dir/build.make CMakeFiles/cmTC_fda6c.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_fda6c.dir/HAVE_OSFCN_H.c.o
/usr/bin/cc -fPIE -o CMakeFiles/cmTC_fda6c.dir/HAVE_OSFCN_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_OSFCN_H.c
/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_OSFCN_H.c:2:10: fatal error: osfcn.h: No such file or directory
2 | #include <osfcn.h>
| ^~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_fda6c.dir/build.make:78: CMakeFiles/cmTC_fda6c.dir/HAVE_OSFCN_H.c.o] Error 1
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_fda6c/fast] Error 2


Source:
/* */
#include <osfcn.h>


int main(void){return 0;}

Determining if files socket.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_00751/fast && /usr/bin/make -f CMakeFiles/cmTC_00751.dir/build.make CMakeFiles/cmTC_00751.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_00751.dir/HAVE_SOCKET_H.c.o
/usr/bin/cc -fPIE -o CMakeFiles/cmTC_00751.dir/HAVE_SOCKET_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SOCKET_H.c
/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SOCKET_H.c:2:10: fatal error: socket.h: No such file or directory
2 | #include <socket.h>
| ^~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_00751.dir/build.make:78: CMakeFiles/cmTC_00751.dir/HAVE_SOCKET_H.c.o] Error 1
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_00751/fast] Error 2


Source:
/* */
#include <socket.h>


int main(void){return 0;}

Determining if files stropts.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_98d57/fast && /usr/bin/make -f CMakeFiles/cmTC_98d57.dir/build.make CMakeFiles/cmTC_98d57.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_98d57.dir/HAVE_STROPTS_H.c.o
/usr/bin/cc -fPIE -o CMakeFiles/cmTC_98d57.dir/HAVE_STROPTS_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STROPTS_H.c
/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STROPTS_H.c:2:10: fatal error: stropts.h: No such file or directory
2 | #include <stropts.h>
| ^~~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_98d57.dir/build.make:78: CMakeFiles/cmTC_98d57.dir/HAVE_STROPTS_H.c.o] Error 1
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_98d57/fast] Error 2


Source:
/* */
#include <stropts.h>


int main(void){return 0;}

Determining if files stream.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_94db2/fast && /usr/bin/make -f CMakeFiles/cmTC_94db2.dir/build.make CMakeFiles/cmTC_94db2.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_94db2.dir/HAVE_STREAM_H.c.o
/usr/bin/cc -fPIE -o CMakeFiles/cmTC_94db2.dir/HAVE_STREAM_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STREAM_H.c
/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STREAM_H.c:2:10: fatal error: stream.h: No such file or directory
2 | #include <stream.h>
| ^~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_94db2.dir/build.make:78: CMakeFiles/cmTC_94db2.dir/HAVE_STREAM_H.c.o] Error 1
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_94db2/fast] Error 2


Source:
/* */
#include <stream.h>


int main(void){return 0;}

Determining if files sys/conf.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_7fec9/fast && /usr/bin/make -f CMakeFiles/cmTC_7fec9.dir/build.make CMakeFiles/cmTC_7fec9.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_7fec9.dir/HAVE_SYS_CONF_H.c.o
/usr/bin/cc -fPIE -o CMakeFiles/cmTC_7fec9.dir/HAVE_SYS_CONF_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SYS_CONF_H.c
/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SYS_CONF_H.c:2:10: fatal error: sys/conf.h: No such file or directory
2 | #include <sys/conf.h>
| ^~~~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_7fec9.dir/build.make:78: CMakeFiles/cmTC_7fec9.dir/HAVE_SYS_CONF_H.c.o] Error 1
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_7fec9/fast] Error 2


Source:
/* */
#include <sys/conf.h>


int main(void){return 0;}

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_88736/fast && /usr/bin/make -f CMakeFiles/cmTC_88736.dir/build.make CMakeFiles/cmTC_88736.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_88736.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_88736.dir/src.c.o -c /home/kaushik/nrn/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_88736
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_88736.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_88736.dir/src.c.o -o cmTC_88736
/usr/bin/ld: CMakeFiles/cmTC_88736.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x5e): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x6f): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_88736.dir/build.make:99: cmTC_88736] Error 1
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_88736/fast] Error 2


Source file was:
#include <pthread.h>

static void* test_func(void* data)
{
return data;
}

int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);

return 0;
}



With GPU support disabled, NEURON with CoreNeuron builds without any apparent errors.

Could somebody please help me understand the error(s) and resolve this ?

Best,

Kaushik
deka10
Posts: 3
Joined: Sun May 30, 2021 2:31 am

Re: Unable to build NEURON v8 with CoreNeuron and GPU support

Post by deka10 »

Update :

I was able to eliminate few of the errors by reordering the configuration options with cmake ( not sure why it works! ). Though the configuration completed without reporting any errors on the terminal, the CMakeError.log tells a different story. Also, GeForce MX330 ( installed in my system ) has a compute capability of 6.1, but I cannot specify it with -DCORENRN_GPU_CUDA_COMPUTE_CAPABILITY ( gives error ). So, CoreNEURON is configured with the default flags -gpu=cuda11.2,cc60,cc70 .

cmake configuration options:

-DCMAKE_C_COMPILER=nvc \
-DCMAKE_CXX_COMPILER=nvc++ \
-DPYTHON_EXECUTABLE=`which python3` \
-DNRN_ENABLE_INTERNAL_READLINE=ON \
-DNRN_ENABLE_RX3D=ON \
-DNRN_ENABLE_INTERVIEWS=ON \
-DNRN_ENABLE_MPI=ON \
-DNRN_ENABLE_TESTS=ON \
-DNRN_ENABLE_CORENEURON=ON \
-DCORENRN_ENABLE_GPU=ON

CMakeError.log :

Determining if files osfcn.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_8ea55/fast && /usr/bin/make -f CMakeFiles/cmTC_8ea55.dir/build.make CMakeFiles/cmTC_8ea55.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8ea55.dir/HAVE_OSFCN_H.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -fPIC -o CMakeFiles/cmTC_8ea55.dir/HAVE_OSFCN_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_OSFCN_H.c
"/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_OSFCN_H.c", line 2: catastrophic error: cannot open source file "osfcn.h"
#include <osfcn.h>
^

1 catastrophic error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_OSFCN_H.c".
Compilation terminated.
make[1]: *** [CMakeFiles/cmTC_8ea55.dir/build.make:78: CMakeFiles/cmTC_8ea55.dir/HAVE_OSFCN_H.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_8ea55/fast] Error 2


Source:
/* */
#include <osfcn.h>


int main(void){return 0;}

Determining if files socket.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_83ba8/fast && /usr/bin/make -f CMakeFiles/cmTC_83ba8.dir/build.make CMakeFiles/cmTC_83ba8.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_83ba8.dir/HAVE_SOCKET_H.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -fPIC -o CMakeFiles/cmTC_83ba8.dir/HAVE_SOCKET_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SOCKET_H.c
"/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SOCKET_H.c", line 2: catastrophic error: cannot open source file "socket.h"
#include <socket.h>
^

1 catastrophic error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SOCKET_H.c".
Compilation terminated.
make[1]: *** [CMakeFiles/cmTC_83ba8.dir/build.make:78: CMakeFiles/cmTC_83ba8.dir/HAVE_SOCKET_H.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_83ba8/fast] Error 2


Source:
/* */
#include <socket.h>


int main(void){return 0;}

Determining if files stropts.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_704f4/fast && /usr/bin/make -f CMakeFiles/cmTC_704f4.dir/build.make CMakeFiles/cmTC_704f4.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_704f4.dir/HAVE_STROPTS_H.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -fPIC -o CMakeFiles/cmTC_704f4.dir/HAVE_STROPTS_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STROPTS_H.c
"/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STROPTS_H.c", line 2: catastrophic error: cannot open source file "stropts.h"
#include <stropts.h>
^

1 catastrophic error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STROPTS_H.c".
Compilation terminated.
make[1]: *** [CMakeFiles/cmTC_704f4.dir/build.make:78: CMakeFiles/cmTC_704f4.dir/HAVE_STROPTS_H.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_704f4/fast] Error 2


Source:
/* */
#include <stropts.h>


int main(void){return 0;}

Determining if files stream.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_c10ec/fast && /usr/bin/make -f CMakeFiles/cmTC_c10ec.dir/build.make CMakeFiles/cmTC_c10ec.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c10ec.dir/HAVE_STREAM_H.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -fPIC -o CMakeFiles/cmTC_c10ec.dir/HAVE_STREAM_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STREAM_H.c
"/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STREAM_H.c", line 2: catastrophic error: cannot open source file "stream.h"
#include <stream.h>
^

1 catastrophic error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_STREAM_H.c".
Compilation terminated.
make[1]: *** [CMakeFiles/cmTC_c10ec.dir/build.make:78: CMakeFiles/cmTC_c10ec.dir/HAVE_STREAM_H.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_c10ec/fast] Error 2


Source:
/* */
#include <stream.h>


int main(void){return 0;}

Determining if files sys/conf.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_a043c/fast && /usr/bin/make -f CMakeFiles/cmTC_a043c.dir/build.make CMakeFiles/cmTC_a043c.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a043c.dir/HAVE_SYS_CONF_H.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -fPIC -o CMakeFiles/cmTC_a043c.dir/HAVE_SYS_CONF_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SYS_CONF_H.c
"/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SYS_CONF_H.c", line 2: catastrophic error: cannot open source file "sys/conf.h"
#include <sys/conf.h>
^

1 catastrophic error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_SYS_CONF_H.c".
Compilation terminated.
make[1]: *** [CMakeFiles/cmTC_a043c.dir/build.make:78: CMakeFiles/cmTC_a043c.dir/HAVE_SYS_CONF_H.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_a043c/fast] Error 2


Source:
/* */
#include <sys/conf.h>


int main(void){return 0;}

Determining if files varargs.h exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_09643/fast && /usr/bin/make -f CMakeFiles/cmTC_09643.dir/build.make CMakeFiles/cmTC_09643.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_09643.dir/HAVE_VARARGS_H.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -o CMakeFiles/cmTC_09643.dir/HAVE_VARARGS_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_VARARGS_H.c
"/usr/lib/gcc/x86_64-linux-gnu/9/include/varargs.h", line 4: catastrophic error: #error directive: "GCC no longer implements <varargs.h>."
#error "GCC no longer implements <varargs.h>."
^

1 catastrophic error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_VARARGS_H.c".
Compilation terminated.
make[1]: *** [CMakeFiles/cmTC_09643.dir/build.make:78: CMakeFiles/cmTC_09643.dir/HAVE_VARARGS_H.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_09643/fast] Error 2


Source:
/* */
#include <varargs.h>


int main(void){return 0;}

Determining if the include file _G_config.h exists failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_56ca1/fast && /usr/bin/make -f CMakeFiles/cmTC_56ca1.dir/build.make CMakeFiles/cmTC_56ca1.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_56ca1.dir/CheckIncludeFile.cxx.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc++ --c++11 -o CMakeFiles/cmTC_56ca1.dir/CheckIncludeFile.cxx.o -c /home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
"/home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx", line 1: catastrophic error: cannot open source file "_G_config.h"
#include <_G_config.h>
^

1 catastrophic error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx".
Compilation terminated.
make[1]: *** [CMakeFiles/cmTC_56ca1.dir/build.make:78: CMakeFiles/cmTC_56ca1.dir/CheckIncludeFile.cxx.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_56ca1/fast] Error 2



Determining if the doprnt exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_94bc3/fast && /usr/bin/make -f CMakeFiles/cmTC_94bc3.dir/build.make CMakeFiles/cmTC_94bc3.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_94bc3.dir/CheckSymbolExists.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -o CMakeFiles/cmTC_94bc3.dir/CheckSymbolExists.c.o -c /home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
"/home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c", line 35: error: identifier "doprnt" is undefined
return ((int*)(&doprnt))[argc];
^

1 error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c".
make[1]: *** [CMakeFiles/cmTC_94bc3.dir/build.make:78: CMakeFiles/cmTC_94bc3.dir/CheckSymbolExists.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_94bc3/fast] Error 2


File /home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <alloca.h>
#include <dlfcn.h>
#include <execinfo.h>
#include <fcntl.h>
#include <fenv.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <locale.h>
#include <malloc.h>
#include <math.h>
#include <memory.h>
#include <pthread.h>
#include <sgtty.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <termio.h>
#include <unistd.h>
#include <sys/timeb.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef doprnt
return ((int*)(&doprnt))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the pthread exist failed with the following output:
Change Dir: /home/kaushik/nrn/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_f07d5/fast && /usr/bin/make -f CMakeFiles/cmTC_f07d5.dir/build.make CMakeFiles/cmTC_f07d5.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f07d5.dir/CheckSymbolExists.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -o CMakeFiles/cmTC_f07d5.dir/CheckSymbolExists.c.o -c /home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
"/home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c", line 35: error: identifier "pthread" is undefined
return ((int*)(&pthread))[argc];
^

1 error detected in the compilation of "/home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c".
make[1]: *** [CMakeFiles/cmTC_f07d5.dir/build.make:78: CMakeFiles/cmTC_f07d5.dir/CheckSymbolExists.c.o] Error 2
make[1]: Leaving directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_f07d5/fast] Error 2


File /home/kaushik/nrn/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <alloca.h>
#include <dlfcn.h>
#include <execinfo.h>
#include <fcntl.h>
#include <fenv.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <locale.h>
#include <malloc.h>
#include <math.h>
#include <memory.h>
#include <pthread.h>
#include <sgtty.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <termio.h>
#include <unistd.h>
#include <sys/timeb.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread
return ((int*)(&pthread))[argc];
#else
(void)argc;
return 0;
#endif
}


Best,

Kaushik
pkumbhar
Posts: 13
Joined: Fri Mar 11, 2016 5:57 am

Re: Unable to build NEURON v8 with CoreNeuron and GPU support

Post by pkumbhar »

Hello Kaushik,
Run Build Command(s):/usr/bin/make -f Makefile cmTC_8ea55/fast && /usr/bin/make -f CMakeFiles/cmTC_8ea55.dir/build.make CMakeFiles/cmTC_8ea55.dir/build
make[1]: Entering directory '/home/kaushik/nrn/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8ea55.dir/HAVE_OSFCN_H.c.o
/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/compilers/bin/nvc -fPIC -o CMakeFiles/cmTC_8ea55.dir/HAVE_OSFCN_H.c.o -c /home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_OSFCN_H.c
"/home/kaushik/nrn/build/CMakeFiles/CheckIncludeFiles/HAVE_OSFCN_H.c", line 2: catastrophic error: cannot open source file "osfcn.h"
#include <osfcn.h>
these compilation errors seem unrelated to CoreNEURON + GPU support.

Could you try building without CoreNEURON and without GPU support? i.e. -DNRN_ENABLE_TESTS=OFF -DNRN_ENABLE_CORENEURON=OFF and see if that successfully builds NEURON? If the errors still persist then there is some issue with nvc/nvc++ compiler setup.
pkumbhar
Posts: 13
Joined: Fri Mar 11, 2016 5:57 am

Re: Unable to build NEURON v8 with CoreNeuron and GPU support

Post by pkumbhar »

Oh, my previous response might be misleading!

I am seeing:
CMake Error at external/coreneuron/CMake/OpenAccHelper.cmake:54 (message):
GPU support is available via OpenACC using PGI/NVIDIA compilers. Use
NVIDIA HPC SDK with -DCMAKE_C_COMPILER=nvc -DCMAKE_CXX_COMPILER=nvc++
What version of CMake you have? We have fixed compiler detection issue with CMake >= 3.20 here: https://github.com/BlueBrain/CoreNeuron/pull/543 and this was done after 8.0.

Anyway, for testing GPU support, I would recommend to clone latest master branch from GitHub : https://github.com/neuronsimulator/nrn . As the GPU support is new, we are fixing & improving the GPU implementation continuously.
deka10
Posts: 3
Joined: Sun May 30, 2021 2:31 am

Re: Unable to build NEURON v8 with CoreNeuron and GPU support

Post by deka10 »

Hello pkumbhar,

My CMake version is 3.20.3. Yes, I got that error with detection of NVHPC before, but has been fixed now in OpenAccHelper.cmake.

As you expected, trying to build NEURON without CoreNEURON gave the same errors. But, the same errors ( with an additional "Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed" ) are replicated even with gcc/g++ ( v9.3.0 ) compilers. So, am not sure if the nvc/nvc++ setup is the root cause. If it could be of any help, I installed and configured NVIDIA HPC SDK as per the instructions here: https://docs.nvidia.com/hpc-sdk/hpc-sdk ... index.html. I can share the error log with gcc/g++ if needed.

Could you please help me fix this ?
Post Reply