[AMBER] AmberTools21 cmake build

From: H. Kawasaki <kawasaki.yokohama-cu.ac.jp>
Date: Thu, 13 May 2021 06:49:40 +0000

Dear All,

I tried to build AmberTools21 by using cmake, but failed with the error log shown at the bottom.
What is wrong?
The error log contains Japanese character, so I translated the log with DeepL. The wording of error message might be somewhat different from English version.

$ find /lib -name "*pthread*"
/lib/x86_64-linux-gnu/libpthread.so.0
/lib/x86_64-linux-gnu/libpthread-2.23.so

$ nm /lib/x86_64-linux-gnu/libpthread.so.0 |grep "pthread.create"
0000000000007990 t __pthread_create_2_1
0000000000007990 T pthread_create..GLIBC_2.2.5

In the CMakeCache.txt,
//Have symbol pthread_create
CMAKE_HAVE_LIBC_CREATE:INTERNAL=
//Have library pthreads
CMAKE_HAVE_PTHREADS_CREATE:INTERNAL=
//Have library pthread
CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1
//Have include pthread.h
CMAKE_HAVE_PTHREAD_H:INTERNAL=1

So, I believe that the library for pthread exists.

Thank you in advance.

--- Hiroshi


CMakeError.log
###############
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/proteome/bin/amber20_src/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_20e0f/fast
/usr/bin/make -f CMakeFiles/cmTC_20e0f.dir/build.make CMakeFiles/cmTC_20e0f.dir/build
make[1]: into the directory '/home/proteome/bin/amber20_src/build/CMakeFiles/CMakeTmp
Building C object CMakeFiles/cmTC_20e0f.dir/CheckSymbolExists.c.o
/usr/bin/gcc -fPIC -std=gnu99 -o CMakeFiles/cmTC_20e0f.dir/CheckSymbolExists.c.o -c /home/proteome/bin/amber20_src/build/CMakeFiles/ CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_20e0f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_20e0f.dir/link.txt --verbose=1
/usr/bin/gcc -fPIC CMakeFiles/cmTC_20e0f.dir/CheckSymbolExists.c.o -o cmTC_20e0f
CMakeFiles/cmTC_20e0f.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'.
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_20e0f.dir/build.make:86: Recipe for target 'cmTC_20e0f' failed
make[1]: *** [cmTC_20e0f] error 1
make[1]: out of directory '/home/proteome/bin/amber20_src/build/CMakeFiles/CMakeTmp
Makefile:121: Recipe for target 'cmTC_20e0f/fast' failed
make: *** [cmTC_20e0f/fast] Error 2

File /home/proteome/bin/amber20_src/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */ #include <pthread.h
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/proteome/bin/amber20_src/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_8ed37/fast
/usr/bin/make -f CMakeFiles/cmTC_8ed37.dir/build.make CMakeFiles/cmTC_8ed37.dir/build
make[1]: into the directory '/home/proteome/bin/amber20_src/build/CMakeFiles/CMakeTmp
Building C object CMakeFiles/cmTC_8ed37.dir/CheckFunctionExists.c.o
/usr/bin/gcc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -std=gnu99 -o CMakeFiles/cmTC_8ed37.dir/CheckFunctionExists.c.o -c /usr/share/ CMake-3.14/Modules/CheckFunctionExists.c
Linking C executable cmTC_8ed37
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ed37.dir/link.txt --verbose=1
/usr/bin/gcc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_8ed37.dir/CheckFunctionExists.c.o -o cmTC_8ed37 -lpthreads
/usr/bin/ld: -lpthreads not found
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_8ed37.dir/build.make:86: Recipe for target 'cmTC_8ed37' failed
make[1]: *** [cmTC_8ed37] error 1
make[1]: out of directory '/home/proteome/bin/amber20_src/build/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_8ed37/fast' failed
make: *** [cmTC_8ed37/fast] error 2



Translated with www.DeepL.com/Translator (free version)
#################
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu May 13 2021 - 00:00:02 PDT
Custom Search