OSX Sierra

Added by Regis HUEZ about 8 years ago

Bonjour,
Sous Mac, est ce que des personnes ont effectué la migration vers Sierra et est ce que AMC-QCM (version normale, pas la dev) est toujours opérationnel.
Encore merci


Replies (25)

RE: OSX Sierra - Added by Joël Brogniart about 8 years ago

Bonjour,

J'ai bien effectué la migration vers la version normale de Sierra, mais je n'ai pas encore eu le temps de faire une installation d'AMC.

RE: OSX Sierra - Added by Regis HUEZ about 8 years ago

Bonjour à nouveau,
Avez vous eu la possibilité d'effectuer l'installation sous Sierra, encore merci.
cdt

RE: OSX Sierra - Added by Joël Brogniart about 8 years ago

Désolé, j'ai un emploi du temps assez chargé en ce moment et je n'ai pas encore trouvé un instant pour m'y coller. Mais je vais bien finir par y arriver.

RE: OSX Sierra - Added by Joël Brogniart about 8 years ago

Bon j'ai fait une première tentative d'installation. Ce n'est pas gagné. Je ne pense pas qu'il y ait de problème du côté d'AMC directement, mais il y a des dépendances qui coincent.

La première, c'est pdftk qui ne peut être compilé à cause d'un bug du compilateur GCC. Après avoir corrigé quelques trucs dans les sources et compilé GCC 5.4, pdftk peut être fabriqué.

Ensuite ça coince avec OpenCV. Là c'est plus pointu et je sais pas s'il y a une solution simple. J'en reste là pour l'instant.

RE: OSX Sierra - Added by Regis HUEZ about 8 years ago

Bonjour,
merci de ces nouvelles, j'espère que vous pourrez trouver une solution. AMC m'étant devenu indispensable, je ne vais donc pas faire la mise à jour.

cdt
r huez

RE: OSX Sierra - Added by Christophe Farges about 8 years ago

Bonjour,

J'ai réussi à installer opencv sous Sierra comme indiqué en bas de page ici : https://github.com/opencv/opencv/pull/7159

Par contre j'ai quand même un problème d'installation pour auto-multiple-choice lui-même : fatal error: 'opencv2/highgui/highgui_c.h' file not found (pourtant opencv est bien installé).

Quelqu'un a une idée ?

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

Bonjour,
I am facing exactly the same problem (opencv2/highgui/highgui_c.h not found) and would be very interested in a solution.
Thomas

RE: OSX Sierra - Added by Alexis Bienvenüe about 8 years ago

Can you provide a complete log with the exact error ? It could be interesting to know which file requests opencv2/highgui/highgui_c.h

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

Sure, here is the log. Please find the log file attached (main.log).
Thomas

sudo port install auto-multiple-choice -latex
---> Computing dependencies for auto-multiple-choice
---> Building auto-multiple-choice
Error: org.macports.build for port auto-multiple-choice returned: command execution failed
Please see the log file for port auto-multiple-choice for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_auto-multiple-choice/auto-multiple-choice/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port auto-multiple-choice failed

main.log (325.3 kB)

RE: OSX Sierra - Added by Alexis Bienvenüe about 8 years ago

:info:build In file included from AMC-detect.cc:26:
:info:build /opt/local/include/opencv/highgui.h:46:10: fatal error: 'opencv2/highgui/highgui_c.h' file not found
:info:build #include "opencv2/highgui/highgui_c.h"

Is there any file opencv2/highgui/highgui_c.h installed in /opt/local/include/ or somewhere else?

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

1) No,
but consider the following:

ls -l /opt/local/var/macports/distfiles/opencv/

total 154664
rw-r--r- 1 macports admin 79186131 Jan 10 2016 opencv-3.1.0.zip

2) So, I unzipped this file, which is extracted in my ~/Downloads folder, and here it is:

ls -l ~/Downloads/opencv-3.1.0/modules/highgui/include/opencv2/highgui/highgui_c.h

-rwxr-xr-x 1 bartz staff 10567 Dec 18 2015 /Users/bartz/Downloads/opencv-3.1.0/modules/highgui/include/opencv2/highgui/highgui_c.h

3) Consider the following ls output:
As expected:

ls -l /opt/local/include/opencv2/highgui

ls: /opt/local/include/opencv2/highgui: No such file or directory

4) Some more details:
ls l /opt/local/include/opencv2
total 1488
drwxr-xr-x 4 root admin 136 Nov 10 19:00 calib3d
-rw-r--r-
1 root admin 114086 Dec 18 2015 calib3d.hpp
drwxr-xr-x 42 root admin 1428 Nov 10 19:00 core
rw-r--r- 1 root admin 145257 Dec 18 2015 core.hpp
rw-r--r- 1 root admin 3960 Nov 10 18:58 cvconfig.h
drwxr-xr-x 3 root admin 102 Nov 10 19:00 features2d
rw-r--r- 1 root admin 59901 Dec 18 2015 features2d.hpp
drwxr-xr-x 38 root admin 1292 Nov 10 19:00 flann
rw-r--r- 1 root admin 23514 Dec 18 2015 flann.hpp
drwxr-xr-x 5 root admin 170 Nov 10 19:00 imgcodecs
rw-r--r- 1 root admin 14491 Dec 18 2015 imgcodecs.hpp
drwxr-xr-x 6 root admin 204 Nov 10 19:00 imgproc
rw-r--r- 1 root admin 208188 Dec 18 2015 imgproc.hpp
drwxr-xr-x 3 root admin 102 Nov 10 19:00 ml
rw-r--r- 1 root admin 71568 Dec 18 2015 ml.hpp
drwxr-xr-x 5 root admin 170 Nov 10 19:00 objdetect
rw-r--r- 1 root admin 22611 Dec 18 2015 objdetect.hpp
rw-r--r- 1 root admin 2561 Dec 18 2015 opencv.hpp
rw-r--r- 1 root admin 546 Nov 10 18:58 opencv_modules.hpp
drwxr-xr-x 5 root admin 170 Nov 10 19:00 photo
rw-r--r- 1 root admin 38487 Dec 18 2015 photo.hpp
drwxr-xr-x 7 root admin 238 Nov 10 19:00 shape
rw-r--r- 1 root admin 2469 Dec 18 2015 shape.hpp
drwxr-xr-x 4 root admin 136 Nov 10 19:00 stitching
rw-r--r- 1 root admin 10566 Dec 18 2015 stitching.hpp
drwxr-xr-x 3 root admin 102 Nov 10 19:00 superres
rw-r--r- 1 root admin 8274 Dec 18 2015 superres.hpp
drwxr-xr-x 6 root admin 204 Nov 10 19:00 video
rw-r--r- 1 root admin 2642 Dec 18 2015 video.hpp
drwxr-xr-x 16 root admin 544 Nov 10 19:00 videostab
rw-r--r- 1 root admin 3680 Dec 18 2015 videostab.hpp

5) The zipfile includes:
ls -l /Users/bartz/Downloads/opencv-3.1.0/modules/highgui/include/opencv2/highgui/
total 40
-rwxr-xr-x 1 bartz staff 2369 Dec 18 2015 highgui.hpp
-rwxr-xr-x 1 bartz staff 10567 Dec 18 2015 highgui_c.h
-rwxr-xr-x 1 bartz staff 2266 Dec 18 2015 highgui_winrt.hpp

6) Copying the missing highgui_c.h file as follows:
sudo cp /Users/bartz/Downloads/opencv-3.1.0/modules/highgui/include/opencv2/highgui/* /opt/local/include/opencv2
sudo mkdir /opt/local/include/opencv2/highgui
sudo cp /Users/bartz/Downloads/opencv-3.1.0/modules/highgui/include/opencv2/highgui/* /opt/local/include/opencv2/highgui

7) sudo port install auto-multiple-choice -latex results in
---> Computing dependencies for auto-multiple-choice
---> Building auto-multiple-choice
Error: org.macports.build for port auto-multiple-choice returned: command execution failed
Please see the log file for port auto-multiple-choice for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_auto-multiple-choice/auto-multiple-choice/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port auto-multiple-choice failed

8) Logfile says:
:info:build In file included from AMC-detect.cc:26:
:info:build In file included from /opt/local/include/opencv/highgui.h:46:
:info:build /opt/local/include/opencv2/highgui/highgui_c.h:48:10: fatal error: 'opencv2/videoio/videoio_c.h' file not found
:info:build #include "opencv2/videoio/videoio_c.h"
:info:build ^
:info:build 1 error generated.
:info:build make: *** [AMC-detect] Error 1

9) Now, videoio_c.h is missing. But, it is also in the zip file:

ls -l ~/Downloads/opencv-3.1.0/modules/videoio/include/opencv2/videoio

total 112
-rwxr-xr-x 1 bartz staff 5511 Dec 18 2015 cap_ios.h
-rwxr-xr-x 1 bartz staff 4356 Dec 18 2015 cap_winrt.hpp
-rwxr-xr-x 1 bartz staff 2369 Dec 18 2015 videoio.hpp
-rwxr-xr-x 1 bartz staff 34385 Dec 18 2015 videoio_c.h

10)

sudo mkdir /opt/local/include/opencv2/videoio
sudo cp ~/Downloads/opencv-3.1.0/modules/videoio/include/opencv2/videoio/* /opt/local/include/opencv2/videoio

11)

sudo port install auto-multiple-choice -latex

results in "library not found for -lopencv_highgui" error. Please find the logfile attached.

main.log (355.5 kB)

RE: OSX Sierra - Added by Alexis Bienvenüe about 8 years ago

:info:build /opt/local/include/opencv2/highgui/highgui_c.h:48:10: fatal error: 'opencv2/videoio/videoio_c.h' file not found

So perhaps this means videoio is a dependency for highgui. If you followed instructions in https://github.com/opencv/opencv/pull/7159#issuecomment-254830474 to build opencv, the -DBUILD_opencv_videoio=OFF switch seems to calcel videoio module building, and perhaps also highgui module… This could explain the "library not found for -lopencv_highgui" error.

RE: OSX Sierra - Added by Alexis Bienvenüe about 8 years ago

Maybe this is related to some change in OpenCV 3.1. I'll have a look.

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

Unfortunately, this seems to be a deadlock:
1) opencv does not build if -DBUILD_opencv_videoio=ON
but
2) amc (might) require -DBUILD_opencv_videoio=ON
Do you have any ideas ho to proceed?
BTW, thanks for your quick replies.
Thomas

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

It seems to work - see the attached screenshot. At least, compilation is successfully completed. I have not been able to test every single function, but it looks promising.
Kind regards Thomas

amc-sierra.pdf (177.3 kB)

RE: OSX Sierra - Added by Christophe Farges about 8 years ago

Great news! How did you do to make it work?

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

I hope the following comments are useful.

Facing the deadlock situation for amc, I tried a new start.
I guessed that you are fixing amc, so I tried installing the taskjuggler package in the meantime.

1) sudo port uninstall installed

2) sudo port install taskjuggler

3a) taskjuggler was installed without any errors. So, I tried opencv:

3b) I did not add "-DBUILD_opencv_videoio=OFF" to the file:
/opt/local/var/macports//sources/rsync.macports.org/release/tarballs/ports/graphics/opencv/Portfile

3c) But (I do not know, if the following is relevant?). I modified the opencv2 directory:

ls --l /opt/local/include/opencv2/highgui
total 32
--rw-r--r-- 1 root admin 2369 Dec 18 2015 highgui.hpp
--rw-r--r-- 1 root admin 10567 Dec 18 2015 highgui_c.h

3d) And, in a similar manner:

ls --l /opt/local/include/opencv2/videoio
total 96
--rw-r--r-- 1 root admin 5511 Dec 18 2015 cap_ios.h
--rw-r--r-- 1 root admin 2369 Dec 18 2015 videoio.hpp
--rw-r--r-- 1 root admin 34385 Dec 18 2015 videoio_c.h

3e) sudo port install opencv

No errors. So I tried amc:

4) sudo port install auto-multiple-choice -latex

This results in:
---> Computing dependencies for auto-multiple-choice
---> Fetching archive for auto-multiple-choice
---> Attempting to fetch auto-multiple-choice-1.2.1_6.darwin_16.x86_64.tbz2 from https://packages.macports.org/auto-multiple-choice
---> Attempting to fetch auto-multiple-choice-1.2.1_6.darwin_16.x86_64.tbz2 from http://lil.fr.packages.macports.org/auto-multiple-choice
---> Attempting to fetch auto-multiple-choice-1.2.1_6.darwin_16.x86_64.tbz2 from http://nue.de.packages.macports.org/auto-multiple-choice
---> Fetching distfiles for auto-multiple-choice
---> Verifying checksums for auto-multiple-choice
---> Extracting auto-multiple-choice
---> Applying patches to auto-multiple-choice
---> Configuring auto-multiple-choice
---> Building auto-multiple-choice
---> Staging auto-multiple-choice into destroot
---> Installing auto-multiple-choice @1.2.1_6
---> Activating auto-multiple-choice @1.2.1_6
---> Cleaning auto-multiple-choice
---> Updating database of binaries
---> Scanning binaries for linking errors
---> No broken files found.

5) sudo auto-multiple-choice latex-link
The style file is already accessible:
/usr/local/texlive/texmf-local/tex/latex/automultiplechoice.sty
Use 'auto-multiple-choice latex-link remove' to remove the link

6) Summary: Since I modified several files, I am not really sure what is really necessary for successfully installing amc.
i) Maybe steps 3c) and 3d) are not necessary?
ii) Maybe the task juggler installation fixed some dependencies (or does not have effect at all)?
iii) Maybe there are some macports updates that enable the amc installation?

I will try the installation on a different machine, because I am really interested in running a stable amc version on my mac.

Best

Thomas

RE: OSX Sierra - Added by Christophe Farges about 8 years ago

Hello again!

Thanks for your answer! I followed your steps but when I try to install opencv, I still get the error:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/opencv-3.1.0/modules/videoio/src/cap_qtkit.mm:46:9: fatal error: 'QTKit/QTKit.h' file not found
:info:build #import <QTKit/QTKit.h>
:info:build ^
:info:build 1 error generated.

May be you did something else?

Thanks again!

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

Unfortunately, I could not reproduce the successful installation on other machines.
I suppose that amc works under sierra in my very specific case, because there are several old files in the /opt directories.
The computer is five years old and has a long installation history.

I copied the complete /opt/local branch to a new machine and amc works under sierra on a second machine.
However, this is not a feasible approach, because I had to copy several GB and I am not sure if this affects other programs.

So, I think we have to wait for updated opencv/amc versions, that implement the transition of the old QTKit code to AV Foundation...
Please let me know if I can support this development, e.g. by performing further tests.
Thomas

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

I had some time for another try and applied the patch described on
https://trac.macports.org/attachment/ticket/52328/patch-use-avfound-no-qtkit.diff
to the opencv sources under sierra. The results look promising, amc runs on a second machine.
I will continue testing...(but not tonight, because it is too late).
Please let me know if you need more details.
Regards
Thomas

RE: OSX Sierra - Added by Christophe Farges about 8 years ago

Hello,
I found the patch but I didn't know how to apply it. If you had some time to give me the procedure, that would be very nice!

RE: OSX Sierra - Added by Thomas Bartz-Beielstein about 8 years ago

I hope this helps. I tested the steps on a new machine with sierra -- take care: some paths are very long:

1) Install Xcode:
1a) sudo xcode-select --install
1b) sudo xcodebuild -license
scroll down and type: "agree"

2) Install XQuartz from https://www.xquartz.org
2a) Logout to change default X11 Server

3) Install macports from https://www.macports.org/install.php
3a) sudo port -f uninstall installed
3b) sudo rm -rf /opt/local/var/macports/build/*
3c) sudo port selfupdate; sudo port upgrade outdated

4) Install and patch opencv (see: https://trac.macports.org/attachment/ticket/52328/patch-use-avfound-no-qtkit.diff)
4a) sudo port install opencv
If step 4a) is processed without errors (maybe in the near future?),
you do not need the following steps (you might also consider using the "patch" command, see "man patch"):

I. ### Patch 1/3 ###
4b) cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/opencv-3.1.0
4c) sudo vi CMakeLists.txt
4d) goto line 165 and change:
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)

OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF (APPLE OR IOS))

II. ### Patch 2/3 ###
4e) cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/opencv-3.1.0/cmake

4f) sudo vi OpenCVFindLibsVideo.cmake
4g) goto line 319 and change:
set(HAVE_QTKIT YES)
set(HAVE_QTKIT NO)

III. ### Patch 3/3 ###
4h) cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/opencv-3.1.0/modules/videoio
4i) sudo vi CMakeLists.txt
4j) goto line 170 and change:
list(APPEND VIDEOIO_LIBRARIES "-framework AVFoundation" "-framework QuartzCore")
list(APPEND VIDEOIO_LIBRARIES "-framework AVFoundation" "-framework QuartzCore" "-framework CoreMedia" "-framework CoreFoundation" "-framework AppKit")
4k) cd
4l) sudo port install opencv

This generates the following output:
...
No broken files found.

5) Install amc (install MacTeX before?)
5a) Install MacTeX from https://tug.org/mactex/mactex-download.html

5b) Open a new shell
5c) sudo port install auto-multiple-choice -latex

Finally, this generates the following output:
...
No broken files found.

5d) sudo auto-multiple-choice latex-link

6) Start AMC
6a) Open XQuartz --> Applications ---> Customize --> Add Item: amc | auto-multiple-choice|
6b) Enjoy (and thanks a lot for programming this great piece of software)!

P.S.: My previous posts might be misleading, because they report results that were generated using an old macbook. There were many old dependencies in the /opt/local folders that were not deleted while upgrading to sierra.

P.P.S.: This might be off-topic, but are there any recommendations how to use MacTeX (from tug.org) and texlive (from macports) in parallel?

RE: OSX Sierra - Added by Christophe Farges about 8 years ago

Thanks you very much for the detailed procedure! It worked perfectly. I installed the development version following the steps provided here and it also works (after installing opencv using your procedure):
http://project.auto-multiple-choice.net/projects/auto-multiple-choice/wiki/Installation_de_la_version_de_développement_d%27AMC_sous_OS_X_Mountain_Lion

Thank you again!!

RE: OSX Sierra - Added by Joël Crougneau almost 9 years ago

Thanks, works perfectly.

One thing to add, I had to change the default application for opening tex file with texshop instead of excalibur.

Nos let's go to amc's all my students evaluations.

RE: OSX Sierra - Added by Joël Brogniart almost 8 years ago

Bonjour,

L'installation de la dernière version fonctionne sous macOS 10.12.1. Le port opencv à été mis à jour sur Macports dont il n'y a plus besoin de bidouille particulière pour l'installer, MacPorts s'occupe de tout. L'installation nécessite toujours une adaptation des ports GCC5 et pdftk ce qui provoque des temps d'installation très longs, mais une fois installé, tout fonctionne. Les pages du wiki ont été mises à jour.

Version française : Installation_de_la_version_de_développement_d'AMC_sous_OS_X,
Version anglaise : Building_AMC_for_MAC_OSX.

(1-25/25)