Hi all,

I realize it's been almost six months since I started this thread, but I
just wanted to let people know that I figured out what my issue was last
night, in case someone else was having similar problems. I seldom need to
run my codes on my personal computer, so it wasn't an urgent issue for me to
resolve until now -- I have to show some demos in a presentation from my
laptop tomorrow. I am now using PyTables 2.1 and HDF5 1.8.2, although the
problem was version-independent. The problem I was having:

> >> ImportError: dlopen(tables/utilsExtension.so, 2): Symbol not found:
_compress2

was due to the fact that enabling Fortran support when compiling HDF5
disables the shared library, and it is needed by PyTables. Since I use
Python, C++ and Fortran codes, and they all need HDF5, I kept compiling HDF5
with Fortran support until I noticed that the shared library wasn't there
(even when I tried the --enable-shared flag) and that PyTables couldn't find
it -- there was even a warning issued by the setup.py script which I had
ignored.

So now I can use PyTables after re-installing HDF5 without Fortran support.
Since I don't use my Fortran code on my laptop, I can live with that, but I
e-mailed HDF5 support to see if there is a solution (a more elegant one than
simply having two different locations with HDF5, with and without Fortran),
and I am including my correspondence with them below. Best,

Milos



>Hello Milos,
>
>Unfortunately, right now we do not support shared Fortran libraries
>on the Mac Intel, for any of the platforms we test (ifort, gfortran, g95).
 We are not yet sure if the problem is >specific to the Macintosh
>or the HDF5 library, although it works fine on other platforms.  We do
>plan to investigate it.  It may be possible to modify the Makefiles
manually to use the shared C libraries with the >static Fortran library, but
I don't have details on doing this.

>-Barbara


>+--+--+--+--+--+--+--+--+--+-->+--+--+--+--+--+--+--+--+--+--+--+--+
>Barbara Jones
>THG Helpdesk
>
>The HDF Group (THG)
>h...@hdfgroup.org <h...@hdfgroup.org>
>+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+>- Hide
quoted text -


 I have been trying to install PyTables, a Python module which provides
> access to HDF5. I kept running into trouble with loading that module in
> Python and traced it back to the following issue: I was compiling with
> support for both C++ and Fortran, and it turns out that the configure
> script
> for HDF5 (version 1.8.2) disables the shared library, which is needed by
> PyTables. I tried adding the --enable-shared flag as well:
>
> ./configure --enable-cxx --enable-fortran --enable-shared
> --with-szlib=/usr/local
>
> The configure script still disabled the shared library -- part of the
> output
> is below:
>
> compiler 'gcc' is GNU gcc-4.0.1
>   warning: shared libraries are not supported with Fortran
>   disabling shared libraries
>
> After that, I configured, compiled and installed installed HDF5 only with
> support for C++ and the shared library was now included. I was then
> successful in loading PyTables. PyTables actually needs neither C++ nor
> Fortran to be enabled, but in addition to my Python codes, I also use HDF5
> with some C++ and Fortran codes.
>
> In summary, my question is: is it possible to build HDF5 with both Fortran
> and C++ support and have the shared library too? Ideally I would like to
> have the shared library available, as well as Fortran and C++ support. I am
> assuming that a simple workaround would be to install HDF5 with C++ support
> and shared library included in one directory, and HDF5 with Fortran support
> in another directory and link to the appropriate one for C++ or Fortran
> codes. My system is a Macbook with Mac OS X 10.5.
>
> Thank you,
>
> Milos Ilak
>
>



On Fri, Aug 15, 2008 at 9:37 AM, Chris Kees <
christopher.e.k...@usace.army.mil> wrote:

> Hi,
>
> I just joined the list and have only had time to skim this thread. I build
> pytables and HDF5 yesterdy and  Mac  OSX 10.5 and saw your problem with
> _compress at first. Here is what I used to configure the working version
>
> zlib: ./configure --shared --prefix=/usr/local; make; sudo make install
> szlib:  ./configure --shared --prefix=/usr/local; make; sudo make install
> hdf5: ./configure --prefix=/usr/local --with-zlib --with-szlib
> --enable-shared; make; sudo make install
>
> Also, I used:
> gcc version 4.0.1 (Apple Inc. build 5484)
> Python 2.6b2+ (trunk:65680, Aug 14 2008, 13:52:40)
>
> I do think the problem is with your hdf5/zlib installation and not
> pytables.
>
> Chris
> On 8/15/08 3:23 AM, "Francesc Alted" <fal...@pytables.com> wrote:
>
> > Hi Milos,
>
> Please, let's keep using the mailing list for this discussion.
>
> A
> > Friday 15 August 2008, escriguéreu:
> > Hi Jan,
> >
> > thanks for your reply once
> > again. I got it to work by going back to
> > HDF5 version 1.6.7 and pytables
> > 2.0.2. Some of the tests for pytables
> > are failing now, but everything seems
> > to be working fine. I am on
> > vacation and can't send the output with the test
> > failures, but I
> > saved it and will send them soon (it is on another
> > computer). Thanks
> > again,
> >
> > Milos
> >
> > P.S. Here is what I did figure out
> > about the problem I was having, I
> > think it has to do with zlib, because
> > compress2 is a function in the
> > zlib compression library, at least that's
> > what I found online, so
> > there may have been an issue with how pytables 2.0.4
> > or HDF5 1.8.1
> > was interacting with my version of zlib, but this is just
> >
> > speculation.
>
> Hmm, PyTables does not directly interact with zlib and its use
> > is
> completely deferred to the HDF5 library.  So my guess is that it should
> >
> be a problem with HDF5.  Try to run the tests that come with the HDF5
> >
> library to see if the problem is on that side.  If those tests run
> fine,
> > please provide us the information about your compiler and a
> detailed
> > description of your compilation process as well (for both
> PyTables and
> > HDF5).
>
> Francesc
>
> >
> > On Thu, Aug 14, 2008 at 10:01 PM, Jan Strube
> > <curious...@gmail.com>
> wrote:
> > > Hi Milos,
> > > hmm. I'm sorry, but I must
> > admit I am at the end of my knowledge
> > > here. I hope somebody else is able
> > to help you further.
> > > Good luck,
> > >     Jan
> > >
> > > On Aug 08, 2008, at
> > 21:24 PM, Milos Ilak wrote:
> > >
> > > On Fri, Aug 8, 2008 at 3:15 PM, Jan Strube
> > <curious...@gmail.com>
> wrote:
> > >> **
> > >>
> > >> Hi Milos
> > >>
> > >>
> > >>
> > Traceback (most recent call last):
> > >>   File "<stdin>", line 1, in
> > <module>
> > >>   File "tables/__init__.py", line 56, in <module>
> > >>     from
> > tables.utilsExtension import getPyTablesVersion,
> > >> getHDF5Version
> > ImportError: dlopen(tables/utilsExtension.so, 2):
> > >> Symbol not found:
> > _compress2
> > >>   Referenced from:
> > >>
> > /Users/milos/Work/python/pytables-2.0.4/tables/utilsExtension.so
> > >>
> > Expected in: dynamic lookup
> > >>
> > >> I am not sure what this means, but I am
> > guessing that it doesn't
> > >> have to do with the libraries. Do you have an
> > idea what may be
> > >> going on? Thanks,
> > >>
> > >> could you try an
> > >> otool
> > -L
> > >> /Users/milos/Work/python/pytables-2.0.4/tables/utilsExtension.so
> > >>
> > and see if all libraries referenced there are found? If not, your
> > >>
> > LD_LIBRARY_PATH or $DYLD_LIBRARY_PATH needs some adjustments. (But
> > >> I
> > don't think that's the problem...)
> > >
> > > Sure, here's the output:
> > >
> > >
> > dynamic-oit-vapornet-c-682:~ milos$ otool -L
> > >
> > /Users/milos/Work/python/pytables-2.0.4/tables/utilsExtension.so
> > >
> > /Users/milos/Work/python/pytables-2.0.4/tables/utilsExtension.so:
> > >
> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
> > > current version
> > 88.3.6)
> > >
> > >> ImportError: dlopen(tables/utilsExtension.so, 2): Symbol
> > not
> > >> found: _compress2
> > >>
> > >> I can't really help here, but you get the
> > symbols in a shared
> > >> library with nm
> > >> (man nm)
> > >>
> > >> I have tried
> > a few things to find where that symbol could be
> > >> referenced or defined,
> > unfortunately without success. But I run
> > >> the same version on Mac OS X
> > 10.4.11 and it's just fine here.
> > >
> > > I find the following:
> > >
> > >
> > dynamic-oit-vapornet-c-682:~ milos$ nm
> > >
> > /Users/milos/Work/python/pytables-2.0.4/tables/utilsExtension.so |
> > > grep -n
> > _compress2
> > > 5593:         U _compress2
> > >
> > > It is also there in the
> > other .so files:
> > >
> > > dynamic-oit-vapornet-c-682:~ milos$ nm
> > >
> > /Users/milos/Work/python/pytables-2.0.4/tables/hdf5Extension.so |
> > > grep -n
> > _compress2
> > > 5710:         U _compress2
> > > dynamic-oit-vapornet-c-682:~
> > milos$ nm
> > > /Users/milos/Work/python/pytables-2.0.4/tables/tableExtension.so
> > |
> > > grep -n _compress2
> > > 5635:         U _compress2
> > >
> > > But I am not
> > sure what this is telling me. I have tried the whole
> > > process again with a
> > newly re-compiled HDF5 library (I needed that
> > > to make a fortran code work
> > with the compiler I have) and I get the
> > > same error. Thanks,
> > >
> > >
> > Milos
> > >
> > >> > I am sending this just to you first, since it is an
> > installation
> > >> >
> > >>> > issue, so I don't want to bother the whole user
> > group.
> > >>
> > >> Please don't! Always bother the group with everything, unless
> > you
> > >> are already iterating specific problems with somebody. The chances
> >
> > >> of somebody having a similar problem before or after you are
> > >>
> > infinitely higher if you post to the list. Unfortunately I am not
> > >> being a
> > great help here, but please don't let that discourage you.
> > >>
> > >> Good
> > luck,
> > >>     Jan
> > >>
> > >>
> > >>
> > >>
> > ------------------------------------------------------------------
> > >>-------
> > This SF.Net email is sponsored by the Moblin Your Move
> > >> Developer's
> > challenge
> > >> Build the coolest Linux based applications with Moblin SDK &
> > win
> > >> great prizes
> > >> Grand prize is a trip for two to an Open Source
> > event anywhere in
> > >> the world
> > >>
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > >>
> > _______________________________________________
> > >> Pytables-users mailing
> > list
> > >> Pytables-users@lists.sourceforge.net
> > >>
> > https://lists.sourceforge.net/lists/listinfo/pytables-users
>
>
>
> --
> Francesc
> > Alted
> Freelance developer
> Tel
> > +34-964-282-249
>
> -------------------------------------------------------------
> > ------------
> This SF.Net email is sponsored by the Moblin Your Move
> > Developer's challenge
> Build the coolest Linux based applications with Moblin
> > SDK & win great prizes
> Grand prize is a trip for two to an Open Source event
> > anywhere in the
> > world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _____________
> > __________________________________
> Pytables-users mailing
> > list
> Pytables-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/
> > listinfo/pytables-users
>
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to