Xtra-Computing / FedTree

A tree-based federated learning system (MLSys 2023)
https://fedtree.readthedocs.io/en/latest/index.html
Apache License 2.0
140 stars 38 forks source link

Installation error #44

Open mahmoudsajjadi opened 1 year ago

mahmoudsajjadi commented 1 year ago

Hi,

I am trying to install the FedTree and I face following error after running make - j:

[ 99%] Linking CXX shared library ../../lib/libft_grpc_proto.so [ 99%] Built target ft_grpc_proto [ 99%] Linking CXX shared library ../../lib/libFedTree.so /usr/bin/ld: /usr/local/lib/libntl.a(ZZ.o): relocation R_X86_64_TPOFF32 against _ZN3NTLL8iodigitsE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(fileio.o): relocation R_X86_64_TPOFF32 against_ZZN3NTL8UniqueIDB5cxx11EvE37_ntl_hidden_variable_tls_local_ptr_ID' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(lip.o): relocation R_X86_64_TPOFF32 against _ZZ10_ntl_gswapPP17_ntl_gbigint_bodyS1_E36_ntl_hidden_variable_tls_local_ptr_t' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(tools.o): relocation R_X86_64_TPOFF32 against symbol_ZN3NTL16ErrorMsgCallbackE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(thread.o): relocation R_X86_64_TPOFF32 against _ZZN3NTL15CurrentThreadIDB5cxx11EvE37_ntl_hidden_variable_tls_local_ptr_ID' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(BasicThreadPool.o): relocation R_X86_64_TPOFF32 against_ZZN3NTLL49_ntl_hidden_function_tls_access_NTLThreadPool_stgEvE52_ntl_hidden_variable_tls_local_ptr_NTLThreadPool_stg' can not be used when making a shared object; recompile with -fPIC collect2: error: ld returned 1 exit status make[2]: [src/FedTree/CMakeFiles/FedTree.dir/build.make:510: lib/libFedTree.so] Error 1 make[1]: [CMakeFiles/Makefile2:5489: src/FedTree/CMakeFiles/FedTree.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

I will appreciate it if you could help me to solve the problem

QinbinLi commented 1 year ago

Hi @mahmoudsajjadi ,

Did you set SHARED=on when installing ntl? See below for an example.

wget https://libntl.org/ntl-11.4.4.tar.gz
tar -xvf ntl-11.4.4.tar.gz
cd ntl-11.4.4/src
./configure SHARED=on
make
make check
sudo make install
mahmoudsajjadi commented 1 year ago

Hi @QinbinLi ,

Thank you and that works.

Another question is that is python version only works with `GLIBC_2.32'? since I saw the following error after trying to run python examples.

Traceback (most recent call last): File "/c/python/fedtree-2/FedTree/python/examples/regressor_example.py", line 1, in from fedtree import FLRegressor File "/c/python/fedtree-2/FedTree/python/examples/fedtree.py", line 36, in fedtree = CDLL(lib_path) File "/home/mahmoud/anaconda3/lib/python3.9/ctypes/init.py", line 382, in init self._handle = _dlopen(self._name, mode) OSError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /c/python/fedtree-2/FedTree/python/examples/../../build/lib/libFedTree.so)

QinbinLi commented 1 year ago

Hi @mahmoudsajjadi ,

Other versions should also work. I successfully installed and tested the python version on a machine with GLIBC 2.31. How did you install FedTree and python version?

mahmoudsajjadi commented 1 year ago

Hi @QinbinLi

Firstly I installed FedTree on Ubuntu 20.04.3 LTS (ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31) based on the tutorial. After complete installation, then when I am trying to install it on Python 3.9.7 it shows the following error:

Traceback (most recent call last): File "", line 1, in File "/home/mahmoud/anaconda3/lib/python3.9/site-packages/fedtree-1.0.4-py3.9.egg/fedtree/init.py", line 2, in from .fedtree import * File "/home/mahmoud/anaconda3/lib/python3.9/site-packages/fedtree-1.0.4-py3.9.egg/fedtree/fedtree.py", line 43, in fedtree = CDLL(lib_path) File "/home/mahmoud/anaconda3/lib/python3.9/ctypes/init.py", line 382, in init self._handle = _dlopen(self._name, mode) OSError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /mnt/c/python/fedtree-2/FedTree/build/lib/libFedTree.so)

On the other hand, I tried to install FedTree on Ubuntu 22.04, I got the following error after cmake command in the installation:

-- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5")
Complie without CUDA -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5") found components: CXX -- Populating grpc -- Configuring done -- Generating done -- Build files have been written to: /home/mahmoud/python/fedtree-2/FedTree/build/_deps/grpc-subbuild [ 11%] Performing update step for 'grpc-populate' [ 22%] No patch step for 'grpc-populate' [ 33%] No configure step for 'grpc-populate' [ 44%] No build step for 'grpc-populate' [ 55%] No install step for 'grpc-populate' [ 66%] No test step for 'grpc-populate' [ 77%] Completed 'grpc-populate' [100%] Built target grpc-populate -- -- 3.14.0.0 CMake Deprecation Warning at build/_deps/grpc-src/third_party/zlib/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Configuring done CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: GMPXX_LIB linked by target "FedTree_DIST" in directory /home/mahmoud/python/fedtree-2/FedTree/src/FedTree linked by target "FedTree" in directory /home/mahmoud/python/fedtree-2/FedTree/src/FedTree

-- Generating done CMake Generate step failed. Build files cannot be regenerated correctly.