Installation - matiasdelellis/pdlib GitHub Wiki
Installation
Distribution Packages
Ideally, you will want to use precompiled packages and we prepared PDLib PHP extension for some systems. See the Packages documentation. If you are not lucky you should compile it as described below.
Build
Requirements
- Dlib 19.13+
- PHP 7.0+
- C++11
- libx11-dev (on Ubuntu:
sudo apt-get install libx11-dev
)
Recommended
- BLAS library
If no BLAS library found - dlib's built in BLAS will be used. However, if you install an optimized BLAS such as OpenBLAS or the Intel MKL your code will run faster. On Ubuntu you can install OpenBLAS by executing:sudo apt-get install libopenblas-dev liblapack-dev
Dependencies
Dlib
Install Dlib as shared library
git clone https://github.com/davisking/dlib.git
cd dlib/dlib
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
make
sudo make install
Build and install
git clone https://github.com/goodspb/pdlib.git
cd pdlib
phpize
./configure --enable-debug
make
sudo make install
Configure PHP to use it
vim youpath/php.ini
Append the content below into php.ini
[pdlib]
extension="pdlib.so"
Tests
For tests, you will need to have bz2 extension installed. On Ubuntu, it boils to:
sudo apt-get install php-bz2
After you successfully compiled everything, just run:
make test