Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22077

Link error building GPU offload C++ library with GCC for Python

$
0
0

I am building up an external C++ library for my python script, using gcc-7.3.0 with openmp4.x that offloads to NVIDIA GPUs. I had built up gcc successfully for both the host linux (CentOS-7) and the target GPU (the "hello world" openmp C++ code ran on the GPU), but have issue at my library link stage:

g++ -O3 -fPIC -no-pie -fopenmp -Wno-write-strings -I/usr/include/python3.6m -Wno-unused-result -Wsign-compare -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -D_GNU_SOURCE -fwrapv -o mylpy.so .mylpy.cpp libdep.a -L$(cuda_dir)/lib64 -L/$(gcc-offload_dir)/lib64 -lm -L/usr/lib64 -lpython3.6m -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -lfftw -lgomp -fpic
/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [pylib] Error 1

Could anyone please tell me what I missed here? I very appreciate any suggestions or hints.

I had cuda-10.2 and python-3.6 installed. I also tried python-3.7 and got the same error.


Viewing all articles
Browse latest Browse all 22077

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>