Closed trevorsandy closed 5 years ago
On macOS, the POVRay and LDView library dependencies are checked on startup. If any of the required libraries are missing, a flag indicating such is written to the plist.
A library check is performed at startup if the plist settings indicates there are missing renderer libraries. If the setting returns false for missing libraries, no check is performed; therefore, once the missing libraries are installed, no further checks are performed.
It looks like we have a bit of "cat and mouse" here. Apparently, since the last update of this ticket and the release of v2.3.0, the homebrew libpng version has incremented from 51.0.0 to 52.0.0 and consequently on Travis CI where the production instance of LPub3D is built. As a result, the library dependency check as currently designed (check if library exist) is pretty much useless.
As such, the LDView renderer will not launch for LPub3D v2.3.0 on macOS unless the libpng version is 1.6.35, You can confirm this behaviour by navigating to LDView within the LPub3D application bundle and clicking the executable to launch it. Upon doing this, you should receive this console output:
Your-Mac:~ yourlogin$ /Applications/LPub3D.app/Contents/3rdParty/ldview-4.3/bin/ldview ; exit;
dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
Referenced from: /Applications/LPub3D.app/Contents/3rdParty/ldview-4.3/bin/ldview
Reason: Incompatible library version: ldview requires version 52.0.0 or later, but libpng16.16.dylib provides version 51.0.0
Abort trap: 6
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...15 completed.
[Process completed]
To correct this behaviour, if not already updated, follow the Current Solution section below to update your instance of libpng on macOS.
Taking this scenario into account, it looks like I'll have to do 2 things to ensure this behaviour is put to bed for good.
First, specify the precise, and sufficiently backwards looking, version of libpng to be installed when building the Travis-CI environment and make that version of libpng the source of the LPub3D startup check.
Second, it will not be enough to simply check if the libpng file exist but also interrogate the version information.
Install brew (if not already installed)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Reinstall libpng
$ brew update
$ brew reinstall libpng
Check installed libraries - particularly libPNG as version 52.0.0 is required for LPub3D v2.3.0
$ otool -L $(brew list libpng | grep dylib$)
/usr/local/Cellar/libpng/1.6.35/lib/libpng.dylib:
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 52.0.0, current version 52.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
Closed for 2.3.1.
Will restore for later release when I decide to implement the automated notification defined above.
Update for v2.3.4.
Add automatic library check on application load. Update required library versions.
Cheers,
Subject of the issue
LDView does not load on macOS
Error log: "dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib Referenced from: /Applications/LPub3D.app/Contents/3rdParty/ldview-4.3/bin/LDView Reason: Incompatible library version: LDView requires version 51.0.0 or later, but libpng16.16.dylib provides version 33.0.0"... but I have no idea on How to solve this!!
Your environment
Workaround
Install missing libraries:
Required LPub3D libraries on macOS
LDView:
XQuartz (OSMesa) https://www.xquartz.org
/opt/X11/lib/libOSMesa.8.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/X11/lib/libGLU.1.dylib (compatibility version 5.0.0, current version 5.1.0)
LibPNG version 1.6.35 or above http://www.libpng.org
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 52.0.0, current version 52.0.0)
GL2PS version 1.3.5 or above http://geuz.org/gl2ps
/usr/local/opt/gl2ps/lib/libgl2ps.1.dylib (compatibility version 1.0.0, current version 1.4.0)
LibJPEG version 1.4 or above http://www.ijg.org
/usr/local/opt/jpeg/lib/libjpeg.9.dylib (compatibility version 13.0.0, current version 13.0.0)
TinyXML version 2.5.2 or above http://www.grinninglizard.com/tinyxml/
/usr/local/opt/tinyxml/lib/libtinyxml.dylib (compatibility version 0.0.0, current version 0.0.0)
MiniZIP version 1.1.0 or above http://www.winimage.com/zLibDll/minizip.html
POVRay:
XQuartz (X11)
LibTIFF version 3.6.1 or above http://www.libtiff.org
/usr/local/opt/libtiff/lib/libtiff.5.dylib (compatibility version 9.0.0, current version 9.0.0)
OpenEXR version 1.2 or above http://www.openexr.com
SDL version 2.0.2 or above (used for the display preview) http://www.libsdl.org
/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib (compatibility version 10.0.0, current version 10.0.0)
Install brew (if not already installed)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install libraries
$ brew update
$ brew reinstall libpng
$ brew install tinyxml gl2ps libjpeg minizip openexr sdl2 libtiff
Check installed libraries - particularly libPNG as version 52.0.0 is required
$ otool -L $(brew list libpng | grep dylib$)
/usr/local/Cellar/libpng/1.6.35/lib/libpng.dylib:
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 52.0.0, current version 52.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
Treating “dyld image not found” return
-See the steps from this excellent post: Fixing dyld image not found on Mac OS.
Solution
Within LPub3D, inform the user when renderer library dependencies are not satisfied.