HowTo build dlib on TX1(AArch64 CPU)
- (Optional) For the best performance, first install openBLAS.
$ sudo apt-get install libopenblas-dev
- Download latest dlib stable archive [here]
- Extract and change working directory into it. Then creat a directory to put our build file.
(dlib src dir)$ mkdir build
(dlib src dir)$ cd build
(dlib src dir)/build$ cmake .. -DDLIB_USE_CUDA=ON -DCMAKE_C_FLAGS ="-O3 -fprofile-use -DENABLE_NEON" -DNEON=ON -DDLIB_PNG_SUPPORT=ON -DDLIB_JPEG_SUPPORT=ON
(dlib src dir)$ cmake --build .
- Install, done.
sudo make install
For some other ARM platforms, you might face a memory exhausted problem while compiling. Here is the solution below.
- Open
/etc/dphys-swapfile
with your favorite editor. For example I use vi.
$ sudo vi /etc/dphys-swapfile
- Change
CONF_SWAPSIZE=100
toCONF_SWAPSIZE=1024
- Then
$ sudo /etc/init.d/dphys-swapfile restart