isovic/racon

Build error in CUDA support

Opened this issue · 2 comments

Hi,

I am trying to build CUDA-supported racon in my cluster machine equipped with GPU.
I tried the following command:

$ git clone --recursive https://github.com/lbcb-sci/racon.git racon
$ cd racon && mkdir build && cd build
$ /home/kataoka/anaconda3/envs/racon/bin/cmake \
-DCMAKE_BUILD_TYPE=Release \
-CMAKE_C_COMPILER=/home/kataoka/anaconda3/libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/gcc \
-Dracon_enable_cuda=ON \
..

However, building stops with the following stderr:

loading initial cache file MAKE_C_COMPILER=/home/kataoka/anaconda3/libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/gcc
CMake Error: Error processing file: /work2/kataoka/racon/build/MAKE_C_COMPILER=/home/kataoka/anaconda3/libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/gcc
-- The CXX compiler identification is GNU 7.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/kataoka/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /home/kataoka/anaconda3/lib/libz.so (found suitable version "1.2.11", minimum required is "1.2.8")
-- The C compiler identification is GNU 7.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/kataoka/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
Setting warning flags
-- Performing Test WOLD_STYLE_CAST
-- Performing Test WOLD_STYLE_CAST - Success
-- Performing Test WSHADOW
-- Performing Test WSHADOW - Success
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found PythonInterp: /home/kataoka/anaconda3/bin/python (found version "3.7.6")
-- Using CUDA 11.5 from /usr/local/cuda
-- Building GenomeWorks libraries as static objects
-- Found CUDA: /usr/local/cuda (found suitable version "11.5", minimum required is "9.0")
-- Using CUDA 11.5 from /usr/local/cuda
-- Build type: Release
-- Package generator - RPM
-- Found Conda environment in /home/kataoka/anaconda3
-- nvcc flags for gwbase:  -lineinfo -lineinfo -use_fast_math -Xcompiler -Wall,-Wno-pedantic -std=c++14
-- nvcc flags for cudapoa:  -lineinfo -lineinfo -use_fast_math -Xcompiler -Wall,-Wno-pedantic -std=c++14 --expt-relaxed-constexpr
-- Using CUDA 11.5 from /usr/local/cuda
-- Autodetected CUDA architecture(s):  6.1 6.1
-- nvcc flags for cudamapper:  -lineinfo -lineinfo -use_fast_math -Xcompiler -Wall,-Wno-pedantic -lineinfo --expt-extended-lambda -use_fast_math -Xcompiler -Wall,-Wno-pedantic -std=c++14 -gencode;arch=compute_61,code=sm_61
-- nvcc flags for cudaaligner:  -lineinfo -lineinfo -use_fast_math -Xcompiler -Wall,-Wno-pedantic -std=c++14 --expt-relaxed-constexpr
-- Enabling Doxygen documentation generation
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") found components: doxygen dot
-- clang-format not found. Auto-formatting disabled.
-- Configuring incomplete, errors occurred!
See also "/work2/kataoka/racon/build/CMakeFiles/CMakeOutput.log".
See also "/work2/kataoka/racon/build/CMakeFiles/CMakeError.log".

CMakeError.log is as follows:

Performing C++ SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /work2/kataoka/racon/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_79129/fast && gmake: Warning: File `Makefile' has modification time 0.02 s in the future
/usr/bin/gmake  -f CMakeFiles/cmTC_79129.dir/build.make CMakeFiles/cmTC_79129.dir/build
gmake[1]: ディレクトリ `/work2/kataoka/racon/build/CMakeFiles/CMakeTmp' に入ります
gmake[1]: Warning: File `CMakeFiles/cmTC_79129.dir/flags.make' has modification time 0.014 s in the future
Building CXX object CMakeFiles/cmTC_79129.dir/src.cxx.o
/home/kataoka/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++   -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/kataoka/anaconda3/include -Wall -Wextra -pedantic -Wall -Wextra -pedantic -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_79129.dir/src.cxx.o -c /work2/kataoka/racon/build/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTC_79129
/home/kataoka/anaconda3/envs/racon/bin/cmake -E cmake_link_script CMakeFiles/cmTC_79129.dir/link.txt --verbose=1
/home/kataoka/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++ -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/kataoka/anaconda3/include -Wall -Wextra -pedantic -Wall -Wextra -pedantic -DCMAKE_HAVE_LIBC_PTHREAD -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/kataoka/anaconda3/lib -Wl,-rpath-link,/home/kataoka/anaconda3/lib -L/home/kataoka/anaconda3/lib  -rdynamic CMakeFiles/cmTC_79129.dir/src.cxx.o -o cmTC_79129
/home/kataoka/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: CMakeFiles/cmTC_79129.dir/src.cxx.o: in function `main':
src.cxx:(.text.startup.main+0x24): undefined reference to `pthread_create'
/home/kataoka/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: src.cxx:(.text.startup.main+0x2e): undefined reference to `pthread_detach'
/home/kataoka/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: src.cxx:(.text.startup.main+0x38): undefined reference to `pthread_cancel'
/home/kataoka/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: src.cxx:(.text.startup.main+0x44): undefined reference to `pthread_join'
/home/kataoka/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: src.cxx:(.text.startup.main+0x50): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_79129] エラー 1
gmake[1]: ディレクトリ `/work2/kataoka/racon/build/CMakeFiles/CMakeTmp' から出ます
gmake: *** [cmTC_79129/fast] エラー 2


Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_cancel(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

I attached CMakeOutput.log file, please find it in the case.

CMakeOutput.log

The versions of the compilers used are follows:

$ /home/kataoka/anaconda3/libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/gcc --version
gcc (crosstool-NG 1.23.0.450-d54ae) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ /home/kataoka/anaconda3/envs/racon/bin/cmake --version
cmake version 3.18.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
CUDA Version: 11.5

Any suggestions and comments are welcome and greatly appreciated.
Thank you in advance!

Hi Kosuke,
I am also unable to compile with 7.3.0, neither with 9.3.0. 7.5.0 works, so try installing it (I am not able to find it in anaconda though).

Best regards,
Robert

Hey @kataksk try this solution: #220