gevero / py_gmm

A Generalized Multiparticle Mie code, especially suited for plasmonics
GNU General Public License v3.0
22 stars 12 forks source link

Cannot find gmm_py module #2

Closed jellium closed 8 years ago

jellium commented 8 years ago

After successful installation of the package on both Python 2.7 and 3.4, I cannot run properly the example notebook, obtaining the following error while running the first notebook cell (untitled Importing the libraries):

With Python 2.7:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-9149fe29fc2e> in <module>()
     14 # Generalized Multiparticle Mie import
     15 sys.path.append('../')
---> 16 import py_gmm
     17 
     18 # parallel computation

/usr/local/lib/python2.7/dist-packages/py_gmm-0.1-py2.7.egg/py_gmm/__init__.py in <module>()
     12 """
     13 
---> 14 import py_gmm.gmm_py as gmm_py
     15 import py_gmm.mat as mat

ImportError: No module named gmm_py

With Python 3.4 (identical):

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-de54cc5c355c> in <module>()
     14 # Generalized Multiparticle Mie import
     15 sys.path.append('../')
---> 16 import py_gmm
     17 
     18 # parallel computation

/usr/local/lib/python3.4/dist-packages/py_gmm-0.01-py3.4.egg/py_gmm/__init__.py in <module>()
     12 """
     13 
---> 14 import py_gmm.gmm_py as gmm_py
     15 import py_gmm.mat as mat

ImportError: No module named 'py_gmm.gmm_py'

Regards,

gevero commented 8 years ago

Hi Jellium

In order to (hopefully) help you out I need to know the following things:

Hopefully one of the above suggestions should solve your problem

Best

Giovanni

gevero commented 8 years ago

Did any of my suggestions work?

jellium commented 8 years ago

Hi gevero, Thanks for the detailed reply.

I tried to reinstall the package by first compiling from the repo with sh f2py.sh. Here is the end of the output where there seem to be an error related to the gmm_py.cpython-34.so file:

...
gfortran:f90: kinds.f90
gfortran:f90: datatypes.f90
gfortran:f90: operators.f90
gfortran:f90: shared_data.f90
gfortran:f90: basicsubs.f90
gfortran:f90: gmmsubs.f90
gfortran:f90: sing_part.f90
gfortran:f90: vec_trans.f90
gfortran:f90: local_field.f90
gfortran:f90: linear_solver.f90
gfortran:f90: gmm_f2py_module.f90
compiling Fortran sources
Fortran f77 compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O2 -march=x86-64 -DMS_WIN64 -mtune=generic -msse2
Fortran f90 compiler: /usr/bin/gfortran -O3 -fpic -m64 -fPIC -O2 -march=x86-64 -DMS_WIN64 -mtune=generic -msse2
Fortran fix compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -O3 -fpic -m64 -fPIC -O2 -march=x86-64 -DMS_WIN64 -mtune=generic -msse2
compile options: '-I./tmp/src.linux-x86_64-3.4 -I/usr/local/lib/python3.4/dist-packages/numpy/core/include -I/usr/include/python3.4m -c'
extra options: '-J./tmp/ -I./tmp/'
gfortran:f90: tmp/src.linux-x86_64-3.4/gmm_py-f2pywrappers2.f90
/usr/bin/gfortran -Wall -g -Wall -g -shared -Wl,-gc-sections -Wl,-s ./tmp/tmp/src.linux-x86_64-3.4/gmm_pymodule.o ./tmp/tmp/src.linux-x86_64-3.4/fortranobject.o ./tmp/kinds.o ./tmp/datatypes.o ./tmp/operators.o ./tmp/shared_data.o ./tmp/basicsubs.o ./tmp/gmmsubs.o ./tmp/sing_part.o ./tmp/vec_trans.o ./tmp/local_field.o ./tmp/linear_solver.o ./tmp/gmm_f2py_module.o ./tmp/tmp/src.linux-x86_64-3.4/gmm_py-f2pywrappers2.o -lopenblas -lgfortran -o ./gmm_py.cpython-34m.so
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
error: Command "/usr/bin/gfortran -Wall -g -Wall -g -shared -Wl,-gc-sections -Wl,-s ./tmp/tmp/src.linux-x86_64-3.4/gmm_pymodule.o ./tmp/tmp/src.linux-x86_64-3.4/fortranobject.o ./tmp/kinds.o ./tmp/datatypes.o ./tmp/operators.o ./tmp/shared_data.o ./tmp/basicsubs.o ./tmp/gmmsubs.o ./tmp/sing_part.o ./tmp/vec_trans.o ./tmp/local_field.o ./tmp/linear_solver.o ./tmp/gmm_f2py_module.o ./tmp/tmp/src.linux-x86_64-3.4/gmm_py-f2pywrappers2.o -lopenblas -lgfortran -o ./gmm_py.cpython-34m.so" failed with exit status 1

Also I can't find this library anywhere after compiling (which ends with this error) and installing via setup.py.

gevero commented 8 years ago

Hi jellium

the error is the following

collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lopenblas

This means that the compiler cannot find the openblas library. You are unable to find the gmm_py.cpython-34.so file because the compilation failed, therefore the gmm_py.cpython-34.so file was not created. A conda install openblas command should be able to solve this problem.

Best

Giovanni

gevero commented 8 years ago

Hi @jellium In a couple of days I am going to close the issue if it's ok.

jellium commented 8 years ago

Hi Giovanni, Thanks for your answers, sorry I didn't answer back to you. I installed Openlabs and things worked as expected!

Regards

PS : message envoyé depuis mon smartphone Le 17 janv. 2016 20:53, "Giovanni Pellegrini" notifications@github.com a écrit :

Hi @jellium https://github.com/jellium In a couple of days I am going to close the issue if it's ok.

— Reply to this email directly or view it on GitHub https://github.com/gevero/py_gmm/issues/2#issuecomment-172371577.