RenderToolbox / RenderToolbox4

Matlab toolbox for managing 3D scenes and physically-based rendering.
MIT License
48 stars 7 forks source link

Fresh install fails due to libassimp dependencies (version hell?) #37

Closed spitschan closed 7 years ago

spitschan commented 7 years ago

Hi,

I installed RenderToolbox4 following the installation guide. tbUse('RenderToolbox4'); passes all tests, but testing the installation with rtbTestInstallation(); fails with the following error message:

>> rtbTestInstallation();
Checking working folder:
  folder exists: /Users/spitschan/Documents/MATLAB/render_toolbox
  OK.
Trying to write: /Users/spitschan/Documents/MATLAB/render_toolbox/test.txt
  OK.
Checking for OpenEXR:
  brew list | grep openexr
  OK.
Checking for Docker:
  docker ps
  OK.

Testing rendering with 4 example scripts.
You should see several figures with rendered images.

MakeSceneFiles started at 30-Aug-2017 15:43:23.

Using strategy RtbAssimpStrategy

MakeSceneFiles started at 30-Aug-2017 15:43:26.

Using strategy RtbAssimpStrategy

MakeSceneFiles started at 30-Aug-2017 15:43:28.

Using strategy RtbAssimpStrategy

MakeSceneFiles started at 30-Aug-2017 15:43:30.

Using strategy RtbAssimpStrategy

0 scenes succeeded.

4 scenes failed.

----
1 rtbMakeCoordinatesTest.m
  MException with properties:

    identifier: 'MATLAB:mex:ErrInvalidMEXFile'
       message: 'Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:↵'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'↵↵Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.'
         cause: {}
         stack: [8×1 struct]

Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:
'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'

Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.

----
2 rtbMakeDragon.m
  MException with properties:

    identifier: 'MATLAB:mex:ErrInvalidMEXFile'
       message: 'Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:↵'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'↵↵Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.'
         cause: {}
         stack: [8×1 struct]

Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:
'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'

Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.

----
3 rtbMakeMaterialSphereBumps.m
  MException with properties:

    identifier: 'MATLAB:mex:ErrInvalidMEXFile'
       message: 'Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:↵'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'↵↵Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.'
         cause: {}
         stack: [8×1 struct]

Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:
'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'

Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.

----
4 rtbMakeMaterialSphereRemodeled.m
  MException with properties:

    identifier: 'MATLAB:mex:ErrInvalidMEXFile'
       message: 'Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:↵'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'↵↵Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.'
         cause: {}
         stack: [8×1 struct]

Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:
'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'

Missing symbol '_strcmp' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'.

Elapsed time is 9.529469 seconds.

No referenceRoot provided.  Local renderings
will not be compared with reference renderings.

I'm using the default RenderToolbox4.m file for local configuration.

This is on Sierra 10.12.6, MATLAB_R2017a. It looks like there might be a version issue, since it's looking for libassimp3.dylib in /usr/local/, though presumably it should be looking in /usr/local/lib.

The installed version of assimp is 4.0.1 (via homebrew):

macadam:~ spitschan$ brew list assimp
/usr/local/Cellar/assimp/4.0.1/bin/assimp
/usr/local/Cellar/assimp/4.0.1/include/assimp/ (46 files)
/usr/local/Cellar/assimp/4.0.1/lib/libassimp.4.0.1.dylib
/usr/local/Cellar/assimp/4.0.1/lib/cmake/ (2 files)
/usr/local/Cellar/assimp/4.0.1/lib/pkgconfig/assimp.pc
/usr/local/Cellar/assimp/4.0.1/lib/ (2 other files)

The installed version of openexr is 2.2.0 (via homebrew):

macadam:~ spitschan$ brew list openexr
/usr/local/Cellar/openexr/2.2.0/bin/exrenvmap
/usr/local/Cellar/openexr/2.2.0/bin/exrheader
/usr/local/Cellar/openexr/2.2.0/bin/exrmakepreview
/usr/local/Cellar/openexr/2.2.0/bin/exrmaketiled
/usr/local/Cellar/openexr/2.2.0/bin/exrmultipart
/usr/local/Cellar/openexr/2.2.0/bin/exrmultiview
/usr/local/Cellar/openexr/2.2.0/bin/exrstdattr
/usr/local/Cellar/openexr/2.2.0/include/OpenEXR/ (87 files)
/usr/local/Cellar/openexr/2.2.0/lib/libIlmImf-2_2.22.dylib
/usr/local/Cellar/openexr/2.2.0/lib/libIlmImfUtil-2_2.22.dylib
/usr/local/Cellar/openexr/2.2.0/lib/pkgconfig/OpenEXR.pc
/usr/local/Cellar/openexr/2.2.0/lib/ (4 other files)
/usr/local/Cellar/openexr/2.2.0/share/aclocal/openexr.m4
/usr/local/Cellar/openexr/2.2.0/share/doc/ (22 files)

Any suggestions?

npcottaris commented 7 years ago

There is an extra / in /user/local/. For some reason the Cellar/libpath is not inserted there under Sierra. Was brew installed on your machine before your upgraded it to Sierra? If so delete brew, do a fresh install and retry the above.

spitschan commented 7 years ago

Negative. I uninstalled brew using

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

and reinstalled using

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

as per the brew recipe here: https://github.com/Homebrew/install

Then, reinstalled the packages I had, including assimp and openexr.

Same issue as before, with the common error message:

Invalid MEX-file '/Users/spitschan/Documents/MATLAB/toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64': Missing dependent shared libraries:
'/usr/local//libassimp.3.dylib' required by '/Users/spitschan/Documents/MATLAB/Toolboxes/mexximp_binary/build/mexximpConstants.mexmaci64'
spitschan commented 7 years ago

This was fixed by recompiling the mexximp package as follows:

I went to Toolboxes/mexximp and ran makeMexximp, which created new binaries in build. I moved these over to Toolboxes/mexximp_binary, since I expect that that's where the test program rtbTestInstallation is looking.

Requires Xcode installed and the Xcode license agreement accepted.