WPJiang / HWTL_SDU-ANNS

57 stars 5 forks source link

Provide instructions where to find and build dependencies #2

Open ccoulombe opened 1 year ago

ccoulombe commented 1 year ago

Please provide build instructions for dependencies (qsgngtlib and libngt) and where to find them. Pre-built binaries of libraries are often not functionnal and requires a very recent GLIBC

ccoulombe commented 1 year ago

In order to build NGT locally :

module load python/3.10 flexiblas -imkl python-build-bundle
virtualenv --no-download --clear ~/ENV && source ~/ENV/bin/activate
git clone https://github.com/yahoojapan/NGT.git -b v2.0.12 && cd NGT/
sed -i -e 's/lapack blas/flexiblas/' lib/NGT/CMakeLists.txt 
cmake -B _build -S . -DCMAKE_INSTALL_PREFIX=$VIRTUAL_ENV/
cmake --build _build --verbose --parallel 16
cmake --install _build 
cd python/
sed -i -e "s/'blas', 'lapack'/'flexiblas'/" -e "s/'-march=native',//" setup.py 
LIBRARY_PATH=$LIBRARY_PATH:$VIRTUAL_ENV/lib python setup.py build
pip install .
patchelf --add-rpath $VIRTUAL_ENV/lib $VIRTUAL_ENV/bin/ngt $VIRTUAL_ENV/bin/qbg $VIRTUAL_ENV/lib/python3.10/site-packages/ngtpy.cpython-310-x86_64-linux-gnu.so 
cd
python -c 'import ngtpy'