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

Failed mumps.mumps_context import #1

Open
lambe opened this issue Oct 13, 2016 · 10 comments
Open

Failed mumps.mumps_context import #1

lambe opened this issue Oct 13, 2016 · 10 comments

Comments

@lambe
Copy link

lambe commented Oct 13, 2016

I'm compiling and installing MUMPS.py under Ubuntu 16.04 and the Anaconda Python distribution. The code builds and installs without issue, and "import mumps" succeeds in the python shell, but both unit tests fail with the following error:

mumps/mumps_context.py:6: in
from mumps.src.numpy_mumps_INT32_COMPLEX64 import NumpyMUMPSSolver_INT32_COMPLEX64
E ImportError: No module named numpy_mumps_INT32_COMPLEX64

The numpy_mumps_INT32_COMPLEX64.so library is available in the installed python egg, but the import still fails. I suspect it's something in the build process, but it's hard to pinpoint at the moment. Any suggestions would be helpful.

@dpo
Copy link

dpo commented Oct 13, 2016

Does ldd numpy_mumps_INT32_COMPLEX64.so point to anything suspicious?

@lambe
Copy link
Author

lambe commented Oct 13, 2016

Here's the output:
linux-vdso.so.1 => (0x00007ffe809e2000)
libpython2.7.so.1.0 => /home/andrew/anaconda3/envs/nlpy-dev/lib/libpython2.7.so.1.0 (0x00007fcc36d11000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcc36ac8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcc366ff000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcc364fb000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fcc362f7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcc35fee000)
/lib64/ld-linux-x86-64.so.2 (0x00005606ad79c000)

Only the first link looks a little out of place.

@syarra
Copy link
Collaborator

syarra commented Oct 13, 2016

I have tested installing MUMPS.py in Ubuntu 16.04 and was able to reproduce your issue.

This is a path problem. If you move away from MUMPS.py source directory and try:

python -c "from mumps.mumps_context import MUMPSContext"

then it is working.

I need to find a way of make the tests pass. Maybe I'll switch to pytest instead of nose.

@syarra
Copy link
Collaborator

syarra commented Oct 13, 2016

MUMPS.py now uses pytest (see PR #2)

@lambe
Copy link
Author

lambe commented Oct 13, 2016

I can confirm your fix. If I run the tests away from the source directory, e.g.,
python -m pytest MUMPS.py/tests
I get the following result
============== test session starts ===========================
platform linux2 -- Python 2.7.12, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/andrew/git-code/MUMPS.py, inifile:
collected 56 items

MUMPS.py/tests/test_mumps_with_cysparse.py ssssssssssssssssssssssssssss
MUMPS.py/tests/test_mumps_with_numpy.py

I think there's still some work to do in setting up the tests correctly for pytest.

@syarra
Copy link
Collaborator

syarra commented Oct 13, 2016

What do you mean?
They are running correctly for me now, even in the source directory.
Here is the output of py.test

======================================= test session starts =======================================
platform linux2 -- Python 2.7.12, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /media/syarra/DATAPART1/work/.virtualenvs/NLP.py/programs/MUMPS.py, inifile: 
collected 56 items 

tests/test_mumps_with_cysparse.py ............................
tests/test_mumps_with_numpy.py ............................

==================================== 56 passed in 0.81 seconds ====================================

Isn't it for you?

@lambe
Copy link
Author

lambe commented Oct 13, 2016

It might be a bad build or merge on my end. Let me get back to you...

@lambe
Copy link
Author

lambe commented Oct 13, 2016

Should I be testing on the master branch or the develop branch? The mumps_context.py file seems to have gone missing in the master branch.

EDIT: I just did a clean clone and build of the master branch and the error I get now is "No module named mumps_context", which is why I'm asking.

@syarra
Copy link
Collaborator

syarra commented Oct 13, 2016

Ok try is now on master I have just updated it.

@lambe
Copy link
Author

lambe commented Oct 13, 2016

I get the same issue as the original message. (I even upgraded to pytest 3.0.3 so our module versions are identical.) I'm also running it in a virtual environment so I don't know what's going on.

UPDATE: I can import the module if I go to the folder where it is stored, but as soon as I leave that folder, the import fails. Maybe it's the order in which the paths are being checked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants