Skip to content

Instantly share code, notes, and snippets.

@chrish10e
Forked from d2rk/build.sh
Last active February 4, 2019 12:26
Show Gist options
  • Save chrish10e/889c362802dd781e7ab6cf991a8121bd to your computer and use it in GitHub Desktop.
Save chrish10e/889c362802dd781e7ab6cf991a8121bd to your computer and use it in GitHub Desktop.
dlib for AWS lambda
$ sudo yum install -y python34 blas-devel lapack-devel gcc-c++ cmake python34-devel git
$ alias python=python3
$ wget --no-check-certificate -P /tmp https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2
$ tar xvf /tmp/boost_1_64_0.tar.bz2 -C /tmp
$ cd /tmp
$ cd boost_1_64_0
$ ./bootstrap.sh --with-libraries=python -with-python=/usr/bin/python3.4m --with-python-root=/usr/bin/python3.4m
$ sudo ./b2 install
# Wait a long time
$ cd..
$ wget --no-check-certificate -P /tmp http://flydata-rpm.s3-website-us-east-1.amazonaws.com/patchelf-0.8.tar.gz
$ tar xvf /tmp/patchelf-0.8.tar.gz -C /tmp
$ cd patchelf-0.8 && ./configure && make && sudo make install
$ cd ..
$ git clone https://github.com/davisking/dlib.git
$ cd dlib/python_examples/
$ mkdir build && cd build
$ cmake -D USE_SSE4_INSTRUCTIONS:BOOL=ON ../../tools/python
$ cmake --build . --config Release --target install
$ cd ..
$ mkdir ~/dlib
$ cp dlib.so ~/dlib/__init__.so
$ cp /tmp/boost_1_64_0/stage/lib/libboost_python3.so.1.64.0 ~/dlib/
$ touch ~/dlib/__init__.py
$ patchelf --set-rpath '$ORIGIN' ~/dlib/__init__.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment