Hi,
I’m trying to compile xgboost on centos7 with gcc-8 installed from scl-repo.
The xgboost version is 1.0.2.
the commands that I run are:
mkdir build; cd build
HADOOP_HDFS_HOME=/usr/hdp/3.1.0.0-78/hadoop
cmake3 … -DUSE_HDFS=ON -DHDFS_INCLUDE_DIR=/usr/hdp/3.1.0.0-78/usr/include
make
and then I have this error:
Scanning dependencies of target xgboost
[ 80%] Linking CXX shared library …/lib/libxgboost.so
/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: /usr/hdp/3.1.0.0-78/hadoop/lib/native/libhdfs.a(hdfs.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: /usr/hdp/3.1.0.0-78/hadoop/lib/native/libhdfs.a(exception.c.o): relocation R_X86_64_32 against
.rodata.str1.8’ can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: /usr/hdp/3.1.0.0-78/hadoop/lib/native/libhdfs.a(jni_helper.c.o): relocation R_X86_64_32 against hidden symbol hdfsHashMutex' can not be used when making a shared object /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: /usr/hdp/3.1.0.0-78/hadoop/lib/native/libhdfs.a(mutexes.c.o): relocation R_X86_64_32 against
.rodata.str1.8’ can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: /usr/hdp/3.1.0.0-78/hadoop/lib/native/libhdfs.a(thread_local_storage.c.o): relocation R_X86_64_32 against `.rodata.str1.8’ can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/xgboost.dir/build.make:173: …/lib/libxgboost.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/xgboost.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Which parameters should I change to make them use libhdfs.so?