[MMTK] Fwd: Problem not finding Scientific/netcdfmodule.h and module MMTK_state_accessor

Ramon Crehuet rcrehuet at gmail.com
Tue Jan 14 08:58:10 UTC 2014


2014/1/14 Konrad Hinsen <research at khinsen.fastmail.net>

> Dear Ramon.
>
>  > I first installed Scientific Python 2.9.2. During the installation it
> apparently found
>  > netcdf in /usr (the header files are in /usr/include/netcdf.h). How can
> I make sure from
>  > python that worked?
>
> If
>
>   import Scientific.IO.NetCDF
>
> works silently (no error message), it should be fine.


It does work. Good.


> > However, when I import MMTK I get an error. I'm not sure whether it is
> related to the
>  > netcdf issue (it doesn't seem to be, but...)
>  >
>  > >>> import MMTK
>  > Traceback (most recent call last):
>  >   File "<stdin>", line 1, in <module>
>  >   File "MMTK/__init__.py", line 47, in <module>
>  >     from ThreadManager import activeThreads, waitForThreads
>  >   File "MMTK/ThreadManager.py", line 38, in <module>
>  >     import MMTK_state_accessor
>  > ImportError: No module named MMTK_state_accessor
>
> That's indeed unrelated, and I haven't seen it before. Did you get any
> error message during compilation that mentions MMTK_state_accessor?
>

The end of the build report the lines I attach at the end of the message.
But there is no error...
The module  after the install is here:

/usr/local/lib/python2.7/dist-packages/MMTK/linux2/MMTK_state_accessor.so

But this directory is not in the sys.path, which is:
['',
 '/usr/bin',
 '/usr/local/lib/python2.7/dist-packages/pymbar-2.0.1_beta-py2.7-linux-x86_64.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
 '/usr/lib/python2.7/dist-packages/IPython/extensions']

If I add that directory to sys.path, things work...

>>> import sys
>>> sys.path.append('/usr/local/lib/python2.7/dist-packages/MMTK/linux2')
>>> import MMTK
>>>

Cheers,
Ramon

PS: Last lines of the build:

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g
-fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g
-fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security
build/temp.linux-x86_64-2.7/Src/MMTK_trajectory_generator.o -lm -o
build/lib.linux-x86_64-2.7/MMTK/linux2/MMTK_trajectory_generator.so
building 'MMTK_state_accessor' extension
C compiler: x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g
-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC

compile options: '-DLIBM_HAS_ERFC -D_LONG64_ -DEXTENDED_TYPES -IInclude
-I/usr/local/include/python2.7
-I/usr/lib/python2.7/dist-packages/numpy/core/include
-I/usr/include/python2.7 -c'
extra options: '-DUSE_NETCDF_H_FROM_SCIENTIFIC=1 -DNUMPY=1'
x86_64-linux-gnu-gcc: Src/MMTK_state_accessor.c
In file included from
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1728:0,
                 from
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:15,
                 from
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/oldnumeric.h:1,
                 from Include/MMTK/arrayobject.h:2,
                 from Src/MMTK_state_accessor.c:235:
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
  ^
In file included from Include/MMTK/trajectory.h:12:0,
                 from Src/MMTK_state_accessor.c:238:
/usr/local/include/python2.7/Scientific/netcdfmodule.h:262:15: warning:
‘PyNetCDF_API’ defined but not used [-Wunused-variable]
 static void **PyNetCDF_API;
               ^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g
-fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g
-fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security
build/temp.linux-x86_64-2.7/Src/MMTK_state_accessor.o -lm -o
build/lib.linux-x86_64-2.7/MMTK/linux2/MMTK_state_accessor.so
running build_scripts
creating build/scripts-2.7
copying and adjusting tviewer -> build/scripts-2.7
changing mode of build/scripts-2.7/tviewer from 644 to 755






>
> Konrad.
> --
> ---------------------------------------------------------------------
> Konrad Hinsen
> Centre de Biophysique Moléculaire, CNRS Orléans
> Synchrotron Soleil - Division Expériences
> Saint Aubin - BP 48
> 91192 Gif sur Yvette Cedex, France
> Tel. +33-1 69 35 97 15
> E-Mail: research AT khinsen DOT fastmail DOT net
> http://dirac.cnrs-orleans.fr/~hinsen/
> ORCID: http://orcid.org/0000-0003-0330-9428
> Twitter: @khinsen
> ---------------------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://starship.python.net/pipermail/mmtk/attachments/20140114/457af956/attachment-0001.html>


More information about the mmtk mailing list