ContinuumIO / libhdfs3-downstream

a native c/c++ hdfs client (downstream fork from apache-hawq)
Apache License 2.0
40 stars 54 forks source link

Fail to build on Fedora27 #9

Open Striver00 opened 6 years ago

Striver00 commented 6 years ago

Hi , When I build the .so file from the source package, got below error:

-- Configuring incomplete, errors occurred!
See also "/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeOutput.log".
See also "/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeError.log".
failed to configure the project

file CMakeFiles/CMakeError.log:

Determining if the function dladdr exists failed with the following output:
Change Dir: /home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_3f2f1/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_3f2f1.dir/build.make CMakeFiles/cmTC_3f2f1.dir/build
gmake[1]: вход в каталог «/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp»
Building C object CMakeFiles/cmTC_3f2f1.dir/CheckFunctionExists.c.o
/usr/bin/gcc   -DCHECK_FUNCTION_EXISTS=dladdr   -o CMakeFiles/cmTC_3f2f1.dir/CheckFunctionExists.c.o   -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_3f2f1
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3f2f1.dir/link.txt --verbose=1
/usr/bin/gcc  -DCHECK_FUNCTION_EXISTS=dladdr    -rdynamic CMakeFiles/cmTC_3f2f1.dir/CheckFunctionExists.c.o  -o cmTC_3f2f1 
CMakeFiles/cmTC_3f2f1.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x10): undefined reference to `dladdr'
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
gmake[1]: *** [CMakeFiles/cmTC_3f2f1.dir/build.make:98: cmTC_3f2f1] Ошибка 1
gmake[1]: выход из каталога «/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp»
gmake: *** [Makefile:126: cmTC_3f2f1/fast] Ошибка 2

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_c587c/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_c587c.dir/build.make CMakeFiles/cmTC_c587c.dir/build
gmake[1]: вход в каталог «/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp»
Building C object CMakeFiles/cmTC_c587c.dir/CheckSymbolExists.c.o
/usr/bin/gcc   -fno-strict-aliasing    -o CMakeFiles/cmTC_c587c.dir/CheckSymbolExists.c.o   -c /home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_c587c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c587c.dir/link.txt --verbose=1
/usr/bin/gcc  -fno-strict-aliasing     -rdynamic CMakeFiles/cmTC_c587c.dir/CheckSymbolExists.c.o  -o cmTC_c587c 
CMakeFiles/cmTC_c587c.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
gmake[1]: *** [CMakeFiles/cmTC_c587c.dir/build.make:98: cmTC_c587c] Ошибка 1
gmake[1]: выход из каталога «/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp»
gmake: *** [Makefile:126: cmTC_c587c/fast] Ошибка 2

File /home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#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/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_7cdc3/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_7cdc3.dir/build.make CMakeFiles/cmTC_7cdc3.dir/build
gmake[1]: вход в каталог «/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp»
Building C object CMakeFiles/cmTC_7cdc3.dir/CheckFunctionExists.c.o
/usr/bin/gcc   -fno-strict-aliasing -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_7cdc3.dir/CheckFunctionExists.c.o   -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_7cdc3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7cdc3.dir/link.txt --verbose=1
/usr/bin/gcc  -fno-strict-aliasing -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_7cdc3.dir/CheckFunctionExists.c.o  -o cmTC_7cdc3 -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
gmake[1]: *** [CMakeFiles/cmTC_7cdc3.dir/build.make:98: cmTC_7cdc3] Ошибка 1
gmake[1]: выход из каталога «/home/user1/libhdfs3-downstream-master/libhdfs3/build/CMakeFiles/CMakeTmp»
gmake: *** [Makefile:126: cmTC_7cdc3/fast] Ошибка 2

please help to solve, thanks.

ferristseng commented 6 years ago

I believe I was seeing the same error, and it was related to the version of gcc. See if the change in #5 works

mturok commented 6 years ago

Just a note that I'm seeing the same issue, in building on ubuntu 16.04. Note my version of gcc doesn't have the error mentioned above - I'm running gcc 5.4.0, and dumpversion works as expected. It looks like the makefiles aren't aware that libdl and libpthread can be found in /lib/x86_64-linux-gnu. I tried using the ../bootstrap --dependency flag, but it didn't change the link line.