-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
Mac OS Sundials bug #1296
Comments
I couldn't reproduce this, for instance this GitHub workflow installs sundials using homebrew and runs the tests for the scikits.odes solver fine. Using Homebrew is also preferable for compiling the You're right that the CI workflow should use Homebrew instead of the KLU script on macos. I suspect it's a simple oversight when switching to using tox in the workflow. |
I think I have the same issue. I just installed pybamm in a fresh venv on my Mac. Used "pip install pybamm". (Note that I never did "brew install sundials" as mentioned by @tinosulzer ) The install seemed to work fine, but then I get an error when importing pybamm:
I'm not sure what to do to get it working. FYI, here's what pip reported after the install:
|
Thanks for the extra information. Can you see if this fixes it:
|
Thanks for the responding. Unfortunately, I don't even have a I did try running the |
Ah I see you are installing pybamm via pip now, which should mean you don't have access to the IDAKLU solver. But weirdly, here it is finding an |
Hi @shday and @tinosulzer, I sense there is a bit of confusion here, which I hope I can clear. Short answerIf you're on MacOS, you must install the sundials library yourself. There are several ways to do that, but the most straightforward is to use Homebrew, following the instructions available here. I suggest you give it a try and tell us the result. Longer answer:Whenever you type Now, you could also choose to clone the PyBaMM repo and install pybamm from that instead of the archive available on PyPI. This would be a good choice if you wanted to e.g. modify/contribute to PyBaMM. In this case however, you don't benefit from the pre-compiled modules and dependencies, and you'll have to do it yourself. As you've noticed already, the PyBaMM repo contains a python script that automatically downloads, compile and install the sundials library ( I hope that's helpful - both in practice as well as to help understand the different moving parts. |
Ahh that clears some things up, thanks @tlestang ! |
Thanks for the explanation. I tried |
Unfortunately pybamm isn't guaranteed to work with python 3.9 yet as we are still waiting for some dependencies to upgrade. Testing now to see if it works anyway: https://github.com/pybamm-team/PyBaMM/runs/1655551286 |
Hi all, I get the same error as @shday when importing pybamm. I did the brew install sundials and the pip install pybamm, both of which seemed to have installed fine. I am very new to working with Python and did not install it in a virtual environment, which could be the cause of my issue. From @tinosulzer comment about a potential fix, I will say that when looking for the |
So you get an error like
but that exact file does exist? Can you try the |
@tinosulzer I was mistaken that I had the exact same error as @shday, my error is:
I looked for the The only activate file I found was not in a bin folder but in a scripts folder buried deep in a mess of versions and frameworks, this along with the fact that it did not have a line similar to |
Did you use a virtual environment, conda, or tox to install? |
I believe I used conda because I set up my python space by downloading Anaconda. Also did not create a virtual environment and am not familiar with tox. |
I'm not sure how to help if you didn't use a virtual environment. Could you try again using a virtual environment? |
Descirbe the bug
scikits.odes does not work ("image not found") when following installation instructions
Explanation
As I understand it the problem is that scikits.odes looks for
libsundials_sunlinsolklu.3.dylib
, butbrew install sundials
installs a more recent version, which only hasso
libsundials_sunlinsolklu.3.dylib
cannot be found.This is not caught by the Mac OS tests since in CI the Mac OS tests use the script
install_KLU_Sundials.py
Furthermore, if installing locally, with
tox -e pybamm-requires
, the script is used (which installs the correct version of sundials) but onlyLD_LIBRARY_PATH
is updated, and notDYLD_LIBRARY_PATH
as should be the case for mac.This means that scikits.odes is still looking in
/usr/local/opt/
for sundials, where it finds the incorrect brew installation, instead of in~/.local/lib
** Solution **
brew install sundials
from docsDYLD_LIBRARY_PATH
This could also be an opportunity to clean up the install docs, which I still find a little bit confusing
The text was updated successfully, but these errors were encountered: