-
Notifications
You must be signed in to change notification settings
<
8000
li>
Fork
26
Bug cpython c_ext_L2.c compilation #307
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
Comments
Hi Felix,
What is the result of running `build_ext.sh`?
Ryan
…On Fri, Apr 4, 2025 at 8:39 PM Felix Rodriguez Cardozo < ***@***.***> wrote:
Hello,
Something happened in the latest approved pull request that changed the
compilation of c_ext_L2.c
<https://github.com/mtuqorg/mtuq/blob/master/mtuq/misfit/waveform/c_ext_L2.c>during
the execution of
conda env update --file env.yaml
After the installation, the file c_ext_L2.cpython-312-darwin.so created
in the same directory where c_ext_L2.c is located, did not work. I got this
error message when I simply tried to import a mtuq library.
from mtuq import read
/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/*init*.py:13:
SyntaxWarning: invalid escape sequence '|'
""" Waveform misfit function
Traceback (most recent call last):
File "", line 1, in
File "/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/*init*.py",
line 35, in
from mtuq.misfit import PolarityMisfit, WaveformMisfit
File "/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/*init*.py",
line 2, in
from mtuq.misfit.waveform import WaveformMisfit
File "/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
*init*.py", line 5, in
from mtuq.misfit.waveform import level0, level1, level2
File
"/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/level2.py",
line 14, in
from mtuq.misfit.waveform import c_ext_L2
ImportError:
dlopen(/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so, 0x0002): tried:
'/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so' (malformed load command #14
<#14> of 16 at 0x10258f610 with
mh=0x10258f000, size (0x0) too small),
'/System/Volumes/Preboot/Cryptexes/OS/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so' (no such file),
'/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so' (malformed load command #14
<#14> of 16 at 0x10258f610 with
mh=0x10258f000, size (0x0) too small)
Fortunately, I had installed mtuq before the latest commit and I changed
the c_ext_L2.cpython-312-darwin.so file that was not working for another
one compiled in a different mtuq environment from a previous installation.
Then eveything worked as expected (at least with the examples).
Of course, this is a temporary patch that only works for me, but I have
not found what may have changed that caused this behavior.
I tested the installation in two MacOS computers and the error is the same.
Thanks for your help.
Screenshot.2025-04-04.at.10.35.13.PM.png (view on web)
<https://github.com/user-attachments/assets/a0552912-6203-4cb2-ac51-7316f8fd6b90>
Screenshot.2025-04-04.at.10.35.01.PM.png (view on web)
<https://github.com/user-attachments/assets/116c4f3f-b576-406e-b34e-3beece684f3a>
—
Reply to this email directly, view it on GitHub
<#307>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCGSSXORJKMTWP5H6M7CC32X466JAVCNFSM6AAAAAB2P7QQLOVHI2DSMVQWIX3LMV43ASLTON2WKOZSHE3TGNZXGE3DCNY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
[image: SeismoFelix]*SeismoFelix* created an issue (mtuqorg/mtuq#307)
<#307>
Hello,
Something happened in the latest approved pull request that changed the
compilation of c_ext_L2.c
<https://github.com/mtuqorg/mtuq/blob/master/mtuq/misfit/waveform/c_ext_L2.c>during
the execution of
conda env update --file env.yaml
After the installation, the file c_ext_L2.cpython-312-darwin.so created
in the same directory where c_ext_L2.c is located, did not work. I got this
error message when I simply tried to import a mtuq library.
from mtuq import read
/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/*init*.py:13:
SyntaxWarning: invalid escape sequence '|'
""" Waveform misfit function
Traceback (most recent call last):
File "", line 1, in
File "/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/*init*.py",
line 35, in
from mtuq.misfit import PolarityMisfit, WaveformMisfit
File "/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/*init*.py",
line 2, in
from mtuq.misfit.waveform import WaveformMisfit
File "/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
*init*.py", line 5, in
from mtuq.misfit.waveform import level0, level1, level2
File
"/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/level2.py",
line 14, in
from mtuq.misfit.waveform import c_ext_L2
ImportError:
dlopen(/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so, 0x0002): tried:
'/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so' (malformed load command #14
<#14> of 16 at 0x10258f610 with
mh=0x10258f000, size (0x0) too small),
'/System/Volumes/Preboot/Cryptexes/OS/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so' (no such file),
'/Users/felix/Documents/Software/mtuq_test/mtuq/mtuq/misfit/waveform/
c_ext_L2.cpython-312-darwin.so' (malformed load command #14
<#14> of 16 at 0x10258f610 with
mh=0x10258f000, size (0x0) too small)
Fortunately, I had installed mtuq before the latest commit and I changed
the c_ext_L2.cpython-312-darwin.so file that was not working for another
one compiled in a different mtuq environment from a previous installation.
Then eveything worked as expected (at least with the examples).
Of course, this is a temporary patch that only works for me, but I have
not found what may have changed that caused this behavior.
I tested the installation in two MacOS computers and the error is the same.
Thanks for your help.
Screenshot.2025-04-04.at.10.35.13.PM.png (view on web)
<https://github.com/user-attachments/assets/a0552912-6203-4cb2-ac51-7316f8fd6b90>
Screenshot.2025-04-04.at.10.35.01.PM.png (view on web)
<https://github.com/user-attachments/assets/116c4f3f-b576-406e-b34e-3beece684f3a>
—
Reply to this email directly, view it on GitHub
<#307>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCGSSXORJKMTWP5H6M7CC32X466JAVCNFSM6AAAAAB2P7QQLOVHI2DSMVQWIX3LMV43ASLTON2WKOZSHE3TGNZXGE3DCNY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks Ryan, Fun thing: It doe not work because the instruction: I modified the file to be
Unfortunately, I got the same error when I try to import mtuq read
|
Hi Felix, Recently, the installation procedure was changed with the addition of "c-compiler" from conda itself. This seemed to help some users, but it could breaking things in your case? You might try experimenting with different compiler settings via the CC environment variable? https://mtuqorg.github.io/mtuq/install/issues.html#cython-compilation-settings |
Thanks Ryan, Could you please elaborate in how the installation prrocedure changed (where was added the c-compiler). I would like (if possible) just to modify the installation file for myself and avoid the conflicts that the new installlation approach is causing to me. I tried to check the modified files in the last commit but I did not see any change related with the installation. |
Sure, here is the change Line 21 in 70f0d55
I think it was from about two weeks ago or so. (I may be away from the computer for a while starting soon) |
Thanks Ryan, I appreciate you dedicate part of your Saturday to this. I simply used an old mtuq/env_default.yaml version where -c-compiler is not included. But did not work:
But I am not surprised. I need to become familiar in how to test different compilers settings. I do not know how to this right know, but I will check. I am also surprised that I did sync my forked version with the master a week ago, before sumitting the pull request, and I could install my mtuq forkerd version for testing the modifications. I could install without any issue. If the installation procedure changed a month ago, then this modification should have affected the installation of my forked version a week ago. But this did not happen. Thanks, Felix |
I deleted the environment and the package, then I cloned MTUQ and repeat from scratch the installation process. Before running
And the installation worked. So, in the meantime I will stick with this old file while I figure out what compiler settings use for making the installation worhk with the new env_default.yaml version. Thanks! |
Hi Felix, Glad to hear the good progress. I will try looking at this from my end as well |
Hello,
Something happened in the latest approved pull request that changed the compilation of c_ext_L2.c during the execution of
conda env update --file env.yaml
After the installation, the file c_ext_L2.cpython-312-darwin.so created in the same directory where c_ext_L2.c is located, did not work. I got this error message when I simply tried to import a mtuq library.
Fortunately, I had installed mtuq before the latest commit and I changed the c_ext_L2.cpython-312-darwin.so file that was not working for another one compiled in a different mtuq environment from a previous installation. Then eveything worked as expected (at least with the examples).
Of course, this is a temporary patch that only works for me, but I have not found what may have changed that caused this behavior.
I tested the installation in two MacOS computers and the error is the same.
Thanks for your help.
The text was updated successfully, but these errors were encountered: