Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2.0 installation with MATLAB fails runCanteraTests.m.passed #285

Closed
Gflat opened this issue Jul 9, 2015 · 4 comments · Fixed by #309
Closed

2.2.0 installation with MATLAB fails runCanteraTests.m.passed #285

Gflat opened this issue Jul 9, 2015 · 4 comments · Fixed by #309

Comments

@Gflat
Copy link

Gflat commented Jul 9, 2015

Troubleshooting a mac installation issue using homebrew/science (https://github.com/Homebrew/homebrew-science/issues/2170).

It seems that the installation is checking an outdated DYLD_ variable in the MATLAB installation path rather than preferring the (good) libraries available from the system.

Logs: https://gist.github.com/9f64e649446792e7c8ff

otool output using system libraries:

/usr/local/lib/libsundials_cvodes.2.dylib:
    /usr/local/lib/libsundials_cvodes.2.dylib (compatibility version 3.0.0, current version 3.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

otool output using MATLAB libraries:

/Applications/MATLAB_R2014b.app/bin/maci64/libsundials_cvodes.2.dylib:
    @rpath/libsundials_cvodes.2.dylib (compatibility version 2.0.0, current version 2.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
@tdsmith
Copy link

tdsmith commented Jul 9, 2015

This is the error message that's being thrown during the test:

===== Test Case Failure =====
Location: /private/tmp/cantera20150709-16151-icy3o9/test/matlab/testImport.m
Name:     testImportCTI

/private/tmp/cantera20150709-16151-icy3o9/interfaces/matlab/toolbox/@XML_Node/XML_Node.m at <a href="matlab: opentoline('/private/tmp/cantera20150709-16151-icy3o9/interfaces/matlab/toolbox/@XML_Node/XML_Node.m',20)">line 20</a>
/private/tmp/cantera20150709-16151-icy3o9/interfaces/matlab/toolbox/@Solution/Solution.m at <a href="matlab: opentoline('/private/tmp/cantera20150709-16151-icy3o9/interfaces/matlab/toolbox/@Solution/Solution.m',47)">line 47</a>
/private/tmp/cantera20150709-16151-icy3o9/interfaces/matlab/toolbox/importPhase.m at <a href="matlab: opentoline('/private/tmp/cantera20150709-16151-icy3o9/interfaces/matlab/toolbox/importPhase.m',17)">line 17</a>
/private/tmp/cantera20150709-16151-icy3o9/test/matlab/testImport.m at <a href="matlab: opentoline('/private/tmp/cantera20150709-16151-icy3o9/test/matlab/testImport.m',10)">line 10</a>



************************************************
                Cantera Error!                  
************************************************


Procedure: ct2ctml_string
Error:   Error converting input file "/private/tmp/cantera20150709-16151-icy3o9/data/inputs/h2o2.cti" to CTML.
Python command was: '/usr/local/opt/python/bin/python2.7'
The exit code was: 1
-------------- start of converter log --------------
sys.path: ['', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-12.0.5-py2.7.egg', '/usr/local/lib/python2.7/site-packages/setuptools-12.0.5-py2.7.egg', '/private/tmp/cantera20150709-16151-icy3o9/build/python2', '/private/tmp/cantera20150709-16151-icy3o9/cython/lib/python2.7/site-packages', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/usr/local/Cellar/numpy/1.9.1/libexec/nose/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages', '/usr/local/lib/python2.7/site-packages']

Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "/private/tmp/cantera20150709-16151-icy3o9/build/python2/cantera/__init__.py", line 1, in <module>
    from ._cantera import *
ImportError: dlopen(/private/tmp/cantera20150709-16151-icy3o9/build/python2/cantera/_cantera.so, 2): Library not loaded: /usr/local/lib/libsundials_cvodes.2.dylib
  Referenced from: /private/tmp/cantera20150709-16151-icy3o9/build/python2/cantera/_cantera.so
  Reason: Incompatible library version: _cantera.so requires version 3.0.0 or later, but libsundials_cvodes.2.dylib provides version 2.0.0
--------------- end of converter log ---------------

so we suspect MATLAB is overriding the dynamic linker search path and is finding its own libsundials_cvodes.2.dylib instead of the one in /usr/local/lib. We would like to know what we can do to encourage MATLAB to find the sundials against which we built cantera.

@speth
Copy link
Member

speth commented Jul 11, 2015

This is a pretty typical problem with Matlab (on Linux, the issue is usually with outdated versions of libstdc++ bundled with Matlab). While I would primarily regard this as a problem in Matlab, there is a hackish workaround in this case (which I posted previously on the Cantera Users' Group): get Cantera to link statically to the Sundials library by removing the Sundials shared libraries from /usr/local/lib before installing Cantera.

@speth
Copy link
Member

speth commented Nov 23, 2015

This isn't quite fixed yet -- this will be effectively resolved once the Homebrew formula is updated to always use the Sundials submodule, and there's still an issue with the Matlab test hanging, even though the resulting module works just fine.

@speth speth reopened this Nov 23, 2015
speth added a commit to speth/homebrew-science that referenced this issue Jan 27, 2016
speth added a commit to speth/homebrew-science that referenced this issue Jan 28, 2016
speth added a commit to speth/homebrew-science that referenced this issue Jan 29, 2016
speth added a commit to speth/homebrew-science that referenced this issue Jan 29, 2016
@speth
Copy link
Member

speth commented Feb 1, 2016

Resolved by homebrew/homebrew-science@c7327d96 for both Cantera 2.2 and the current development version.

@speth speth closed this as completed Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants