Hi,
just tried to compile a recent version of CTranslate2 (commit 3f53d02) under Ubuntu 18.04 (GCC 7.5.0) with CUDA 10.1 using the following cmake command (adapted from Dockerfile.ubuntu-gpu) :
cmake -DCMAKE_PREFIX_PATH="/usr/local/dnnl;/usr/local/mkl-dnn" -DWITH_CUDA=ON -DWITH_DNNL=ON -DOPENMP_RUNTIME=COMP -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=corei7-avx" -DCUDA_NVCC_FLAGS="-Xfatbin -compress-all" -DCUDA_ARCH_LIST=“Common” …
… and then …
VERBOSE=1 make -j $(nproc)
… leading to the following linking error :
[…]
[ 96%] Linking CXX shared library libctranslate2.so
[…]
CMakeFiles/ctranslate2.dir/kernels_avx.cc.o: In function void ctranslate2::cpu::exp<(ctranslate2::cpu::CpuIsa)1>(float const*, float*, long)':* *kernels_avx.cc:(.text+0x310): multiple definition of
void ctranslate2::cpu::exp<(ctranslate2::cpu::CpuIsa)1>(float const, float*, long)’*
CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:kernels.cc:(.text+0x310): first defined here
CMakeFiles/ctranslate2.dir/kernels_avx.cc.o: In function void ctranslate2::cpu::log<(ctranslate2::cpu::CpuIsa)1>(float const*, float*, long)':* *kernels_avx.cc:(.text+0x370): multiple definition of
void ctranslate2::cpu::log<(ctranslate2::cpu::CpuIsa)1>(float const, float*, long)’*
CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:kernels.cc:(.text+0x370): first defined here
CMakeFiles/ctranslate2.dir/kernels_avx.cc.o: In function void ctranslate2::cpu::sin<(ctranslate2::cpu::CpuIsa)1>(float const*, float*, long)':* *kernels_avx.cc:(.text+0x3d0): multiple definition of
void ctranslate2::cpu::sin<(ctranslate2::cpu::CpuIsa)1>(float const, float*, long)’*
CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:kernels.cc:(.text+0x3d0): first defined here
CMakeFiles/ctranslate2.dir/kernels_avx.cc.o: In function void ctranslate2::cpu::cos<(ctranslate2::cpu::CpuIsa)1>(float const*, float*, long)':* *kernels_avx.cc:(.text+0x430): multiple definition of
void ctranslate2::cpu::cos<(ctranslate2::cpu::CpuIsa)1>(float const, float*, long)’*
CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:kernels.cc:(.text+0x430): first defined here
CMakeFiles/ctranslate2.dir/kernels_avx.cc.o: In function void ctranslate2::cpu::softmax<(ctranslate2::cpu::CpuIsa)1>(float const*, int const*, float*, long, long, long, bool, float)':* *kernels_avx.cc:(.text+0xfe0): multiple definition of
void ctranslate2::cpu::softmax<(ctranslate2::cpu::CpuIsa)1>(float const, int const*, float*, long, long, long, bool, float)’*
CMakeFiles/ctranslate2.dir/src/cpu/kernels.cc.o:kernels.cc:(.text+0xfe0): first defined here
collect2: error: ld returned 1 exit status
Compiling with the default flag “-march=x86-64” succeeds without a problem, but “-march=corei7-avx” and “-march=corei7-avx2” both fail.
Any idea of how to fix that error?
Thanks in advance.
Kind regards,
Martin