Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install: Cannot MAKE - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2" #217

Closed
Snake883 opened this issue Jan 18, 2020 · 12 comments

Comments

@Snake883
Copy link

Snake883 commented Jan 18, 2020

Repro:

$ cd facerecognition
$ make

Log:

....
composer install --prefer-dist
Loading composer repositories with package information
Updating dependencies (including require-dev)

[ErrorException]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] []...

Makefile:39: recipe for target 'composer' failed
make: *** [composer] Error 1

I'm on PHP v7.3

@matiasdelellis
Copy link
Owner

@Snake883
Copy link
Author

Snake883 commented Jan 20, 2020

Tried, and receive error:

$ composer self-update
[InvalidArgumentException]
Command "self-update" is not defined.

$ composer -V
Composer version @package_branch_alias_version@ (1.0.0-beta2) 2016-03-27 16:00:34

$ apt list composer
Listing... Done
composer/xenial,now 1.0.0~beta2-1 all [installed]

@matiasdelellis
Copy link
Owner

Ok..
Well .. I guess installed php 7 with some strange repository. I don't know how, but you should update composer. 😞
If you can't find the way to do this, try remove the composer from the system, and let to the Makefile install its own version.

@Snake883
Copy link
Author

Thank you...I think I'm getting closer...

Instead of installing composer from the apt repository, which is an old version of composer, I installed composer:

curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/usr/bin --filename=composer

MAKE looks to work, however:

$ sudo -u www-data php /var/www/nextcloud/occ face:setup
There are no commands defined in the "face" namespace.

@matiasdelellis
Copy link
Owner

Wow.. Ok..
Please ensure that the app is enabled on your nextcloud app 'store'.. 😉
...and remember give the correct permissions to facerecognition so that apache/nginx can read them..

@Snake883
Copy link
Author

From the NextCloud Apps web interface, the button to "Enable" is disabled and the message appears:

This app cannot be installed because the following dependencies are not fulfilled:
The library pdlib is not available.

However, I ran this test:

$ php -m | grep pdlib
pdlib

So I don't know why Nextcloud would say pblib is not available. It may have to do with the way I installed pdlib?

As root (the instructions didn't tell me which user to install as):

$ cd ~/downloads
$git clone https://github.com/goodspb/pdlib.git
$ cd pdlib
$ phpize
$ ./configure --enable-debug
$ make
$ make install

I hope I'm not getting too far off into the weeds (I'm not a very experienced Linux admin or developer)...I'm just following step-by-step instructions, and trying not to get lost.

Thank you.

@Snake883
Copy link
Author

I believe I got past the above by installing dlib and pdlib to:
/var/www/nextcloud/lib

@matiasdelellis
Copy link
Owner

I believe I got past the above by installing dlib and pdlib to:
/var/www/nextcloud/lib

With this it is working? 😕
It does not make any sense.. 😅

From the NextCloud Apps web interface, the button to "Enable" is disabled and the message appears:

Mmm.. I have to change the instructions to enable the application from the command line.

@gnorbsl
Copy link

gnorbsl commented Jan 27, 2020

Had to do the same on a fresh debian 9 with php 7.3, after that I could enable the app

@matiasdelellis
Copy link
Owner

@snakyjake1 @gnorbsl

Can you confirm which system you have installed? How you install php?

I'm going to try to reproduce it, but I still don't see any sense.

Please, revert this change to test and share the result of:

@Snake883
Copy link
Author

Snake883 commented Jan 28, 2020

Most of the PHP install process was from my notes to get Nextcloud installed or upgraded via:
apt-get install php
-----------------------------------------------------
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial
-----------------------------------------------------
$ php -v
PHP 7.3.14-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jan 23 2020 13:58:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.14, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.14-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
-----------------------------------------------------
$ php -m | grep pdlib
pdlib
-----------------------------------------------------
$ systemctl restart httpd php-fpm
Failed to restart httpd.service: Unit httpd.service not found.
Failed to restart php-fpm.service: Unit php-fpm.service not found.
-----------------------------------------------------
$ 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: 7
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Processing file: input/Big Bang Theory.png
Number of faces detected: 7
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
Face landmarks... Done
Face descriptor... Done
-----------------------------------------------------
$ make python-test
python3 scripts/face_detect.py
Traceback (most recent call last):
  File "scripts/face_detect.py", line 6, in <module>
    import dlib
ImportError: No module named 'dlib'
Makefile:30: recipe for target 'python-test' failed
make: *** [python-test] Error 1
-----------------------------------------------------

@Snake883
Copy link
Author

Snake883 commented Jan 28, 2020

/pdlib# make test
/bin/bash /root/downloads/pdlib/libtool --mode=install cp ./pdlib.la /root/downloads/pdlib/modules
libtool: install: cp ./.libs/pdlib.so /root/downloads/pdlib/modules/pdlib.so
libtool: install: cp ./.libs/pdlib.lai /root/downloads/pdlib/modules/pdlib.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /root/downloads/pdlib/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /root/downloads/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'.


=====================================================================
PHP         : /usr/bin/php7.3
PHP_SAPI    : cli
PHP_VERSION : 7.3.14-1+ubuntu16.04.1+deb.sury.org+1
ZEND_VERSION: 3.3.14
PHP_OS      : Linux - Linux cloud 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64
INI actual  : /root/downloads/pdlib/tmp-php.ini
More .INIs  :
CWD         : /root/downloads/pdlib
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2020-01-28 16:09:53
=====================================================================
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]
FAIL Args given to chinese_whispers functions is not correct [tests/chinese_whispers_wrong_arg_type_error.phpt]
FAIL 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]
FAIL Testing FaceLandmarkDetection constructor without arguments [tests/face_landmark_detection_ctor_error.phpt]
FAIL Testing FaceRecognition constructor without arguments [tests/face_recognition_ctor_error.phpt]
FAIL Full test for face recognition - download models, detect faces, landmark detection and face recognition. [tests/integration_face_recognition.phpt]
=====================================================================
TIME END 2020-01-28 16:09:54

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   15
---------------------------------------------------------------------

Number of tests :   12                12
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    5 ( 41.7%) ( 41.7%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    7 ( 58.3%) ( 58.3%)
---------------------------------------------------------------------
Time taken      :    1 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Args given to chinese_whispers functions is not correct [tests/chinese_whispers_wrong_arg_type_error.phpt]
Testing CnnFaceDetection constructor without arguments [tests/cnn_face_detection_ctor_error.phpt]
Testing FaceLandmarkDetection constructor without arguments [tests/face_landmark_detection_ctor_error.phpt]
Testing FaceRecognition constructor without arguments [tests/face_recognition_ctor_error.phpt]
Full test for face recognition - download models, detect faces, landmark detection and face recognition. [tests/integration_face_recognition.phpt]
=====================================================================

You may have found a problem in PHP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants