最終更新:2020-03-12 (木) 14:39:45 (1504d)  

dlib/ビルド
Top / dlib / ビルド

dlib/ビルド/Windows

dlib/ビルド/Linux?

メモ

  • メモリが2.5GBくらい必要

libcv-dev入れた

  • user@X240:~/dlib-19.4/examples/build$ cmake ..
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- C++11 activated.
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
     *****************************************************************************
     *** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ***
     *** Make sure libx11-dev is installed if you want GUI support.            ***
     *** On Ubuntu run: sudo apt-get install libx11-dev                        ***
     *****************************************************************************
    -- Searching for BLAS and LAPACK
    -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
    -- Checking for module 'cblas'
    --   No package 'cblas' found
    -- Checking for module 'lapack'
    --   No package 'lapack' found
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of void*
    -- Check size of void* - done
     *****************************************************************************
     *** No BLAS library found so using dlib's built in BLAS.  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                 ***
     *** Or you can easily install OpenBLAS from source by downloading the     ***
     *** source tar file from http://www.openblas.net, extracting it, and      ***
     *** running:                                                              ***
     ***    make; sudo make install                                            ***
     *****************************************************************************
    CUDA_TOOLKIT_ROOT_DIR not found or specified
    -- Could NOT find CUDA (missing:  CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
    -- *** cuDNN V5.0 OR GREATER NOT FOUND.  DLIB WILL NOT USE CUDA. ***
    -- *** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder.
    No GUI support, so we won't build the dnn_face_recognition_ex example.
    No GUI support, so we won't build the dnn_mmod_ex example.
    No GUI support, so we won't build the dnn_mmod_face_detection_ex example.
    No GUI support, so we won't build the random_cropper_ex example.
    No GUI support, so we won't build the dnn_mmod_dog_hipsterizer example.
    No GUI support, so we won't build the dnn_imagenet_ex example.
    No GUI support, so we won't build the 3d_point_cloud_ex example.
    No GUI support, so we won't build the bayes_net_gui_ex example.
    No GUI support, so we won't build the face_detection_ex example.
    No GUI support, so we won't build the face_landmark_detection_ex example.
    No GUI support, so we won't build the fhog_ex example.
    No GUI support, so we won't build the fhog_object_detector_ex example.
    No GUI support, so we won't build the gui_api_ex example.
    No GUI support, so we won't build the hough_transform_ex example.
    No GUI support, so we won't build the image_ex example.
    No GUI support, so we won't build the mpc_ex example.
    No GUI support, so we won't build the object_detector_advanced_ex example.
    No GUI support, so we won't build the object_detector_ex example.
    No GUI support, so we won't build the one_class_classifiers_ex example.
    No GUI support, so we won't build the surf_ex example.
    No GUI support, so we won't build the train_object_detector example.
    No GUI support, so we won't build the video_tracking_ex example.
    No GUI support, so we won't build the webcam_face_pose_ex example.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/user/dlib-19.4/examples/build

libopencv-dev入れた

  • user@X240:~/dlib-19.4/examples/build2$ cmake ..
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- C++11 activated.
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
    -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
    -- Looking for gethostbyname
    -- Looking for gethostbyname - found
    -- Looking for connect
    -- Looking for connect - found
    -- Looking for remove
    -- Looking for remove - found
    -- Looking for shmat
    -- Looking for shmat - found
    -- Looking for IceConnectionNumber in ICE
    -- Looking for IceConnectionNumber in ICE - found
    -- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
    -- Looking for png_create_read_struct
    -- Looking for png_create_read_struct - found
    -- Looking for jpeg_read_header
    -- Looking for jpeg_read_header - found
    -- Searching for BLAS and LAPACK
    -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
    -- Checking for module 'cblas'
    --   No package 'cblas' found
    -- Checking for module 'lapack'
    --   No package 'lapack' found
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of void*
    -- Check size of void* - done
     *****************************************************************************
     *** No BLAS library found so using dlib's built in BLAS.  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                 ***
     *** Or you can easily install OpenBLAS from source by downloading the     ***
     *** source tar file from http://www.openblas.net, extracting it, and      ***
     *** running:                                                              ***
     ***    make; sudo make install                                            ***
     *****************************************************************************
    CUDA_TOOLKIT_ROOT_DIR not found or specified
    -- Could NOT find CUDA (missing:  CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
    -- *** cuDNN V5.0 OR GREATER NOT FOUND.  DLIB WILL NOT USE CUDA. ***
    -- *** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder.
    OpenCV not found, so we won't build the webcam_face_pose_ex example.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/user/dlib-19.4/examples/build2

Red Hat Developer Toolset 1.0

  • たぶんGCCのバージョンが低くてエラー
    [user@localhost examples]$ scl enable devtoolset-1.0 bash
    [user@localhost examples]$ gcc --version
    gcc (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5)
    Copyright (C) 2012 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    [user@localhost examples]$ cmake --version
    cmake version 3.0.0
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    [user@localhost examples]$ mkdir build
    [user@localhost examples]$ cd build/
    [user@localhost build]$ cmake ..
    -- The C compiler identification is GNU 4.7.0
    -- The CXX compiler identification is GNU 4.7.0
    -- Check for working C compiler: /opt/centos/devtoolset-1.0/root/usr/bin/cc
    -- Check for working C compiler: /opt/centos/devtoolset-1.0/root/usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /opt/centos/devtoolset-1.0/root/usr/bin/c++
    -- Check for working CXX compiler: /opt/centos/devtoolset-1.0/root/usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Performing Test COMPILER_SUPPORTS_CXX11
    -- Performing Test COMPILER_SUPPORTS_CXX11 - Success
    -- Performing Test COMPILER_SUPPORTS_CXX0X
    -- Performing Test COMPILER_SUPPORTS_CXX0X - Success
    -- C++11 activated (compiler doesn't have full C++11 support).
    -- Looking for include file pthread.h
    -- Looking for include file pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Looking for XOpenDisplay in /usr/lib64/libX11.so
    -- Looking for XOpenDisplay in /usr/lib64/libX11.so - found
    -- Looking for gethostbyname
    -- Looking for gethostbyname - found
    -- Looking for connect
    -- Looking for connect - found
    -- Looking for remove
    -- Looking for remove - found
    -- Looking for shmat
    -- Looking for shmat - found
    -- Found X11: /usr/lib64/libX11.so
    -- Searching for BLAS and LAPACK
    -- Found PkgConfig: /usr/bin/pkg-config (found version "0.21") 
    -- checking for module 'cblas'
    --   package 'cblas' not found
    -- checking for module 'lapack'
    --   package 'lapack' not found
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of void*
    -- Check size of void* - done
     *****************************************************************************
     *** No BLAS library found so using dlib's built in BLAS.  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                 ***
     *** Or you can easily install OpenBLAS from source by downloading the     ***
     *** source tar file from http://www.openblas.net, extracting it, and      ***
     *** running:                                                              ***
     ***    make; sudo make install                                            ***
     *****************************************************************************
    CUDA_TOOLKIT_ROOT_DIR not found or specified
    -- Could NOT find CUDA (missing:  CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
    -- *** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***
    OpenCV not found, so we won't build the webcam_face_pose_ex example.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/user/dlib-19.4/examples/build
    [user@localhost build]$ cmake --build . --config Release
    Scanning dependencies of target dlib
    [  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o
    [  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o
    [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o
    [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o
    [  3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o
    [  3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o
    [  4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o
    [  4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o
    [  5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o
    [  5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o
    [  5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/unicode/unicode.cpp.o
    [  6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o
    [  6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/mnist.cpp.o
    [  7%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dnn/cpu_dlib.cpp.o
    In file included from /home/user/dlib-19.4/dlib/dnn/cpu_dlib.cpp:9:0:
    /home/user/dlib-19.4/dlib/dnn/tensor_tools.h:1305:36: error: ‘<::’ cannot begin a template-argument list [-fpermissive]
    /home/user/dlib-19.4/dlib/dnn/tensor_tools.h:1305:36: note: ‘<:’ is an alternate spelling for ‘[’. Insert whitespace between ‘<’ and ‘::’
    /home/user/dlib-19.4/dlib/dnn/tensor_tools.h:1305:36: note: (if you use ‘-fpermissive’ G++ will accept your code)
    gmake[2]: *** [dlib_build/CMakeFiles/dlib.dir/dnn/cpu_dlib.cpp.o] Error 1
    gmake[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
    gmake: *** [all] Error 2

Red Hat Developer Toolset 2.0

  • ビルドできた
    [user@localhost build]$ scl enable devtoolset-2 bash
    [user@localhost build]$ cmake ..
    -- The C compiler identification is GNU 4.8.2
    -- The CXX compiler identification is GNU 4.8.2
    -- Check for working C compiler: /opt/rh/devtoolset-2/root/usr/bin/cc
    -- Check for working C compiler: /opt/rh/devtoolset-2/root/usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /opt/rh/devtoolset-2/root/usr/bin/c++
    -- Check for working CXX compiler: /opt/rh/devtoolset-2/root/usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- C++11 activated.
    -- Looking for include file pthread.h
    -- Looking for include file pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Looking for XOpenDisplay in /usr/lib64/libX11.so
    -- Looking for XOpenDisplay in /usr/lib64/libX11.so - found
    -- Looking for gethostbyname
    -- Looking for gethostbyname - found
    -- Looking for connect
    -- Looking for connect - found
    -- Looking for remove
    -- Looking for remove - found
    -- Looking for shmat
    -- Looking for shmat - found
    -- Found X11: /usr/lib64/libX11.so
    -- Searching for BLAS and LAPACK
    -- Found PkgConfig: /usr/bin/pkg-config (found version "0.21") 
    -- checking for module 'cblas'
    --   package 'cblas' not found
    -- checking for module 'lapack'
    --   package 'lapack' not found
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of void*
    -- Check size of void* - done
     *****************************************************************************
     *** No BLAS library found so using dlib's built in BLAS.  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                 ***
     *** Or you can easily install OpenBLAS from source by downloading the     ***
     *** source tar file from http://www.openblas.net, extracting it, and      ***
     *** running:                                                              ***
     ***    make; sudo make install                                            ***
     *****************************************************************************
    CUDA_TOOLKIT_ROOT_DIR not found or specified
    -- Could NOT find CUDA (missing:  CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
    -- *** cuDNN V5.0 OR GREATER NOT FOUND.  DLIB WILL NOT USE CUDA. ***
    -- *** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder.
    OpenCV not found, so we won't build the webcam_face_pose_ex example.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/user/dlib-19.4/examples/build