SSARCandy / Coherent-Line-Drawing

🖼✨Automatically generates line drawing from a photograph
https://ssarcandy.tw/2017/06/26/Coherent-Line-Drawing/
MIT License
556 stars 61 forks source link

Won't run - crashes on startup #8

Closed Tom1827 closed 6 years ago

Tom1827 commented 7 years ago

Running the pre-compiled executable gives me:

/Users/x/Downloads/release-macos/Coherent-Line-Drawing ; exit;
MacBook-Pro:~ x$ /Users/x/Downloads/release-macos/Coherent-Line-Drawing ; exit;
dyld: Library not loaded: lib/libopencv_xphoto.3.1.dylib
  Referenced from: /Users/x/Downloads/release-macos/Coherent-Line-Drawing
  Reason: image not found
Abort trap: 6
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

This is on a 2017 MacBook Pro, running macOS 10.12.6

SSARCandy commented 7 years ago

could you try:

$ export DYLD_LIBRARY_PATH=/Users/x/Downloads/release-macos/Coherent-Line-Drawing/lib
bkrpub commented 6 years ago

Had the same problem, already tried that, but then it crashes for another dependency: bkr@lucy:~ $ DYLD_LIBRARY_PATH=/local/Users/bkr/Downloads/release-macos/lib /local/Users/bkr/Downloads/release-macos/Coherent-Line-Drawing dyld: Library not loaded: /usr/local/opt/xz/lib/liblzma.5.dylib Referenced from: /local/Users/bkr/Downloads/release-macos/Coherent-Line-Drawing Reason: Incompatible library version: Coherent-Line-Drawing requires version 8.0.0 or later, but liblzma.5.dylib provides version 6.0.0 Abort trap: 6

While a prebuilt binary should not reference the library in this location I tried to symlink it to the most recent version of stable liblzma (which is 5.2.3) but without success.

SSARCandy commented 6 years ago

I re-built macOS version, @Tom1827 @bkrpub please try it.

https://www.dropbox.com/s/jfh4s5q3t7hdnw5/Coherent-Line-Drawing.zip?dl=0

If it works, please tell me so I can update the release, thanks!

bkrpub commented 6 years ago

Thank you very much for your quick reaction. It still does not work becasue the binary still references liblzma from /opt.

You can check which dynamic libaries an executable loads with otool -L: /local/Users/bkr/Downloads/Coherent-Line-Drawing/Products/Applications bkr@lucy:Applications $ otool -L Coherent-Line-Drawing | grep lzma /usr/local/opt/xz/lib/liblzma.5.dylib (compatibility version 8.0.0, current version 8.3.0)

Maybe you have variables set in your environment from macports (the path looks like macports to me) that make the build process select another library? (configure scripts sometimes find them too)

Another mystery is that the app is linked against liblzma5 (which provides version 6.0.0 in my case) but expects version 8.0.0 (those are the dynamic library version numbers, not necessarily the product version number).

Kind regards, Bjoern

SSARCandy commented 6 years ago

@bkrpub thanks for you explanation! here is the new pre-build... plz try it again. https://www.dropbox.com/s/y6jr7mba7bjtjg1/Coherent-Line-Drawing%202017-11-12%2001-28-50.zip?dl=0

I remove liblzma and change opencv's *.dylib search path to relative path that included inside this new release.

now the otool -L Coherent-Line-Drawing | grep .dylib output:

$ otool -L Coherent-Line-Drawing | grep dylib
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
    /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 8.0.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    lib/libopencv_core.3.1.dylib (compatibility version 3.1.0, current version 3.1.0)
    lib/libopencv_imgcodecs.3.1.dylib (compatibility version 3.1.0, current version 3.1.0)
    lib/libopencv_imgproc.3.1.dylib (compatibility version 3.1.0, current version 3.1.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
Tom1827 commented 6 years ago

Yes, thanks for the responsiveness, @SSARCandy. I just tried the new build from the Dropbox link, and I receive the following error:

dyld: Library not loaded: /usr/lib/system/libsystem_darwin.dylib
  Referenced from: /Users/x/Downloads/Coherent-Line-Drawing 2017-11-11 22-53-54/Products/Applications/lib/libSystem.B.dylib
  Reason: image not found
Abort trap: 6
SSARCandy commented 6 years ago

@Tom1827 you downloaded the older version, could you try this? https://www.dropbox.com/s/y6jr7mba7bjtjg1/Coherent-Line-Drawing%202017-11-12%2001-28-50.zip?dl=0

after unzip, use terminal to goto the application folder and run it:

$ cd ~/Coherent-Line-Drawing 2017-11-12 01-28-50/Products/applications
$ ./Coherent-Line-Drawing
Tom1827 commented 6 years ago

Ah, apologies.

The new version runs perfectly - thanks very much!

SSARCandy commented 6 years ago

Thanks all of you help me with this issue 😄 I had updated the Release file.

Going to close this issue.

bkrpub commented 6 years ago

Yes, perfect, thank you very much.