<div>Tiziano,</div><div><br></div><div>It works now, thank you very much!</div><div><includetail><div> </div><div> Huiqun</div><div><br></div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>From: </b> "Tiziano Müller"<tizian...@chem.uzh.ch>;</div><div><b>Date: </b> Fri, Jul 28, 2017 04:16 PM</div><div><b>To: </b> "hqzhou"<h...@nju.edu.cn>; <wbr></div><div><b>Cc: </b> "cp2k"<...@googlegroups.com>; <wbr></div><div><b>Subject: </b> Re: [CP2K:9267] Unddefined reference when compiling cp2k 4.1 withCUDA 8.0</div></div><div> </div>Hi Huiqun<br><br>It seems you forgot to set NVFLAGS in your arch file which is why <br>pw_cuda_z.o in libcp2kpwcuda.a is basically empty (specifically: <br>__PW_CUDA is defined for gfortran, but undefined for nvcc).<br><br>Usually you want to pass along all the preprocessor flags to nvcc plus <br>optimization and the -arch flag.<br>Take a look at the CRAY-XC30-gfortran-cuda.psmp for an example .<br><br>Since you are using CUDA 8 you may also have to apply<br><br>https://github.com/cp2k/cp2k/commit/e5a324e424bd79e0b2f6b87a00adf3d68eeba746<br><br>since that was fixed after the 4.1 release.<br><br>Best regards,<br>Tiziano<br><br>On 27.07.2017 17:06, hqzhou wrote:<br>> Hi, Tiziano<br>> <br>>   Thank you for your quick response! Here are attached the compile log <br>> and output of<br>> nm libcp2kpwcuda.a. It seems that no such references exist in <br>> libcp2kpwcuda.a.<br>> <br>> Thanks for resolving the problem!<br>> <br>> Huiqun<br>> ------------------ Original ------------------<br>> *From: * "Tiziano Müller"<tizian...@cThankhem.uzh.ch>;<br>> *Date: * Thu, Jul 27, 2017 05:10 PM<br>> *To: * "hqzhou"<h...@nju.edu.cn>;<br>> *Cc: * "cp2k"<...@googlegroups.com>;<br>> *Subject: * Re: [CP2K:9263] Unddefined reference when compiling cp2k 4.1 <br>> withCUDA 8.0<br>> Hi Huiqun<br>> <br>> Can you please attach the complete build log?<br>> It might also be a good idea to do a `make distclean` and rebuild<br>> everything from scratch for that.<br>> <br>> The mentioned symbols should be defined in<br>> <br>>     lib/unclecuda-gnu/ssmp/libcp2kpwcuda.a<br>> <br>> You can check for their presence using<br>>     `nm lib/unclecuda-gnu/ssmp/libcp2kpwcuda.a`<br>> <br>> which should give something like this:<br>> <br>>     [...]<br>>     pw_cuda_z.o:<br>>     [...]<br>>     00000000000003a0 T pw_cuda_cfffg_z_<br>>     0000000000000f60 T pw_cuda_cff_z_<br>>     0000000000001680 T pw_cuda_cf_z_<br>>     00000000000019e0 T pw_cuda_fc_z_<br>>     00000000000012f0 T pw_cuda_ffc_z_<br>>     0000000000001f00 T pw_cuda_fg_z_<br>>     0000000000001d40 T pw_cuda_f_z_<br>>     0000000000000960 T pw_cuda_sfffc_z_<br>>     0000000000002310 T pw_cuda_sf_z_<br>>     [...]<br>> <br>> If they are not there (after the rebuild), please also attach the<br>> complete output of this command.<br>> <br>> Best regards,<br>> Tiziano<br>> <br>> On 27.07.2017 08:22, hqzhou wrote:<br>>  > Hi,<br>>  ><br>>  > I'm compiling cp2k 4.1 with CUDA 8.0 using gnu compiler gfortran 4.8.5<br>>  > on a CentOS 7.3 machine.<br>>  > For the compilation going on smoothly, I have made some modifications to<br>>  > the relevant source<br>>  > code:<br>>  > 1. change syncthreads() to __syncthreads()<br>>  > 2. added condition to support native atomicAdd() in CUDA 8.0<br>>  > 3. change FFT_ALIGNMENT to CUFFT_COMPATIBILITY_FFTW_PADDING<br>>  ><br>>  > The compilation went almost OK, except the last step of creating<br>>  > cp2k.ssmp. I got following error.<br>>  > Actually, all undefined references are defined in pw/pw_cuda.F, am I<br>>  > wrong somewhere in my<br>>  > configuration (refer to the attached)?<br>>  ><br>>  > Thanks in advance!<br>>  ><br>>  > PS: I can run dbcsr_unittest.ssmp, libcusmm_unittest.ssmp without any<br>>  > problem.<br>>  ><br>>  > Huiqun Zhou<br>>  > @Earth Sciences, Nanjing University, China<br>>  ><br>>  > ======================= snippet of screen output<br>>  > ==========================================<br>>  > gfortran -I/usr/local/include -I/usr/local/cuda/include<br>>  > -I/usr/local/libint/include -I/usr/local/libxc/include -D__GRID_CORE=2<br>>  > -D__PILAENV_BLOCKSIZE=1024 -D__ACC -D__DBCSR_ACC -D__PW_CUDA -D__LIBXC2<br>>  > -D__LIBINT -D__LIBINT_MAX_AM=6 -D__LIBDERIV_MAX_AM1=5 -D__MAX_CONTR=4<br>>  > -O2 -ffast-math -ffree-form -ffree-line-length-none -fopenmp<br>>  > -ftree-vectorize -funroll-loops -mtune=native -I/usr/local/include<br>>  > -I/usr/local/cuda/include -I/usr/local/libint/include<br>>  > -I/usr/local/libxc/include -D__COMPILE_ARCH="\"unclecuda-gnu\""<br>>  > -D__COMPILE_DATE="\"Thu Jul 27 14:08:24 CST 2017\""<br>>  > -D__COMPILE_HOST="\"unclecuda\"" -D__COMPILE_REVISION="\"svn:17462\""<br>>  > -D__DATA_DIR="\"/home/zhou_huiqun/Cookplate/cp2k-4.1/data\""<br>>  > -L/home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp -o<br>>  > /home/zhou_huiqun/Cookplate/cp2k-4.1/exe/unclecuda-gnu/cp2k.ssmp cp2k.o<br>>  > -lcp2kstart -lcp2kmc -lcp2kswarm -lcp2kmotion -lcp2kthermostat -lcp2kemd<br>>  > -lcp2ktmc -lcp2kmain -lcp2keri_mme -lcp2kminimax -lcp2khfxbase<br>>  > -lcp2ksubsys -lcp2kxc -lcp2kao -lcp2kinput -lcp2kpw -lcp2kpwcuda<br>>  > -lcp2kfft -lcp2kdbcsrwrap -ldbcsr -ldbcsrarnoldi -ldbcsrvec -ldbcsrmm<br>>  > -ldbcsrops -ldbcsrbblock -ldbcsrbdist -ldbcsrbase -ldbcsrdata -ldbcsrerr<br>>  > -lmicsmm -lclsmm -lcusmm -lcp2kacc -lcp2kaccmic -lcp2kaccopencl<br>>  > -lcp2kacccuda -lcp2kfm -lcp2kcommon -lcp2kmpiwrap -lcp2kgrid -lcp2kbase<br>>  > -L/usr/local/cuda/lib64 -lcudart -lcublas -lcufft -lrt<br>>  > /usr/lib64/libopenblas.a /usr/local/libxc/lib/libxcf90.a<br>>  > /usr/local/libxc/lib/libxc.a /usr/local/libint/lib/libderiv.a<br>>  > /usr/local/libint/lib/libint.a<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_f':<br>>  > pw_cuda.F:(.text+0x6c): undefined reference to `pw_cuda_f_z_'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_sf':<br>>  > pw_cuda.F:(.text+0x1ef): undefined reference to `pw_cuda_sf_z_'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_fg':<br>>  > pw_cuda.F:(.text+0x36e): undefined reference to `pw_cuda_fg_z_'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_c1dr3d_3d_ps':<br>>  > pw_cuda.F:(.text+0x3673): undefined reference to `pw_cuda_fc_z_'<br>>  > pw_cuda.F:(.text+0x3b6e): undefined reference to `pw_cuda_ffc_z_'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_r3dc1d_3d_ps':<br>>  > pw_cuda.F:(.text+0x6ca5): undefined reference to `pw_cuda_cf_z_'<br>>  > pw_cuda.F:(.text+0x7336): undefined reference to `pw_cuda_cff_z_'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_c1dr3d_3d':<br>>  > pw_cuda.F:(.text+0x779c): undefined reference to `pw_cuda_sfffc_z_'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_r3dc1d_3d':<br>>  > pw_cuda.F:(.text+0x79d0): undefined reference to `pw_cuda_cfffg_z_'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_init':<br>>  > pw_cuda.F:(.text+0x7a55): undefined reference to `pw_cuda_init'<br>>  > <br>> /home/zhou_huiqun/Cookplate/cp2k-4.1/lib/unclecuda-gnu/ssmp/libcp2kpw.a(pw_cuda.o): <br>> <br>>  > In function `__pw_cuda_MOD_pw_cuda_finalize':<br>>  > pw_cuda.F:(.text+0x7a41): undefined reference to `pw_cuda_finalize'<br>>  > collect2: error: ld returned 1 exit status<br>>  ><br>>  > --<br>>  > You received this message because you are subscribed to the Google<br>>  > Groups "cp2k" group.<br>>  > To unsubscribe from this group and stop receiving emails from it, send<br>>  > an email to cp2k+uns...@googlegroups.com<br>>  > <mailto:cp2k+uns...@googlegroups.com>.<br>>  > To post to this group, send email to cp...@googlegroups.com<br>>  > <mailto:cp...@googlegroups.com>.<br>>  > Visit this group at https://groups.google.com/group/cp2k.<br>>  > For more options, visit https://groups.google.com/d/optout.<br>> <br>> -- <br>> Tiziano Müller<br>> University of Zurich<br>> Department of Chemistry<br>> Winterthurerstrasse 190<br>> CH-8057 Zürich<br>> <br>> Tel: +41 44 63 54234<br>> www.chem.uzh.ch<br>> tiziano...@chem.uzh.ch<br>> <br>> -- <br>> You received this message because you are subscribed to the Google <br>> Groups "cp2k" group.<br>> To unsubscribe from this group and stop receiving emails from it, send <br>> an email to cp2k+uns...@googlegroups.com.<br>> To post to this group, send email to cp...@googlegroups.com.<br>> Visit this group at https://groups.google.com/group/cp2k.<br>> For more options, visit https://groups.google.com/d/optout.<br>> <br>> -- <br>> You received this message because you are subscribed to the Google <br>> Groups "cp2k" group.<br>> To unsubscribe from this group and stop receiving emails from it, send <br>> an email to cp2k+uns...@googlegroups.com <br>> <mailto:cp2k+uns...@googlegroups.com>.<br>> To post to this group, send email to cp...@googlegroups.com <br>> <mailto:cp...@googlegroups.com>.<br>> Visit this group at https://groups.google.com/group/cp2k.<br>> For more options, visit https://groups.google.com/d/optout.<br><br>-- <br>Tiziano Müller<br>University of Zurich<br>Department of Chemistry<br>Winterthurerstrasse 190<br>CH-8057 Zürich<br><br>Tel: +41 44 63 54234<br>www.chem.uzh.ch<br>tiziano...@chem.uzh.ch<br><br>-- <br>You received this message because you are subscribed to the Google Groups "cp2k" group.<br>To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.<br>To post to this group, send email to cp...@googlegroups.com.<br>Visit this group at https://groups.google.com/group/cp2k.<br>For more options, visit https://groups.google.com/d/optout.<br></div><!--<![endif]--></includetail></div>