Problem to build with cuda

fabr... at versatushpc.com.br fabr... at versatushpc.com.br
Mon Jan 4 18:21:44 UTC 2016


Hello there

I'm having issues with the above in a Linux centos 6.5 machine, with the 
following setup:

CC: gcc 4.8.2
FC: gfortran 4.8.2
fft: fftw 3.3.4
blas/lapack: openblas 0.2.15
libint/libderiv: 1.1.5
cuda: 6.5-14


==== ==== ==== ==== arch file ==== ==== ==== ====
CC         = gcc
CPP        =
FC         = gfortran
LD         = gfortran
AR         = ar -r
FFTW_INC   = /opt/versatushpc/libraries/fftw/3.3-gnu-4.8/include
FFTW_LIB   = /opt/versatushpc/libraries/fftw/3.3-gnu-4.8/lib64
DFLAGS     = -D__FFTW3 -D__LIBINT -D__LIBINT_MAX_AM=7 
-D__LIBDERIV_MAX_AM1=6 -D__MAX_CONTR=4 -D__ACC -D__PW_CUDA
CPPFLAGS   =
FCFLAGS    = $(DFLAGS) -O2 -g -ffast-math -ffree-form 
-ffree-line-length-none   \
             -ftree-vectorize -funroll-loops -fsecond-underscore \
             -I/opt/versatushpc/libraries/openblas/0.2-gnu-4.8/include 
-I/opt/versatushpc/libraries/fftw/3.3-gnu-4.8/include
LDFLAGS    = $(FCFLAGS)
LIBS       = -L/opt/versatushpc/libraries/openblas/0.2-gnu-4.8/lib64 
-lopenblas   \
            -L/usr/local/cuda-6.5/lib64 -lcufft -lcublas -lcudart \
           -L/opt/versatushpc/libraries/fftw/3.3-gnu-4.8/lib64 -lfftw3   \
            -lderiv -lint -lrt
==== ==== ==== ==== arch file ==== ==== ==== ====


"make VERSION=sopt" fails with the following error:
===============================================
gfortran -D__FFTW3 -D__LIBINT -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6 
-D__MAX_CONTR=4 -D__ACC -D__PW_CUDA -O2 -g -ffast-math -ffree-form 
-ffree-line-length-none -ftree-vectorize -funroll-loops -fsecond-underscore 
-I/opt/versatushpc/libraries/openblas/0.2-gnu-4.8/include 
-I/opt/versatushpc/libraries/fftw/3.3-gnu-4.8/include 
-D__COMPILE_ARCH="\"cp2k-vhpc-gnu4.8-cuda\"" -D__COMPILE_DATE="\"Seg Jan  4 
16:05:16 BRST 2016\"" 
-D__COMPILE_HOST="\"gputest-0-14\"" -D__COMPILE_REVISION="\"svn:16458\"" 
-D__DATA_DIR="\"/home/rpmbuild/build/cp2k-3.0/data\"" 
-L/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt -o 
/home/rpmbuild/build
/cp2k-3.0/exe/cp2k-vhpc-gnu4.8-cuda/dbcsr_example_1.sopt dbcsr_example_1.o  
-ldbcsr -ldbcsrarnoldi -ldbcsrvec -ldbcsrmm -ldbcsrops -ldbcsrbblock 
-ldbcsrbdist -ldbcsrbase -ldbcsrdata -ldbcsrerr -lcp2kmpiwrap -lmics
mm -lclsmm -lcp2kacc -lcp2kaccmic -lcp2kaccopencl -lcp2kbase 
-L/opt/versatushpc/libraries/openblas/0.2-gnu-4.8/lib64 -lopenblas 
-L/usr/local/cuda-6.5/lib64 -lcufft -lcublas -lcudart 
-L/opt/versatushpc/libraries/fftw/3.3-gnu-4.8/lib64 -lfftw3 -lderiv -lint 
-lrt
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_hostmem.o): 
In function `acc_hostmem_dealloc_raw':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_hostmem.F:147: undefined 
reference to `acc_host_mem_deallocate'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_hostmem.o): 
In function `acc_hostmem_alloc_raw':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_hostmem.F:120: undefined 
reference to `acc_host_mem_allocate'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_event.o): 
In function `__acc_event_MOD_acc_event_synchronize':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_event.F:249: undefined reference 
to `acc_event_synchronize'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_event.o): 
In function `__acc_event_MOD_acc_event_query':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_event.F:226: undefined reference 
to `acc_event_query'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_event.o): 
In function `__acc_event_MOD_acc_event_destroy':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_event.F:200: undefined reference 
to `acc_event_destroy'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_event.o): 
In function `__acc_event_MOD_acc_event_create':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_event.F:177: undefined reference 
to `acc_event_create'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_event.o): 
In function `__acc_event_MOD_acc_event_record':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_event.F:153: undefined reference 
to `acc_event_record'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_event.o): 
In function `__acc_event_MOD_acc_stream_wait_event':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_event.F:123: undefined reference 
to `acc_stream_wait_event'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_stream.o): 
In function `__acc_stream_MOD_acc_stream_priority_range':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_stream.F:210: undefined reference 
to `acc_stream_priority_range'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_stream.o): 
In function `__acc_stream_MOD_acc_stream_synchronize':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_stream.F:189: undefined reference 
to `acc_stream_sync'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_stream.o): 
In function `__acc_stream_MOD_acc_stream_destroy':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_stream.F:165: undefined reference 
to `acc_stream_destroy'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_stream.o): 
In function `__acc_stream_MOD_acc_stream_create':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_stream.F:142: undefined reference 
to `acc_stream_create'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_devmem.o): 
In function `dev2host_raw':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:493: undefined reference 
to `acc_memcpy_d2h'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_devmem.o): 
In function `host2dev_raw':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:457: undefined reference 
to `acc_memcpy_h2d'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_devmem.o): 
In function `__acc_devmem_MOD_acc_devmem_setzero_bytes':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:421: undefined reference 
to `acc_memset_zero'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_devmem.o): 
In function `__acc_devmem_MOD_acc_devmem_deallocate':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:375: undefined reference 
to `acc_dev_mem_deallocate'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_devmem.o): 
In function `__acc_devmem_MOD_acc_devmem_allocate_bytes':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:347: undefined reference 
to `acc_dev_mem_allocate'
/home/rpmbuild/build/cp2k-3.0/lib/cp2k-vhpc-gnu4.8-cuda/sopt/libcp2kacc.a(acc_devmem.o): 
In function `__acc_devmem_MOD_acc_devmem_ensure_size_bytes':
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:209: undefined reference 
to `acc_dev_mem_allocate'
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:231: undefined reference 
to `acc_dev_mem_deallocate'
/home/rpmbuild/build/cp2k-3.0/src/acc/acc_devmem.F:225: undefined reference 
to `acc_memcpy_d2d'
collect2: error: ld returned 1 exit status
make[3]: ** 
[/home/rpmbuild/build/cp2k-3.0/exe/cp2k-vhpc-gnu4.8-cuda/dbcsr_example_1.sopt] 
Erro 1
make[2]: ** [all] Error 2
make[1]: ** [sopt] Error 2
make: ** [all] Error 2
===============================================


I've tried all gfortran options related to underscoring functions and the 
same error happens, both with 2.6.2 and 3.0 versions.


Any clue to what's wrong is welcome.

TIA,
Fabricio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20160104/1a9290e3/attachment.htm>


More information about the CP2K-user mailing list