question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

macOS stand-alone client fails

See original GitHub issue

With PR #11 initializing a Server object and connecting a client to this server works. However, when trying to build the Client as standalone, an exception is raised. Strangely, the path should be added (see client.py) and the file libiomp5.dylib is in the folder.

Exception                                 Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in com.comsol.model.util.ModelUtil.initStandalone()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in com.comsol.model.util.ServerModelUtil.initStandalone()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in com.comsol.model.util.ServerModelUtil.initStandalone()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in java.security.AccessController.doPrivileged()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in com.comsol.model.util.ServerModelUtil$17.run()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in java.lang.System.load()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in java.lang.Runtime.load0()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in java.lang.ClassLoader.loadLibrary()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in java.lang.ClassLoader.loadLibrary0()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_jpype.cpython-37m-darwin.so in java.lang.ClassLoader$NativeLibrary.load()

Exception: Java Exception

The above exception was the direct cause of the following exception:

java.lang.UnsatisfiedLinkError            Traceback (most recent call last)
<ipython-input-3-23d2b50bf9f8> in <module>
----> 1 c = mph.Client()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mph/client.py in __init__(self, cores, version, port, host)
    147             logger.info('Initializing stand-alone client.')
    148             graphics = True
--> 149             java.initStandalone(graphics)
    150             logger.info('Stand-alone client initialized.')
    151         # Otherwise skip stand-alone initialization and connect to server.

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /Applications/COMSOL55/Multiphysics/lib/maci64/libcssystemutil.dylib: dlopen(/Applications/COMSOL55/Multiphysics/lib/maci64/libcssystemutil.dylib, 1): Library not loaded: @rpath/libiomp5.dylib
  Referenced from: /Applications/COMSOL55/Multiphysics/lib/maci64/libcssystemutil.dylib
  Reason: image not found

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shomikvermacommented, May 1, 2022

I may have found solution to this - setting DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH. As discussed here, macos only checks in the fallback path if the library isn’t found in the default path. This ensures nothing breaks when adding the COMSOL paths necessary. Setting:

export DYLD_FALLBACK_LIBRARY_PATH=/Applications/COMSOL56/Multiphysics/lib/maci64:/Applications/COMSOL56/Multiphysics/ext/graphicsmagick/maci64:/Applications/COMSOL56/Multiphysics/ext/cadimport/maci64

allows me to do:

In [1]: import mph

In [2]: import matplotlib.pyplot as plt

In [3]: mph.option('session','stand-alone')

In [4]: client = mph.start(1)

with no issues! I also had to change line 481 in client.py to DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH so the script would check the right environment variable.

0reactions
john-hencommented, May 1, 2022

Thanks for looking into this and reporting back. Good to know, I was not aware of that. This may help people who want to use stand-alone mode on macOS, but run into compatibility problems with other graphics libraries.

Strange though that there seems to be no Linux equivalent, like LD_FALLBACK_LIBRARY_PATH. At least a cursory web search did not turn up anything.

I’ll fix the checks of the environment variables in the next release. They are not necessary anyway, but certainly shouldn’t get in the way of doing things right.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Standalone Endpoint Security Client for Mac OS fails to ...
Standalone Endpoint Security Client for Mac OS fails to connect with "ERROR - initializing firewall" error message.
Read more >
If an error occurred while updating or installing macOS
The message might say that an error occurred while downloading, preparing, or installing, or that the installer is damaged or could not be ......
Read more >
Mac Installation Errors You May Encounter and How to Fix Them
In this guide, we will look at some of the installation problems that tend to occur with new releases of the Mac operating...
Read more >
After upgrading to macOS 13 Ventura, Endpoint Security for ...
After upgrading to macOS 13 Ventura, Endpoint Security for Mac informs you that Full Disk Access is not granted for the BDLDaemon.app file....
Read more >
macOS Monterey Installation Failed - YouTube
Hey everyone, today we are going to be looking at a macbook pro install error with macOS MontereyNeed help with your repair?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found