matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
519 stars 46 forks source link

The library pdlib is not available #301

Closed Aspire1Inspire2 closed 4 years ago

Aspire1Inspire2 commented 4 years ago

Hi I am sure you are bothered many times by this issue. As I searched in the resolved issue, there seems to be three issues resolved related to this but none of them helped my case.

Steps to reproduce

  1. I installed using apt
  2. I installed by compiling the source
  3. neither works, the installation in nextcloud app store still reminds me:
    App "Face Recognition" cannot be installed because the following dependencies are not fulfilled: The library pdlib is not available. 

Server configuration

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Client configuration

Logs

Background task log with debug.

sudo -u apache php occ -vvv face:background_job Note: the app cannot be installed because lack of dependency. ``` In Application.php line 583: [Symfony\Component\Console\Exception\NamespaceNotFoundException] There are no commands defined in the "face" namespace. Exception trace: at /var/www/html/nextcloud/3rdparty/symfony/console/Application.php:583 Symfony\Component\Console\Application->findNamespace() at /var/www/html/nextcloud/3rdparty/symfony/console/Application.php:632 Symfony\Component\Console\Application->find() at /var/www/html/nextcloud/3rdparty/symfony/console/Application.php:236 Symfony\Component\Console\Application->doRun() at /var/www/html/nextcloud/3rdparty/symfony/console/Application.php:148 Symfony\Component\Console\Application->run() at /var/www/html/nextcloud/lib/private/Console/Application.php:214 OC\Console\Application->run() at /var/www/html/nextcloud/console.php:99 require_once() at /var/www/html/nextcloud/occ:11 ```

My detailed installation log:

``` >>>apt remove --purge php7.0-pdlib libdlib19 Reading package lists... Done Building dependency tree Reading state information... Done Package 'libdlib19' is not installed, so not removed Package 'php7.0-pdlib' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. >>>apt remove --purge php7.0-pdlib libdlib19 Reading package lists... Done Building dependency tree Reading state information... Done Package 'libdlib19' is not installed, so not removed Package 'php7.0-pdlib' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ``` ``` >>>apt install php7.0-pdlib Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libdlib19 libgfortran4 libopenblas-base The following NEW packages will be installed: libdlib19 libgfortran4 libopenblas-base php7.0-pdlib 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 9,299 kB of archives. After this operation, 62.3 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgfortran4 amd64 7.5.0-3ubuntu1~18.04 [492 kB] Get:2 https://repo.delellis.com.ar bionic/bionic amd64 libdlib19 amd64 19.19-1 [4,034 kB] Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libopenblas-base amd64 0.2.20+ds-4 [3,964 kB] Get:4 https://repo.delellis.com.ar bionic/bionic amd64 php7.0-pdlib amd64 1.0+git20180830-4 [810 kB] Fetched 9,299 kB in 1s (8,592 kB/s) Selecting previously unselected package libgfortran4:amd64. (Reading database ... 216321 files and directories currently installed.) Preparing to unpack .../libgfortran4_7.5.0-3ubuntu1~18.04_amd64.deb ... Unpacking libgfortran4:amd64 (7.5.0-3ubuntu1~18.04) ... Selecting previously unselected package libopenblas-base:amd64. Preparing to unpack .../libopenblas-base_0.2.20+ds-4_amd64.deb ... Unpacking libopenblas-base:amd64 (0.2.20+ds-4) ... Selecting previously unselected package libdlib19:amd64. Preparing to unpack .../libdlib19_19.19-1_amd64.deb ... Unpacking libdlib19:amd64 (19.19-1) ... Selecting previously unselected package php7.0-pdlib. Preparing to unpack .../php7.0-pdlib_1.0+git20180830-4_amd64.deb ... Unpacking php7.0-pdlib (1.0+git20180830-4) ... Setting up libgfortran4:amd64 (7.5.0-3ubuntu1~18.04) ... Setting up libopenblas-base:amd64 (0.2.20+ds-4) ... update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3 to provide /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-gnu) in auto mode update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas/liblapack.so.3 to provide /usr/lib/x86_64-linux-gnu/liblapack.so.3 (liblapack.so.3-x86_64-linux-gnu) in auto mode Setting up libdlib19:amd64 (19.19-1) ... Setting up php7.0-pdlib (1.0+git20180830-4) ... Processing triggers for libc-bin (2.27-3ubuntu1.2) ... ```

As noted, my php is 7.2, is this not working because of that? I am wildly guessing so. So I purged it and install from source. EVERYTHING is good except for the kindly missing lib reminder from the app store. I did everything as root.

``` >>>pwd /opt/dlib/dlib >>>mkdir build >>>cd build >>>cmake -DBUILD_SHARED_LIBS=ON .. -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.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 -- Using CMake version: 3.10.2 -- Compiling dlib version: 19.20.99 -- 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 -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/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/lib/x86_64-linux-gnu/libX11.so -- Found system copy of libjpeg: /usr/lib/x86_64-linux-gnu/libjpeg.so -- Searching for BLAS and LAPACK -- 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") -- DID NOT FIND CUDA -- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA -- C++11 activated. -- Configuring done -- Generating done -- Build files have been written to: /opt/dlib/dlib/build ``` ``` >>>make Scanning dependencies of target dlib [ 1%] Building CXX object CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o [ 2%] Building CXX object CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o [ 3%] Building CXX object CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o [ 4%] Building CXX object CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o [ 5%] Building CXX object CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o [ 6%] Building CXX object CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o [ 7%] Building CXX object CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o [ 8%] Building CXX object CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o [ 9%] Building CXX object CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o [ 10%] Building CXX object CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o [ 12%] Building CXX object CMakeFiles/dlib.dir/unicode/unicode.cpp.o [ 13%] Building CXX object CMakeFiles/dlib.dir/test_for_odr_violations.cpp.o [ 14%] Building CXX object CMakeFiles/dlib.dir/sockets/sockets_kernel_1.cpp.o [ 15%] Building CXX object CMakeFiles/dlib.dir/bsp/bsp.cpp.o [ 16%] Building CXX object CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_1.cpp.o [ 17%] Building CXX object CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_2.cpp.o [ 18%] Building CXX object CMakeFiles/dlib.dir/dir_nav/dir_nav_extensions.cpp.o [ 19%] Building CXX object CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o [ 20%] Building CXX object CMakeFiles/dlib.dir/logger/extra_logger_headers.cpp.o [ 21%] Building CXX object CMakeFiles/dlib.dir/logger/logger_kernel_1.cpp.o [ 23%] Building CXX object CMakeFiles/dlib.dir/logger/logger_config_file.cpp.o [ 24%] Building CXX object CMakeFiles/dlib.dir/misc_api/misc_api_kernel_1.cpp.o [ 25%] Building CXX object CMakeFiles/dlib.dir/misc_api/misc_api_kernel_2.cpp.o [ 26%] Building CXX object CMakeFiles/dlib.dir/sockets/sockets_extensions.cpp.o [ 27%] Building CXX object CMakeFiles/dlib.dir/sockets/sockets_kernel_2.cpp.o [ 28%] Building CXX object CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf.cpp.o [ 29%] Building CXX object CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf_unbuffered.cpp.o [ 30%] Building CXX object CMakeFiles/dlib.dir/server/server_kernel.cpp.o [ 31%] Building CXX object CMakeFiles/dlib.dir/server/server_iostream.cpp.o [ 32%] Building CXX object CMakeFiles/dlib.dir/server/server_http.cpp.o [ 34%] Building CXX object CMakeFiles/dlib.dir/threads/multithreaded_object_extension.cpp.o [ 35%] Building CXX object CMakeFiles/dlib.dir/threads/threaded_object_extension.cpp.o [ 36%] Building CXX object CMakeFiles/dlib.dir/threads/threads_kernel_1.cpp.o [ 37%] Building CXX object CMakeFiles/dlib.dir/threads/threads_kernel_2.cpp.o [ 38%] Building CXX object CMakeFiles/dlib.dir/threads/threads_kernel_shared.cpp.o [ 39%] Building CXX object CMakeFiles/dlib.dir/threads/thread_pool_extension.cpp.o [ 40%] Building CXX object CMakeFiles/dlib.dir/threads/async.cpp.o [ 41%] Building CXX object CMakeFiles/dlib.dir/timer/timer.cpp.o [ 42%] Building CXX object CMakeFiles/dlib.dir/stack_trace.cpp.o [ 43%] Building CXX object CMakeFiles/dlib.dir/cuda/cpu_dlib.cpp.o [ 45%] Building CXX object CMakeFiles/dlib.dir/cuda/tensor_tools.cpp.o [ 46%] Building CXX object CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o [ 47%] Building CXX object CMakeFiles/dlib.dir/data_io/mnist.cpp.o [ 48%] Building CXX object CMakeFiles/dlib.dir/global_optimization/global_function_search.cpp.o [ 49%] Building CXX object CMakeFiles/dlib.dir/filtering/kalman_filter.cpp.o In file included from /opt/dlib/dlib/filtering/../matrix.h:11:0, from /opt/dlib/dlib/filtering/kalman_filter.h:7, from /opt/dlib/dlib/filtering/kalman_filter.cpp:6: /opt/dlib/dlib/filtering/../matrix/matrix_la.h: In function ‘long int dlib::svd4(dlib::svd_u_mode, bool, const dlib::matrix_exp&, dlib::matrix&, dlib::matrix&, dlib::matrix&) [with EXP = dlib::matrix_op, dlib::row_major_layout> > > > >; long int qN = 1; long int qX = 1; long int uM = 1; long int uN = 1; long int vM = 2; long int vN = 1; MM1 = dlib::memory_manager_stateless_kernel_1; MM2 = dlib::memory_manager_stateless_kernel_1; MM3 = dlib::memory_manager_stateless_kernel_1; L1 = dlib::row_major_layout]’: /opt/dlib/dlib/filtering/../matrix/matrix_la.h:225:32: warning: iteration 1 invokes undefined behavior [-Waggressive-loop-optimizations] y = abs(q(i)) + abs(e(i)); ~~~^~~~~~ /opt/dlib/dlib/filtering/../matrix/matrix_la.h:163:20: note: within this loop for (i=0; i>>make install too long, paste only the last part -- Up-to-date: /usr/local/include/dlib/memory_manager -- Up-to-date: /usr/local/include/dlib/memory_manager/memory_manager_kernel_2.h -- Up-to-date: /usr/local/include/dlib/memory_manager/memory_manager_kernel_3.h -- Up-to-date: /usr/local/include/dlib/memory_manager/memory_manager_kernel_abstract.h -- Up-to-date: /usr/local/include/dlib/memory_manager/memory_manager_kernel_1.h -- Installing: /usr/local/include/dlib/config.h -- Installing: /usr/local/include/dlib/revision.h -- Installing: /usr/local/lib/cmake/dlib/dlib.cmake -- Installing: /usr/local/lib/cmake/dlib/dlib-release.cmake -- Installing: /usr/local/lib/cmake/dlib/dlibConfig.cmake -- Installing: /usr/local/lib/cmake/dlib/dlibConfigVersion.cmake -- Installing: /usr/local/lib/pkgconfig/dlib-1.pc ```

OK, so DLIB is installed. Go ahead with PDLIB

``` >>>phpize Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718 >>>./configure checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib checking for PHP extension directory... /usr/lib/php/20170718 checking for PHP installed headers prefix... /usr/include/php/20170718 checking if debug is enabled... no checking if zts is enabled... no checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... gawk checking for pdlib support... yes, shared checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking for pkg-config... checking for pkg-config... /usr/bin/pkg-config from pkgconfig: dlib version 19.20.99 checking how to print strings... printf checking for a sed that does not truncate output... (cached) /bin/sed checking for fgrep... /bin/grep -F checking for ld used by cc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking for gawk... (cached) gawk checking command to parse /usr/bin/nm -B output from cc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if cc supports -fno-rtti -fno-exceptions... no checking for cc option to produce PIC... -fPIC -DPIC checking if cc PIC flag -fPIC -DPIC works... yes checking if cc static flag -static works... yes checking if cc supports -c -o file.o... yes checking if cc supports -c -o file.o... (cached) yes checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate configure: creating ./config.status config.status: creating config.h config.status: config.h is unchanged config.status: executing libtool commands >>>make /bin/bash /opt/pdlib/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/pdlib.cc -o pdlib.lo libtool: compile: g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/pdlib.cc -fPIC -DPIC -o .libs/pdlib.o /bin/bash /opt/pdlib/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/chinese_whispers.cc -o src/chinese_whispers.lo libtool: compile: g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/chinese_whispers.cc -fPIC -DPIC -o src/.libs/chinese_whispers.o /bin/bash /opt/pdlib/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/face_detection.cc -o src/face_detection.lo libtool: compile: g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/face_detection.cc -fPIC -DPIC -o src/.libs/face_detection.o /bin/bash /opt/pdlib/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/face_landmark_detection.cc -o src/face_landmark_detection.lo libtool: compile: g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/face_landmark_detection.cc -fPIC -DPIC -o src/.libs/face_landmark_detection.o /bin/bash /opt/pdlib/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/face_recognition.cc -o src/face_recognition.lo libtool: compile: g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/face_recognition.cc -fPIC -DPIC -o src/.libs/face_recognition.o /bin/bash /opt/pdlib/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/cnn_face_detection.cc -o src/cnn_face_detection.lo libtool: compile: g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++11 -I. -I/opt/pdlib -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /opt/pdlib/src/cnn_face_detection.cc -fPIC -DPIC -o src/.libs/cnn_face_detection.o /bin/bash /opt/pdlib/libtool --mode=link g++ -DPHP_ATOM_INC -I/opt/pdlib/include -I/opt/pdlib/main -I/opt/pdlib -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -o pdlib.la -export-dynamic -avoid-version -prefer-pic -module -rpath /opt/pdlib/modules pdlib.lo src/chinese_whispers.lo src/face_detection.lo src/face_landmark_detection.lo src/face_recognition.lo src/cnn_face_detection.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lstdc++ -ldlib libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o .libs/pdlib.o src/.libs/chinese_whispers.o src/.libs/face_detection.o src/.libs/face_landmark_detection.o src/.libs/face_recognition.o src/.libs/cnn_face_detection.o -L/usr/local/lib -ldlib -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o -g -O2 -Wl,-rpath -Wl,/usr/local/lib -Wl,-soname -Wl,pdlib.so -o .libs/pdlib.so libtool: link: ( cd ".libs" && rm -f "pdlib.la" && ln -s "../pdlib.la" "pdlib.la" ) /bin/bash /opt/pdlib/libtool --mode=install cp ./pdlib.la /opt/pdlib/modules libtool: install: cp ./.libs/pdlib.so /opt/pdlib/modules/pdlib.so libtool: install: cp ./.libs/pdlib.lai /opt/pdlib/modules/pdlib.la libtool: finish: PATH="/opt/miniconda3/condabin:/root/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin" ldconfig -n /opt/pdlib/modules Libraries have been installed in: /opt/pdlib/modules If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. Build complete. Don't forget to run 'make test'. >>>make test zsh: correct 'test' to 'tests' [nyae]? n Build complete. Don't forget to run 'make test'. PHP : /usr/bin/php7.2 PHP_SAPI : cli PHP_VERSION : 7.2.24-0ubuntu0.18.04.6 ZEND_VERSION: 3.2.0 PHP_OS : Linux - Linux pegasus.bounceme.net 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 INI actual : /opt/pdlib/tmp-php.ini More .INIs : CWD : /opt/pdlib Extra dirs : VALGRIND : Not used TIME START 2020-07-22 01:48:19 PASS Check for pdlib presence [tests/001.phpt] PASS Basic tests for chinese_whispers [tests/chinese_whispers_basic.phpt] PASS Edge given in edges array for chinese_whispers functions is associative array [tests/chinese_whispers_edge_associative_array_error.phpt] PASS Edge elements given in edges array for chinese_whispers functions are not of long type [tests/chinese_whispers_edge_elements_not_long.phpt] PASS Edge given in edges array for chinese_whispers functions is not having all values to be arrays with 2 elements [tests/chinese_whispers_edge_not_2_element_error.phpt] PASS Edge given in edges array is not array for chinese_whispers functions [tests/chinese_whispers_edge_not_array_error.phpt] PASS Args given to chinese_whispers functions is not correct [tests/chinese_whispers_wrong_arg_type_error.phpt] PASS Testing CnnFaceDetection constructor without arguments [tests/cnn_face_detection_ctor_error.phpt] PASS Testing CnnFaceDetection constructor with model that do not exist [tests/cnn_face_detection_ctor_model_not_found_error.phpt] PASS Frontal face detection. [tests/dlib_face_detection.phpt] PASS Testing FaceLandmarkDetection constructor without arguments [tests/face_landmark_detection_ctor_error.phpt] PASS Testing FaceRecognition constructor without arguments [tests/face_recognition_ctor_error.phpt] SKIP Full test for face recognition - download models, detect faces, landmark detection and face recognition. [tests/integration_face_recognition.phpt] reason: bz2 extension missing TIME END 2020-07-22 01:48:20 TEST RESULT SUMMARY Exts skipped : 0 Exts tested : 15 Number of tests : 13 12 Tests skipped : 1 ( 7.7%) Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 0 ( 0.0%) ( 0.0%) Expected fail : 0 ( 0.0%) ( 0.0%) Tests passed : 12 ( 92.3%) (100.0%) Time taken : 1 seconds This report can be automatically sent to the PHP QA team at http://qa.php.net/reports and http://news.php.net/php.qa.reports This gives us a better understanding of PHP's behavior. If you don't want to send the report immediately you can choose option "s" to save it. You can then email it to qa-reports@lists.php.net later. Do you want to send this report now? [Yns]: n >>>make install Installing shared extensions: /usr/lib/php/20170718/ >>>cd ../pdlib-min-test-suite >>>make php-test php scripts/face_detect.php Welcome to pdlib min test suite for Facerecognition app... First we try to open the models... Done Processing file: input/Big Bang Theory.jpg Number of faces detected: 0 Processing file: input/Big Bang Theory.png Number of faces detected: 4 Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done Face landmarks... Done Face descriptor... Done >>>vi /etc/php/7.2/cli/php.ini Added [pdlib] extension="pdlib.so" >>>php -m | grep pdlib pdlib ```

However, still have this from next cloud: image

I restarted apache2, even the ubuntu system several times. Still seeing things like this. Coud anyone please offer some help? Spent so much time on this and currently a little frustrated.

matiasdelellis commented 4 years ago

Hi @Aspire1Inspire2 try restarting your sevice.

sudo systecmctl php-fpm apache

..or nginx

Aspire1Inspire2 commented 4 years ago

Hi, I restarted apache2, Ubuntu several times and still have the same issue. I cannot tell anything abnormal during installation as well. Is there any known reason to cause this?

matiasdelellis commented 4 years ago

Ohhhh...

>>>vi /etc/php/7.2/cli/php.ini
Added
[pdlib]
extension="pdlib.so"

>>>php -m | grep pdlib        
pdlib

vi /etc/php/7.2/cli/php.ini

Also add pdlib to /etc/php/7.2/fpm/php.ini

Aspire1Inspire2 commented 4 years ago

Hi, I edited the php fpm ini file and restarted php apache2 and ubuntu system. Still, the app store gives me "The library pdlib is not available" error.

Should I compile the app from source? Thank you for your help.

matiasdelellis commented 4 years ago

Hi @Aspire1Inspire2 The bionic packages are tested, and they should have worked directly, but since you already compiled by hand, let's continue with this. :sweat_smile:

So, please, purge the package again, and try to install the build again. :disappointed:

php -m | grep pdlib
pdlib

To be clear, if you see that, it is that the extension is builded and installed appropriately. However, this check is only for the command line, since ubuntu/debian separates both configurations.

The extension itself is the same, do not try to reinstall it unnecessarily, you just have to configure it by modifying the correct files. :wink:

Aspire1Inspire2 commented 4 years ago

After going back-and-forth compiling the library, it still gives me the same error. Since the pdlib test passed successfully, I made the assumption that my library was compiled correctly. Therefore, something must be wrong with how my nextcloud is hosted.

Could anyone help me figure out (maybe) how to configure my Apache2 to work with the facerecognition plugin correctly?

Question: I noticed that the php-fpm is a necessity to run this plugin. However, I did not configure my Apache2 to use it in the Virtual host file. I am wondering if this is the reason why the plugin cannot find the pdlib?

Here is what I did:

Here is what I (maybe) did not do:

I understand that configure Apache2 is probably out of scope for this repo's issue to be handled. I Googled ways to enable php-fpm and read through several top search results. I was more confused than before.

Could someone shed some light (or a link) on how to correctly configure Apache2 for this plugin?

Thank you for your help.

matiasdelellis commented 4 years ago

I noticed that the php-fpm is a necessity to run this plugin.

No. It is not dependency of pdlib extension. Is just an PHP extension. In any case, php-fpm is what that takes the queries, and responds executing the php process, etc.

You can check if it is running:

However, I find it strange that you are using other things.

I configured my /etc/php/7.2/cli/php.ini file to have the pdlib as extension

If you always had the file over the cli folder, you have to have another one in /etc/php/7.2/fpm/, and if not, check the content of the folder /etc/php/7.2/ (ls -la /etc/php/7.2/) you must have something similar!

If not yet clear, debian, ubuntu separate the php interpreter configuration for the command line from the interpreter that answers apache queries!. Your cmd line version is working.

Aspire1Inspire2 commented 4 years ago

I finally found the reason! This is the file to edit on my Ubuntu system: /etc/php/7.4/apache2/php.ini

I am not familiar with php at all. This is figured out through trial and error. My installation of Apache2 and php are all done through apt. Shall we add this to the installation instruction? @matiasdelellis Perhaps other users will find it useful.

Aspire1Inspire2 commented 4 years ago

One more question I installed the app and turned it on under one of my nextcloud users. It asked me for patience. However, I did not see any background process related to apache, php, or pdlib being run. I waited for 2 hours. Nothing showed up.

I think this behavior is abnormal. Could you share with me on how to collect log info so that I can report another issue? Thank you!

matiasdelellis commented 4 years ago

This is the file to edit on my Ubuntu system: /etc/php/7.4/apache2/php.ini

Great.. :tada:

Shall we add this to the installation instruction? @matiasdelellis Perhaps other users will find it useful.

I'll keep that in mind to document. :wink:

It asked me for patience. However, I did not see any background process related to apache, php, or pdlib being run. I waited for 2 hours. Nothing showed up.

It's all in the readme .. :sweat_smile:

matiasdelellis commented 4 years ago

p.s: Use model 1 or model 3!. Model 2 is not recommended!!

matiasdelellis commented 4 years ago

Well, Close it.. I hope to know your experiences whit it. :grimacing: regards