Problems compiling GeFREALIGN v8.06_110514

Forums

Hello,
I have a problem compiling the GPU version of frealign on our system.

Background:
1) GeFREALIGNv8.06_110514.tar.gz - latest GPU version (CUDA 3.2)
2) gcc:
Configured with: ../configure --prefix=/home/soft/gcc340 --enable-languages=c,f77,c++
Thread model: posix
gcc version 3.4.0

3) Nvidia Driver Version: 310.44
4) Cuda compilation tools, release 5.0, V0.2.1221
5) 2x GPU Tesla K20m

I have modified Makefile a little to use old GCC:
COMP = /home/soft/gcc340/bin/g77
CUDA = nvcc -arch sm_13 -lpthread --compiler-bindir=/home/soft/gcc340/bin/gcc -Xptxas -dlcm=ca
CC = /home/soft/gcc340/bin/gcc

At the very end of compilation of either rec/refine binary files I got the following:

all object files placed in library
linking frealign_v8
nvcc -arch sm_13 -lpthread --compiler-bindir=/home/soft/gcc340/bin/gcc -Xptxas -dlcm=ca -O3 -lg2c -lcufft -DPROTOTYPE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE frealign_v8.cu frealign_v8.a -o ../bin/frealign_v8.exe_ref
frealign_v8.a(mrc.o): In function `MRC::getHeader(MRCHeader const*)':
mrc.cpp:(.text+0x5d0): undefined reference to `_intel_fast_memcpy'
frealign_v8.a(mrc.o): In function `MRC::setHeader(MRCHeader const*)':
mrc.cpp:(.text+0xe0b): undefined reference to `_intel_fast_memcpy'
collect2: ld returned 1 exit status
make: *** [frealign_v8] Error 1
rm mrc.o

Could you give me some advice on this?

The option --compiler-bindir=/home/soft/gcc340/bin/gcc seems not correct. This should be a folder, so try:
--compiler-bindir=/home/soft/gcc340/bin
And inside this folder, you may need to include both gcc and g++.
by the way, you also need to use g++ v3.4

In reply to by xueming

I have changed the bindir option, still gives me the same error. I've attached make's output to the first post.

PS. in bin folder I have g++,gcc, g77

PPS. I also tried to compile with older CUDA (Cuda compilation tools, release 3.2, V0.2.1221) - got more errors:

all object files placed in library
linking frealign_v8
nvcc -arch sm_13 -lpthread --compiler-bindir=/home/soft/gcc340/bin -Xptxas -dlcm=ca -O3 -lg2c -lcufft -DPROTOTYPE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE frealign_v8.cu frealign_v8.a -o ../bin/frealign_v8.exe_rec
frealign_v8.a(mrc.o): In function `MRC::getHeader(MRCHeader const*)':
mrc.cpp:(.text+0x5d0): undefined reference to `_intel_fast_memcpy'
frealign_v8.a(mrc.o): In function `MRC::setHeader(MRCHeader const*)':
mrc.cpp:(.text+0xe0b): undefined reference to `_intel_fast_memcpy'
/usr/local/cuda/bin/../lib64/libcudart.so: undefined reference to `__cxa_get_exception_ptr@CXXABI_1.3.1'
collect2: ld returned 1 exit status
make: *** [frealign_v8] Error 1
rm mrc.o

In reply to by Grigory

"_intel_fast_memcpy" seems you used an intel compiler to compile mrc.cpp.

Could you check the output of make, see how the mrc.cpp was compiled. i guess the mrc.cpp was compiled by your defualt c++ compiler, which is either higher version of g++ or intel c++ compiler.

So maybe you can try:
1) change the file name of mrc.cpp to mrc.cu. Then the mrc.cu will be compiled by nvcc with your g++3.4

if 1) not work, try 2)
2) run make first, and run
g++3.4 -c mrc.cpp -o mrc.o
finnally run:
nvcc -arch sm_13 -lpthread --compiler-bindir=/home/soft/gcc340/bin -Xptxas -dlcm=ca -O3 -lg2c -lcufft -DPROTOTYPE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE frealign_v8.cu frealign_v8.a -o ../bin/frealign_v8.exe_rec

or try 3)
3) The rule for .cpp may be missed. So add the following code into your Makefile:

.cpp.a:
g++3.4 -O3 -c $<
$(AR) r $(LIB) $*.o
@\rm $*.o

here, you will need to replace g++3.4 with your actural g++ 3.4.

hope above work.