-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
Compiling library and Python binding on Apple M1 #276
Comments
I managed to get the program to compile but now python can't find the dynamic libraries. I manually tracked down the libraries with the correct functions in them and had to I use these libraries:
Why doesn't 'python3-config --includes --ldflags' return the correct location for the libraries? But now when I try to run the program I get the following error:
If I start python in the correct conda/miniforge environment and load sys I get the following:
Why does the conda/miniforge3 python version not look in the conda/miniforge libraries? Also, python says "'/usr/local/lib/libpython3.9.dylib' (no such file)" but /usr/local/lib/ isn't on the list provided by sys.path. I think I have some variable setup incorrectly, or miniforge isn't setting things up properly, but I'm not sure. |
This is using system ipython and not miniforge's python. You need to do |
D'oh, yup! It is right there when it starts up :/ Any reason I shouldn't use If I just run python (instead of ipython) I get the following error:
Something isn't stirring the Kool-Aid. I discovered I should have used /Users/brendan/miniforge3/envs/SRW as the base directory for libraries, and tried compiling against that, but I get the same segmentation fault. |
Nope. Can't know what the segfault is about. Do you have a backtrace? |
I do not have a backtrace. From quick googling it looks like if python isn't giving me one by default I'd have to edit the source code. I'm out of my depth here though. This is how I produce the segfault:
|
Does this help:
I think it means there is something wrong with |
can you send the makefile? |
Sure!
|
Change |
I think that made things worse?
|
A similar problem can be found here, but I can't make heads or tails of it. It seems like the library conda python is using and the library SRW is using are different. It would seem to stem from conda python being linked statically. |
I tried to compile everything in osx-64 to no avail. I get the following error when running a SRW example: Process 46946 stopped
Now that I am typing this out I wonder if I should have set architecture, then installed python using conda. i.e. step 2 then step 1 above. Edit: The order of steps 1 and 2 doesn't seem to matter. |
Solution to issue cannot be found in the documentation.
Issue
I am trying to compile a piece of niche software called SRW using miniforge3 for arm64. The software installs just fine using the system python. When using conda/miniforge, the issue is that the compiler can't seem to find the correct libraries so I get an error like (complete error is below):
The steps to reproduce this output are:
Install miniforge3
Clone SRW
git clone https://github.com/ochubar/SRW.git
Compile fftw3, instructions are in section III.1.2.1 here:
https://github.com/ochubar/SRW
You'll need to compile both versions of 3.3.8, but no 2.1.5
change to directory SRW/cpp/gcc
Update the makefile (copy of file I use below)
changes are:
A) CC = gcc, CXX = g+=
B) CFLAGS+= -D__MAC__
C) Get rid of -DLINUX flag hard coded into SRW_SRC_DEF
D) Update PYFLAGS
make lib
make pylib (this generates the error)
Complete error:
Makefile
Another library error
I recognize that the miniforge env PYPATH doesn't have the -lpython3.9, that is because when I include that I get a different error.
Installed packages
Environment info
The text was updated successfully, but these errors were encountered: