OpenCV OS X 10.12sierra - macos

'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
^
1 error generated.
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2
JefferydeMacBook-Pro:build jefferyfan$ cd ~
JefferydeMacBook-Pro:~ jefferyfan$ brew install QTKit
Error: No available formula with the name "qtkit"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.
This error shows up.
and Homebrew have problems as well.

Just use
brew install opencv3 --HEAD --with-contrib
It works fine for me.

In macOS 10.12, apple removed most of QTKit's components, include some functions and header files opencv use, so opencv 3 can't compile on macOS 10.12 (eg. header file "QTKit/QTKit.h" file has been removed, which is included in "cap_qtkit.mm").
Source
Currently the only way to compile OpenCV on Sierra is to disable the modules using QTKit. Just add this flag when you run cmake to disable it.
cmake -DBUILD_opencv_videoio=OFF

Related

Compiling Elmer FEM on macOS Mojave causes the fatal error: 'string.h' file not found

I'm trying to follow these instructions to compile Elmer FEM on macOS Mojave Version 10.14.6. However, when running the make install I get the error message:
.../elmerfem/umfpack/src/umfpack/include/umf_internal.h:29:10: fatal error: 'string.h' file not found
#include <string.h>
^~~~~~~~~~
1 error generated.
make[2]: *** [umfpack/src/umfpack/umfpack_zl_save_symbolic.c] Error 1
make[2]: *** Deleting file `umfpack/src/umfpack/umfpack_zl_save_symbolic.c'
make[1]: *** [umfpack/src/umfpack/CMakeFiles/umfpack.dir/all] Error 2
make: *** [all] Error 2
searching the internet this post suggests
xcode-select --install
sudo xcode-select --switch /Library/Developer/CommandLineTools/
which had already been done before in my case and have no effect on the above error. This and this post suggest
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / -allowUntrusted
which leads to the error message
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
I would appreciate it if you could help me know what is the problem and how I can resolve it. Thanks for your kind support in advance.
P.S.1. As was asked here, my make version is GNU Make 3.81.
P.S.2. the list of string.h files on my hard drive here.
P.S.3. the output of CMake is pasted here.
OK, I think I solved the problem. From here, I ran
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ ..
while being inside the build folder. and then make . worked fine except some warning. I'm still not sure what was the problem or if this is the optimal/canonical solution. So I will not mark this as the accepted solution until others provide better ones.
P.S.1. I sent a pull request here on Elmer's HomeBrew formula as well.
P.S.2. To compile with OpenMP and MPI:
cmake -DCMAKE_C_COMPILER=/usr/local/Cellar/gcc/9.2.0_3/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/Cellar/gcc/9.2.0_3/bin/g++-9 -DWITH_Mumps=FALSE -DWITH_MPI=TRUE -DWITH_OpenMP=TRUE -DWITH_MKL=FALSE -DWITH_ELMERGUI=TRUE -DWITH_ELMERPOST=FALSE -DWITH_ELMERGUITESTER=FALSE ..
I have GNU GCC and OpenMPI installed via HomeBrew brew install gcc open-mpi.
P.S.3. If you want the ElmerGUI also installed:
install qt4 with brew install cartr/qt4/qt#4 from here
install qwt with brew install cartr/qt4/qwt-qt4
then cmake -DCMAKE_C_COMPILER=/usr/local/Cellar/gcc/9.2.0_3/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/Cellar/gcc/9.2.0_3/bin/g++-9 -DWITH_Mumps=FALSE -DWITH_MPI=TRUE -DWITH_OpenMP=TRUE -DWITH_MKL=FALSE -DWITH_ELMERGUI=TRUE -DWITH_ELMERPOST=TRUE -DWITH_ELMERGUITESTER=TRUE -DQWT_INCLUDE_DIR=/usr/local/Cellar/qwt-qt4/6.1.3_1/lib/qwt.framework/Versions/6/Headers/ ..

error during installation of EMBOSS on MacOSX "dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib"

I'm trying to install EMBOSS v6.6.0 on a MacOSX 10.12 laptop. I did the following:
./configure --prefix=/Users/pc/local/opt/emboss/v6.6.0
sudo mkdir /usr/local/emboss
sudo chown pc /usr/local/emboss
make -j 4
Then I did make install and got the following error:
dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
Referenced from: /usr/local/opt/gd/lib/libgd.3.dylib
Reason: image not found
make[3]: *** [install-exec-hook] Abort trap: 6
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1
Not sure how to fix this. What should I try?
If you don't need the UI elements then
./configure --without-x
make
generally makes life a lot easier on OSX.
Otherwise it looks like your installed library gd in /usr/local/opt/gd is out of sync with the jpeg library. If you ls /usr/local/opt/jpeg/lib/ I am guessing you see libjpeg.9.dylib. From this it is difficult to know exactly the next steps without knowing how you originally installed /usr/local/opt/gd. It might be as simple as (if you have homebrew) brew install gd to overwrite the 'broken' gd library. Or removing it entirely as I think it is getting in the way of the emboss included gd during compilation.

Cutecom installation fails on OSX Mavericks

I'm trying to install cutecom on OSX Mavericks but I'm getting some erros.
Here are the steps that I followed.
install qt through brew
brew install qt
update path on .bashprofile
export PATH=/usr/local/Cellar/qt/4.8.6/bin:$PATH
extract files of cutecom
compile source code of cutecom
$ mkdir build
$ cd build
$ cmake ..
$ make
And the output of make is:
[ 20%] Generating ui_cutecommdlg.h
/Users/kc/Downloads/cutecom-0.22.0/cutecommdlg.ui: Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. This requires Qt 3 support, which is disabled. The resulting code will not compile.
[ 40%] Generating moc_qcppdialogimpl.cxx Scanning dependencies of target cutecom
[ 60%] Building CXX object CMakeFiles/cutecom.dir/main.cpp.o
In file included from /Users/kc/Downloads/cutecom-0.22.0/main.cpp:21:
In file included from /Users/kc/Downloads/cutecom-0.22.0/qcppdialogimpl.h:22:
/Users/kc/Downloads/cutecom-0.22.0/build/ui_cutecommdlg.h:12:10: fatal error:
'Qt3Support/Q3MimeSourceFactory' file not found
#include <Qt3Support/Q3MimeSourceFactory>
^
1 error generated.
make[2]: *** [CMakeFiles/cutecom.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/cutecom.dir/all] Error 2
make: *** [all] Error 2
Any suggestions ?
Thank you very much for your time.
Kostas.
The Qt package you have is missing Qt3Support (on purpose). This component is necessarily for some Qt4 software that still uses deprecated features dating back to Qt3.
Based on the documentation I've been able to find online, you should be able to reinstall Qt4 with the extras you need using a command like this:
brew install --with-qt3support qt

Using rbenv install throws an error

I'm using Homebrew rbenv. brew doctor comes out fine. rbenv install 2.0.0-p451 gives the following error message:
user$ rbenv install 2.0.0-p451
Downloading ruby-2.0.0-p451.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/9227787a9636551f1749ee8394b5ffe5
Installing ruby-2.0.0-p451...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245
Results logged to /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245.log
Last 10 log lines:
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
installing default openssl libraries
1 warning generated.
linking shared-object date_core.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object openssl.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object ripper.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
make: *** [build-ext] Error 2
I tried googling it but not luck. Any tips?
p.s. I tried other ruby versions but same issue (although the last 10 lines of the log are slightly different).
Edit: installing version 1.9.3-p545 works fine.
brew cleanup and remove this /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245 file.
I remember i removed all /var/folders/4h folder (wasn't exactly such name, but then i removed all folders in /var/folders/ and there wasn't no problem).

Error installing OpenCV: Error 1, 2

I am attempting to install OpenCv on my Mac Pro (and I have already succesfully installed it on my Macbook), however I am getting an error message when doing
sudo make install
in the directory I am striving to install it in. I am running Snow Leopard (10.6.8) and have Xcode (as well as MacPorts) installed. My question is similar to this one (which is unanswered as of today): Trying to install opencv using homebrew. ERROR: modules/highgui/CMakeFiles/opencv_highgui.dir/all Error 2
The following is the error message:
[ 67%] Building CXX object modules/ocl/CMakeFiles/opencv_ocl.dir/src/error.cpp.o
/Users/maxweissenbacher/Documents/OpenCV/opencv-2.4.5/modules/ocl/src/error.cpp:
In function ‘const char* cv::ocl::getOpenCLErrorString(int)’:
/Users/maxweissenbacher/Documents/OpenCV/opencv-2.4.5/modules/ocl/src/error.cpp:82:
error: ‘CL_MISALIGNED_SUB_BUFFER_OFFSET’ was not declared in this scope
/Users/maxweissenbacher/Documents/OpenCV/opencv-2.4.5/modules/ocl/src/error.cpp:84:
error: ‘CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST’ was not declared in this scope
make[2]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/src/error.cpp.o] Error 1
make[1]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/all] Error 2
make: *** [all] Error 2
I appreciate any help.
Thanks in advance,
Max.
Looks like you can't install it on Snow Leopard, at least without some additional manipulations with sources.The reason is OpenCL version.
Take a look at this thread for additional info

Resources