Unable to build NEURON v8 with CoreNeuron and GPU support
Posted: Tue Jun 01, 2021 1:20 pm
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
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