isearch/dockerfiles/env/Dockerfile
2022-06-06 15:41:48 +08:00

79 lines
3.9 KiB
Docker

FROM centos:centos7.2.1511
RUN yum install -y wget pcre pcre-devel gcc gcc-c++ make zlib-devel sudo openssh-server vim lrzsz openssl-devel &&\
yum install -y crypto-policies snappy-devel psmisc git epel-release jq && \
yum install -y autoconf automake libtool gcc-gfortran bzip2 jq &&\
yum clean all && \
cd /usr/local &&\
wget http://storage.jd.com/lbs-search-acc/gcc-4.9.3.tar.bz2 &&\
tar jxvf gcc-4.9.3.tar.bz2 &&\
cd gcc-4.9.3 &&\
wget http://storage.jd.com/lbs-search-acc/mpfr-2.4.2.tar.bz2 &&\
wget http://storage.jd.com/lbs-search-acc/gmp-4.3.2.tar.bz2 &&\
wget http://storage.jd.com/lbs-search-acc/mpc-0.8.1.tar.gz &&\
wget http://storage.jd.com/lbs-search-acc/isl-0.12.2.tar.bz2 &&\
wget http://storage.jd.com/lbs-search-acc/cloog-0.18.1.tar.gz &&\
wget http://storage.jd.com/lbs-search-acc/download_prerequisites &&\
mv download_prerequisites ./contrib/download_prerequisites &&\
chmod +x ./contrib/download_prerequisites &&\
./contrib/download_prerequisites &&\
cd .. &&\
mkdir build-gcc &&\
cd build-gcc &&\
../gcc-4.9.3/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++ --enable-plugin --enable-initfini-array --disable-libgcj --enable-gnu-indirect-function --with-tune=generic --disable-multilib &&\
make -j8 &&\
make install
RUN useradd --create-home --no-log-init --shell /bin/bash isearch && echo "isearch:isearch" | chpasswd && \
mkdir -p /env/app &&\
cd /env/app/ &&\
wget --no-check-certificate https://cmake.org/files/v3.21/cmake-3.21.2.tar.gz &&\
tar xf cmake-3.21.2.tar.gz &&\
cd /env/app/cmake-3.21.2 &&\
./bootstrap &&\
gmake &&\
gmake install &&\
cd /usr/bin &&\
ln -s cmake3 cmake
RUN cd /usr/local &&\
git clone https://github.com/facebook/rocksdb.git &&\
cd rocksdb &&\
git checkout -b 6.6.0 ad528fe5ca08dafff47d79c85abbf3e1fbb21568 &&\
make shared_lib &&\
ln -s /usr/local/rocksdb/librocksdb.so.6.6.0 /lib64/librocksdb.so.6 &&\
cd /usr/local &&\
git clone https://github.com/gflags/gflags.git &&\
cd gflags &&\
git checkout -b 2.2 v2.2.2 &&\
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -G "Unix Makefiles" . &&\
make && make install &&\
ldconfig &&\
ln -s /usr/local/lib/libgflags.so.2.2 /lib64
RUN yum install -y unzip gcc-gfortran && cd /usr/local &&\
wget http://storage.jd.com/lbs-search-acc/protobuf-3.12.2.zip &&\
unzip protobuf-3.12.2.zip &&\
cd protobuf-3.12.2 &&\
./autogen.sh &&\
./configure &&\
make -j8 && make install &&\
ln -s /usr/local/lib/libprotobuf.so.23.0.2 /lib64/libprotobuf.so.23 &&\
ln -s /usr/local/lib/libprotoc.so.23.0.2 /lib64/libprotoc.so.23
RUN yum install openblas-devel.x86_64 -y && cd /usr/local &&\
wget http://storage.jd.com/lbs-search-acc/lapack-3.10.0.tar.gz &&\
tar zxvf lapack-3.10.0.tar.gz &&\
cd lapack-3.10.0 &&\
mkdir build &&\
cd build &&\
cmake -DCMAKE_INSTALL_LIBDIR=$HOME/.local/lapack .. &&\
cmake --build . -j --target install &&\
ln -s /usr/local/lapack-3.10.0/build/lib/liblapack.a /lib64/ &&\
cd /usr/local &&\
wget http://storage.jd.com/lbs-search-acc/faiss-main.zip &&\
unzip faiss-main.zip &&\
cd faiss-main &&\
cmake -B build . -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DBLA_VENDOR=Generic -DBLAS_LIBRARIES=/lib64/libopenblas.so -DLAPACK_LIBRARIES=/lib64/liblapack.a &&\
cd build/ &&\
make -j8 && make install &&\
ln -s /usr/local/faiss-main/build/faiss/libfaiss.so /lib64/