Unddefined reference when compiling cp2k 4.1 with CUDA 8.0

hqzhou hqz... at nju.edu.cn
Thu Jul 27 06:22:22 UTC 2017


Hi,

I'm compiling cp2k 4.1 with CUDA 8.0 using gnu compiler gfortran 4.8.5 on a CentOS 7.3 machine.
For the compilation going on smoothly, I have made some modifications to the relevant source 
code:
1. change syncthreads() to __syncthreads()
2. added condition to support native atomicAdd() in CUDA 8.0
3. change FFT_ALIGNMENT to CUFFT_COMPATIBILITY_FFTW_PADDING

The compilation went almost OK, except the last step of creating cp2k.ssmp. I got following error.
Actually, all undefined references are defined in pw/pw_cuda.F, am I wrong somewhere in my 
configuration (refer to the attached)? 

Thanks in advance!

PS: I can run dbcsr_unittest.ssmp, libcusmm_unittest.ssmp without any problem.

Huiqun Zhou
@Earth Sciences, Nanjing University, China

======================= snippet of screen output ==========================================
gfortran -I/usr/local/include -I/usr/local/cuda/include -I/usr/local/libint/include -I/usr/local/libxc/include -D__GRID_CORE=2 -D__PILAENV_BLOCKSIZE=1024 -D__ACC -D__DBCSR_ACC -D__PW_CUDA -D__LIBXC2 -D__LIBINT -D__LIBINT_MAX_AM=6 -D__LIBDERIV_MAX_AM1=5 -D__MAX_CONTR=4 -O2 -ffast-math -ffree-form -ffree-line-length-none -fopenmp -ftree-vectorize -funroll-loops -mtune=native -I/usr/local/include -I/usr/local/cuda/include -I/usr/local/libint/include -I/usr/local/libxc/include -D__COMPILE_ARCH="\"unclecuda-gnu\"" -D__COMPILE_DATE="\"Thu Jul 27 14:08:24 CST 2017\"" -D__COMPILE_HOST="\"unclecuda\"" -D__COMPILE_REVISION="\"svn:17462\"" -D__DATA_DIR="\"/home/zhou_huiqun/Cookplate/cp2k-4.1/data\"" -L/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp -o /home/zhou_huiqun/Cookplate/cp2k-4.1/exe/unclecuda-gnu/cp2k.ssmp cp2k.o  -lcp2kstart -lcp2kmc -lcp2kswarm -lcp2kmotion -lcp2kthermostat -lcp2kemd -lcp2ktmc -lcp2kmain -lcp2keri_mme -lcp2kminimax -lcp2khfxbase -lcp2ksubsys -lcp2kxc -lcp2kao -lcp2kinput -lcp2kpw -lcp2kpwcuda -lcp2kfft -lcp2kdbcsrwrap -ldbcsr -ldbcsrarnoldi -ldbcsrvec -ldbcsrmm -ldbcsrops -ldbcsrbblock -ldbcsrbdist -ldbcsrbase -ldbcsrdata -ldbcsrerr -lmicsmm -lclsmm -lcusmm -lcp2kacc -lcp2kaccmic -lcp2kaccopencl -lcp2kacccuda -lcp2kfm -lcp2kcommon -lcp2kmpiwrap -lcp2kgrid -lcp2kbase -L/usr/local/cuda/lib64 -lcudart -lcublas -lcufft -lrt /usr/lib64/libopenblas.a /usr/local/libxc/lib/libxcf90.a /usr/local/libxc/lib/libxc.a /usr/local/libint/lib/libderiv.a /usr/local/libint/lib/libint.a
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_f':
pw_cuda.F:(.text+0x6c): undefined reference to `pw_cuda_f_z_'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_sf':
pw_cuda.F:(.text+0x1ef): undefined reference to `pw_cuda_sf_z_'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_fg':
pw_cuda.F:(.text+0x36e): undefined reference to `pw_cuda_fg_z_'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_c1dr3d_3d_ps':
pw_cuda.F:(.text+0x3673): undefined reference to `pw_cuda_fc_z_'
pw_cuda.F:(.text+0x3b6e): undefined reference to `pw_cuda_ffc_z_'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_r3dc1d_3d_ps':
pw_cuda.F:(.text+0x6ca5): undefined reference to `pw_cuda_cf_z_'
pw_cuda.F:(.text+0x7336): undefined reference to `pw_cuda_cff_z_'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_c1dr3d_3d':
pw_cuda.F:(.text+0x779c): undefined reference to `pw_cuda_sfffc_z_'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_r3dc1d_3d':
pw_cuda.F:(.text+0x79d0): undefined reference to `pw_cuda_cfffg_z_'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_init':
pw_cuda.F:(.text+0x7a55): undefined reference to `pw_cuda_init'
/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): In function `__pw_cuda_MOD_pw_cuda_finalize':
pw_cuda.F:(.text+0x7a41): undefined reference to `pw_cuda_finalize'
collect2: error: ld returned 1 exit status
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20170727/0094af28/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unclecuda-gnu.ssmp
Type: application/octet-stream
Size: 1128 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20170727/0094af28/attachment.obj>


More information about the CP2K-user mailing list