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

PETSc Example cannot be run on macOS 14.5 due to Library not loaded: libX11.6.dylib #272

Open
fahim831 opened this issue May 29, 2024 · 16 comments
Assignees
Labels
Priority:Normal Normal Priority Issue or PR

Comments

@fahim831
Copy link

fahim831 commented May 29, 2024

I am trying to run the simplest PETSc example. However, on the line where I call petsc.petsc_dae_by_time_element, I get an error message. I have tried running brew install xquartz --cask and restarting my computer as well but keep getting the below error message:

2024-05-29 16:38:58 [INFO] idaes.solve.petsc-dae: dyld[3865]: Library not loaded: /usr/local/opt/libx11/lib/libX11.6.dylib
2024-05-29 16:38:58 [INFO] idaes.solve.petsc-dae:   Referenced from: <F588438D-238F-3459-8B4A-7CC7BCFD83E8> /Users/$USER/.idaes/bin/petsc
2024-05-29 16:38:58 [INFO] idaes.solve.petsc-dae:   Reason: tried: '/libX11.6.dylib' (no such file), '/Users/$USER/.idaes/bin/libX11.6.dylib' (no such file), '/usr/local/opt/libx11/lib/libX11.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libx11/lib/libX11.6.dylib' (no such file), '/usr/local/opt/libx11/lib/libX11.6.dylib' (no such file), '/usr/local/lib/libX11.6.dylib' (no such file), '/usr/lib/libX11.6.dylib' (no such file, not in dyld cache)

By the way, I can solve DAEs with pyomo.dae outside of IDAES right now.

@andrewlee94
Copy link
Member

In order to help, we will need to know more about the system you are working on.

Looking at the error message it appears that there is a missing .dylib file, so you may need to install that separately.

@fahim831
Copy link
Author

The system is macOS Sonoma 14.5.

How should I install that file separately? I installed petsc using this from the instructions:
daes get-extensions --extra petsc

@andrewlee94
Copy link
Member

Unfortunately we don't have a lot of people who use Macs. @eslickj @adowling2 @Robbybp @bknueven Would one of you be able to provide any insight on this?

@Robbybp
Copy link
Member

Robbybp commented May 30, 2024

Have you tried brew install libx11? There seems to be a homebrew formula for this library.

@Robbybp
Copy link
Member

Robbybp commented May 30, 2024

I haven't seen this before, but also haven't updated to MacOS 14. Have you tried this on MacOS 13?

@lbianchi-lbl lbianchi-lbl changed the title PETSc Example cannot be run PETSc Example cannot be run on macOS 14.5 due to Library not loaded: libX11.6.dylib May 30, 2024
@lbianchi-lbl
Copy link

This is just a guess from my side, but could the machine architecture (ARM/Apple Silicon vs Intel) be relevant here? As of today, I'm not sure of the extent to which macOS is supported by the various subcomponents of the IDAES extensions.

@fahim831
Copy link
Author

I just used brew install libx11 and restarted the terminal but it didn't help. I get the same error.

I don't think it's possible to revert my system back to 13 as it came with 14 and I didn't do the update myself.

@lbianchi-lbl I don't know if machine architecture is the issue but this does have an M2 chip so you may be onto something. Is there anything I can do to check?

@Robbybp
Copy link
Member

Robbybp commented May 30, 2024

If you have the the x11 library, but petsc can't find it, maybe you need to update DYLD_LIBRARY_PATH? I can try to reproduce this (I have a MacOS 14 machine at home), but may not get around to it for a while.

@bknueven
Copy link

bknueven commented May 30, 2024

I do have macOS 14.5 with an ARM chip. But I cannot reproduce this issue. I have attached the output of conda list in case it is useful.
watertap_env.log

EDIT: Further, I cannot find the missing library in the places the error message says it looks.

@fahim831
Copy link
Author

@Robbybp Thank you, I will see how I can update that path and to what, after I try installing some of the packages in the other comment.

@bknueven Thank you. Maybe I will try installing the packages starting with lib and see if the required library gets installed among those.

@adowling2
Copy link
Contributor

I've had to use LD PATH to get solver executables to work when not doing import idaes on an M1-Mac.

@fahim831
Copy link
Author

fahim831 commented May 30, 2024

After searching the issue a bit more, adding the DYLD_LIBRARY_PATH seemed to be a risky thing to do. Since I only needed that one file, I went to /opt/X11/lib, where the libX11.6.dylib file was, and manually just copied it to /usr/local/opt/libx11/lib based on the error message's list of places it looked at before returning the error. It works now. Thanks, everyone.

@ksbeattie ksbeattie transferred this issue from IDAES/idaes-pse May 30, 2024
@dangunter
Copy link
Member

Maybe adding the flag mentioned here to the configuration of the build will help:
https://lists.mcs.anl.gov/pipermail/petsc-users/2020-April/040728.html

@eslickj
Copy link
Member

eslickj commented May 31, 2024

I think you can use install_name_tool to change where an executable looks for a library. Then you don't need to set DYLD_LIBRARY_PATH. I don’t remember PETSc linking X11. If there is a new build, I wonder in configure picked up X11 just because it’s there on whatever its being built on.

@eslickj
Copy link
Member

eslickj commented May 31, 2024

if [ ${osname} = "darwin" ]; then

That’s the section that copies the dependencies from homebrew. X11 isn’t there. And I don’t think it was previously a dependency, but i guess license permitting it could be added.

Get-extensions has a —release option. You could try to go back to previous releases to see if they work.

@adowling2
Copy link
Contributor

@fahim831 another option to try instead of copying the file is to make a symbolic link. (I'm posting here in case someone in the future comes across this issue.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

No branches or pull requests

9 participants