abreheret/PixelAnnotationTool

Problems with macOS Mojave

hablema opened this issue ยท 13 comments

The release doesn't support OSX Mojave (10.14).

Has this issue been addressed? I am running into the same problem.

same question as miladm. could you add support to Mojave?

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /usr/local/Cellar/ffmpeg/4.1.1/lib/libswresample.3.dylib
  Referenced from: /private/var/folders/h8/vxd5l9_17q91pkt5_p57906h0000gp/T/AppTranslocation/FF63E748-10CB-4B84-B73E-E3048F827351/d/PixelAnnotationTool.app/Contents/Frameworks/libavcodec.58.dylib
  Reason: image not found

Getting this error on macOS mojave.

If you are getting the same error as mine (missing dynamic library), you can just create a link where it expects it to be, on /usr/local/Cellar/ffmpeg/4.1.1/.

On Homebrew, ffmpeg is already at 4.1.3, hence the problem.

Create a link with:

ln -s /usr/local/Cellar/ffmpeg/4.1.3 /usr/local/Cellar/ffmpeg/4.1.1

This solved to problem to me.

Similar issue here (Mac OSX Mojave 10.14.2), opencv is installed with brew:

python3
>>> import cv2
>>> print(cv2.__version__)
4.1.0

Install fails with
Dyld Error Message:
Library not loaded: @rpath/libopencv_imgproc.4.0.dylib

How could I address this?

Same issue when trying to use on MAC OSX Mojave 10.14.4. Opencv installed with brew

Dyld Error Message:
Library not loaded: @rpath/libopencv_imgproc.4.0.dylib
Referenced from: /Applications/PixelAnnotationTool.app/Contents/Frameworks/libopencv_gapi.4.0.dylib
Reason: image not found

Same issue when trying to use on MAC OSX Mojave 10.14.4. Opencv installed with brew

Dyld Error Message:
Library not loaded: @rpath/libopencv_imgproc.4.0.dylib
Referenced from: /Applications/PixelAnnotationTool.app/Contents/Frameworks/libopencv_gapi.4.0.dylib
Reason: image not found

The current release (v1.3.2) is linked against OpenCV 4.0, while the newest OpenCV on Homebrew is 4.1, resulting in PixelAnnotationTool not being able to find the indicated dynamic library file.

It was easy to build PixelAnnotationTool from sources using the provided instructions. In my case it was as simple as:

git clone https://github.com/abreheret/PixelAnnotationTool.git
cd PixelAnnotationTool
mkdir x64
cd x64
cmake -DQT5_DIR=/usr/local/Cellar/qt/5.12.3/lib/cmake -G "Unix Makefiles" ..

Of course you'll need to install qt first, e.g., with Homebrew using brew install qt.

When I check the linked libraries using otool -L PixelAnnotationTool.app/Contents/MacOS/PixelAnnotationTool | grep libopencv_gapi I get the following result for library that was missing before:

/usr/local/opt/opencv/lib/libopencv_gapi.4.1.dylib (compatibility version 4.1.0, current version 4.1.0)

EDIT: I've changed the generator in the cmake command from "macOS Makefiles" to "Unix Makefiles", since there is no specific generator for macOS (though the Unix generator works!).

this process doesnt work for me @benjaminvdb - i hit error

CMake Error: Could not create named generator macOS Makefiles

Generators
Unix Makefiles = Generates standard UNIX makefiles.
Ninja = Generates build.ninja files.
Xcode = Generate Xcode project files.
CodeBlocks - Ninja = Generates CodeBlocks project files.
CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
CodeLite - Ninja = Generates CodeLite project files.
CodeLite - Unix Makefiles = Generates CodeLite project files.
Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
Sublime Text 2 - Unix Makefiles
= Generates Sublime Text 2 project files.
Kate - Ninja = Generates Kate project files.
Kate - Unix Makefiles = Generates Kate project files.
Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

I tried using make with "Unix Makefiles" and at a commmand line things looked good, however when i try and run the pixelannotator it still crashes:

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
Library not loaded: @rpath/libopencv_imgproc.4.0.dylib
Referenced from: /private/var/folders/k3/pcmf6x752_n9nyswtw_4k9dr0000gn/T/AppTranslocation/DFE8FE3E-C0E7-4AED-BC45-A0F529EB5CAF/d/PixelAnnotationTool.app/Contents/Frameworks/libopencv_gapi.4.0.dylib
Reason: image not found

when i run command below it appears to be linked to 4.1?

otool -L PixelAnnotationTool.app/Contents/MacOS/PixelAnnotationTool | grep libopencv_gapi
/usr/local/opt/opencv/lib/libopencv_gapi.4.1.dylib (compatibility version 4.1.0, current version 4.1.0)

@roryw10 : sorry about the wrong generator in the CMake command. I assumed there was a macOS generator, but I actually used the Unix one. The command you tried is the right one and I've edited my comment above accordingly.

Indeed, it seems that the binary is linked to the correct library, but it doesn't find it when you run it. Since you have libopencv_gapi.4.1.dylib under /usr/local, have you tried adding Homebrew's library path to your LD_LIBRARY_PATH environment variable, i.e., export LD_LIBRARY_PATH=/usr/local/lib? If that works, you can add it to your shell profile (e.g. .bashrc). I already had this set myself, so that's why I could be working for me, but not for you.

For information, I can not help you, because I do not have mac. The macOS distributed versions (dmg file) are made with travis.
If you find a stable solution I am interested.

To add to @benjaminvdb's solution for those that may not be familiar with how to compile mac apps or Makefiles:

First, install Xcode.

Then run the following commands:

brew install opencv && brew install cmake && brew install qt
git clone https://github.com/abreheret/PixelAnnotationTool.git
cd PixelAnnotationTool
mkdir x64
cd x64
cmake -DQT5_DIR=/usr/local/Cellar/qt/5.12.3/lib/cmake -G "Unix Makefiles" ..
make all
open PixelAnnotationTool.app/

To add to @benjaminvdb's solution for those that may not be familiar with how to compile mac apps or Makefiles:

First, install Xcode.

Then run the following commands:

brew install opencv && brew install cmake && brew install qt
git clone https://github.com/abreheret/PixelAnnotationTool.git
cd PixelAnnotationTool
mkdir x64
cd x64
cmake -DQT5_DIR=/usr/local/Cellar/qt/5.12.3/lib/cmake -G "Unix Makefiles" ..
make all
open PixelAnnotationTool.app/

When trying this myself on a mac with Mojave, I had issue at the make all step. I was having a failure saying the make file couldn't find the Qt5Widgets. So I needed to edit line 50 of the CMakeLists.txt file located in the PixelAnnotationTool directory.

Original line:
find_path(Qt5Widgets_DIR Qt5WidgetsConfig.cmake PATHS "${QT5_DIR}/Qt5Widgets" )

Correction:
find_path(Qt5Widgets_DIR Qt5WidgetsConfig.cmake PATHS "/usr/local/Cellar/qt/5.13.1/lib/cmake/Qt5Widgets" )

Once that was changed running make worked just fine.

Do you have alway this problem with the new version 1.4 ?

Do you have alway this problem with the new version 1.4 ?

@abreheret I can now simply run the v1.4.0 macOS release without building it myself. Thanks! ๐Ÿ‘
Screenshot 2020-03-05 at 9 22 27