-
Notifications
You must be signed in to change notification settings - Fork 42
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
import shenfun: Illegal instruction (core dumped) error #26
Comments
Hi Thanks for reporting the issue, but this is not reproducible for my linux laptop:
For future reference, you need to provide at least something that shows where and how things go wrong. There is nothing to go by in just a segfault. Could be anything. This error is probably not an error in shenfun. For example, can you import mpi4py, numpy? |
Yes, I could able to import these two packages, snapshot of the same is pasted below for your information. $ conda activate shenfuntest
|
I am trying to install shenfun on a fairly larger server and have installed Anaconda. The good news is that when I installed mpi4py-fft it worked beautifully. The bad news is that when I tried and set up shenfun, I get an illegal instruction error when I import shenfun. Using faulthandler, I found the following infomration that I can't really make heads or tails out of. Any idea what might be wrong?
File"/home/fpoulin/software/software/anaconda3/envs/shenfun/lib/python3.8/sitepackages/shenfun/optimization/cython/init.py", line 1 in |
No idea, except that it's cython related. Is this installed from conda-forge? Perhaps you need to compile it by hand on the server? |
Thanks for pointing that out, now it seems pretty obvious that cython was the initial source of the problem. Yes, I did use conda-forge and noticed that cython was not installed. I pip installed cython but I fear that might have used a default version of cython that is on the server. I will try again with a new install and include cython on the list. By default, the server is openmpi. Since shenfun needs mpich, I presume I should remove all openmpi libraries and load mpich, before I do the conda create? Or is conda smart enough to do all of that? |
Did you check that you used anaconda's pip? It's a common mistake to use system pip. Openmpi should not be a problem. I had some issues with them in the past, but I don't remember why. You should probably use the mpi that has been installed on the server, assuming the people that installed them used systemspecific optimizations. Conda-forge versions do not know about you system:-) |
I believe that I did use the conda version of pip but I removed all that I had before and did a new conda create now with cython, just to be sure. I also used python 3.7.6, which is what I have on my local machine, and that helped. Good news: I can import cython and the errors I had previously go away. Bad news: there is a new error, which I get when I install mpi4py_fft.
Traceback (most recent call last): |
Minor update: I can confirm that when I install mpi4py-fft with python 3.8.2 it just works. However, when I use python 3.7.6, it doesn't seem to work on the server. I have another computer that has them both installed with 3.8.2 so I will try that again, and see if I have any more success. |
Minor update: When I install shenfun using python 3.8.2 I get that mpi4py_fft works, but then I get the fatal python error: illegal instruction, when I try and run shenfun. Since this conda install worked on one of my computers I'm not sure why it doesn't work with 3.8.2 on the server. Hmmm.... |
Sorry to bother you with this again but any idea why I might get a failure of shenfun when I use this particular version of python? |
Sorry, no idea. Shenfun is tested automatically on python 3.6, 3.7 and 3.8, so it's probably not a regular python thing. |
Thaks. It turns out that when I tried the exact line on my laptop I ended up getting the same error. This leads me to believe that I should try and find out exactly what I did to create. Unfortunately, when I try and create shenfun, as I did before, it doesn't seem to work. conda create --name sf5 -c conda-forge shenfun mpich python=3.8.2 This yields similar errors as far as I can tell. $ python -q -X faulthandler
Current thread 0x00007fa629660740 (most recent call first): |
Works for me on my mac. I can try in a docker linux image later. |
I have tried this on two linux machine and am getting the same problem so if you could check, sometime, that would be greatly appreciated. If i wanted to check to see how my working version of shenfun was installed, is there an easy way to find that out? I should probably try that again as a sanity check. |
So I tried it in a docker image and I can reproduce the illegal instruction. Solution for me in the docker container, within sf5 environment:
runs without mistake. So there must be an incompatibility between the shenfun built by conda-forge some of the packages you get when installing with python=3.8.2. I don't know what it is, but the solution is to build it locally. |
Thank you! I needed to fix a typo above, comilers -> compilers and add numba to the list but I can say that shenfun now imports on the server! I'm now going to test some demos but I can say that after adding matplotlib, RayleighBenardRK3.py successfully runs. Thanks again Mikael, the help is greatly appreciated. |
@francispoulin I just found a bug that I think was causing this segfault! There's a line in setup.py that adds compiler options, like |
Bugs are rarely easy beats to tame and this one sounds especially challenging. Congratulations on finding it and I really appreciate you fixing it, and many others should too. I will update shenfun and make sure everything is good on my end. |
Dear mikaem,
I am trying to install shenfun package through anaconda 3.5.0 with python-3.6.0
but it is not working and giving core dumped on exporting it,
please help me to resolve the issue.
$ python
Python 3.6.0 | packaged by conda-forge | (default, Feb 9 2017, 14:36:55)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
The text was updated successfully, but these errors were encountered: