Ubuntu build error: (HDF5HierarchyReader.cpp:(.text+0x320): undefined reference to `H5LTget_attribute_uint'), etc.

281 views
Skip to first unread message

Sebastian Marino

unread,
Nov 27, 2013, 3:46:42 PM11/27/13
to alembic-d...@googlegroups.com

Hi all ;


Any advise on the following would be greatly appreciated.


Ubuntu: 13.04
HDF5: 1.8.9, (error also occurs with HDF5 1.8.12)

[ 24%] Building CXX object lib/Alembic/AbcCoreHDF5/CMakeFiles/AlembicAbcCoreHDF5.dir/WriteUtil.cpp.o
cd /home/sebastian/Source/Client/external_libraries/Alembic_1.5.1_2013091900/lib/Alembic/AbcCoreHDF5 && /usr/bin/c++   -DNDEBUG=1 -DPLATFORM=LINUX -DPLATFORM_LINUX -O3 -DNDEBUG -I/usr/include/OpenEXR -I/usr/local/include -I/home/sebastian/Source/Client/external_libraries/Alembic_1.5.1_2013091900/lib    -UDEBUG -O3 -fPIC -o CMakeFiles/AlembicAbcCoreHDF5.dir/WriteUtil.cpp.o -c /home/sebastian/Source/Client/external_libraries/Alembic_1.5.1_2013091900/lib/Alembic/AbcCoreHDF5/WriteUtil.cpp
Linking CXX static library libAlembicAbcCoreHDF5.a

...

Linking CXX executable AbcCoreAbstractCompoundPropsTest1
cd /home/sebastian/Source/Client/external_libraries/Alembic_1.5.1_2013091900/lib/Alembic/AbcCoreAbstract/Tests && /usr/bin/cmake -E cmake_link_script CMakeFiles/AbcCoreAbstractCompoundPropsTest1.dir/link.txt --verbose=1
/usr/bin/c++   -O3 -DNDEBUG    CMakeFiles/AbcCoreAbstractCompoundPropsTest1.dir/CompoundPropertyTest1.cpp.o  -o AbcCoreAbstractCompoundPropsTest1 -rdynamic ../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a ../libAlembicAbcCoreAbstract.a ../../Util/libAlembicUtil.a -Wl,-Bstatic -lImath -lIlmThread -lIex -lHalf -Wl,-Bdynamic /usr/local/lib/libhdf5.a -lpthread -Wl,-Bstatic -lboost_thread-mt -lz -Wl,-Bdynamic -lm 
../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a(HDF5HierarchyReader.cpp.o): In function `Alembic::AbcCoreHDF5::v6::HDF5HierarchyReader::readHierarchy(int)':
HDF5HierarchyReader.cpp:(.text+0x320): undefined reference to `H5LTget_attribute_uint'
HDF5HierarchyReader.cpp:(.text+0x572): undefined reference to `H5LTget_attribute_uint'
HDF5HierarchyReader.cpp:(.text+0x792): undefined reference to `H5LTget_attribute_char'
HDF5HierarchyReader.cpp:(.text+0x990): undefined reference to `H5LTget_attribute_uint'
HDF5HierarchyReader.cpp:(.text+0x9eb): undefined reference to `H5LTget_attribute_char'
../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a(HDF5HierarchyReader.cpp.o): In function `Alembic::AbcCoreHDF5::v6::HDF5HierarchyReader::HDF5HierarchyReader(int, Alembic::AbcCoreHDF5::v6::HDF5Hierarchy&, bool)':
HDF5HierarchyReader.cpp:(.text+0x164e): undefined reference to `H5LTget_attribute_int'
../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a(HDF5HierarchyWriter.cpp.o): In function `Alembic::AbcCoreHDF5::v6::HDF5HierarchyWriter::writeHierarchy(int)':
HDF5HierarchyWriter.cpp:(.text+0x26b): undefined reference to `H5LTset_attribute_uint'
HDF5HierarchyWriter.cpp:(.text+0x339): undefined reference to `H5LTset_attribute_uint'
HDF5HierarchyWriter.cpp:(.text+0x3b2): undefined reference to `H5LTset_attribute_char'
HDF5HierarchyWriter.cpp:(.text+0x3de): undefined reference to `H5LTset_attribute_uint'
HDF5HierarchyWriter.cpp:(.text+0x406): undefined reference to `H5LTset_attribute_char'
../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a(HDF5HierarchyWriter.cpp.o): In function `Alembic::AbcCoreHDF5::v6::HDF5HierarchyWriter::HDF5HierarchyWriter(int, Alembic::AbcCoreHDF5::v6::HDF5Hierarchy&)':
HDF5HierarchyWriter.cpp:(.text+0x81c): undefined reference to `H5LTset_attribute_int'
../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a(ArImpl.cpp.o): In function `Alembic::AbcCoreHDF5::v6::ArImpl::ArImpl(std::string const&, std::tr1::shared_ptr<Alembic::AbcCoreAbstract::v6::ReadArraySampleCache>, bool)':
ArImpl.cpp:(.text+0xb18): undefined reference to `H5LTget_attribute_int'
ArImpl.cpp:(.text+0x103e): undefined reference to `H5LTget_attribute_int'
../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a(AwImpl.cpp.o): In function `Alembic::AbcCoreHDF5::v6::AwImpl::AwImpl(std::string const&, Alembic::AbcCoreAbstract::v6::MetaData const&, bool)':
AwImpl.cpp:(.text+0x1ed0): undefined reference to `H5LTset_attribute_int'
AwImpl.cpp:(.text+0x1f01): undefined reference to `H5LTset_attribute_int'
../../AbcCoreHDF5/libAlembicAbcCoreHDF5.a(WriteUtil.cpp.o): In function `Alembic::AbcCoreHDF5::v6::WriteTimeSampling(int, std::string const&, Alembic::AbcCoreAbstract::v6::TimeSampling const&)':
WriteUtil.cpp:(.text+0x77e): undefined reference to `H5LTset_attribute_double'
collect2: error: ld returned 1 exit status
make[2]: *** [lib/Alembic/AbcCoreAbstract/Tests/AbcCoreAbstractCompoundPropsTest1] Error 1
make[2]: Leaving directory `/home/sebastian/Source/Client/external_libraries/Alembic_1.5.1_2013091900'
make[1]: *** [lib/Alembic/AbcCoreAbstract/Tests/CMakeFiles/AbcCoreAbstractCompoundPropsTest1.dir/all] Error 2
make[1]: Leaving directory `/home/sebastian/Source/Client/external_libraries/Alembic_1.5.1_2013091900'
make: *** [all] Error 2


Thanks very much,

-Seb.

Lucas Miller

unread,
Nov 27, 2013, 3:53:31 PM11/27/13
to alembic-d...@googlegroups.com
H5LTget_attribute_uint and friend belong to:

I believe you need to link in libhdf5_hl.a, which I did not see in your link line.

Lucas


--
You received this message because you are subscribed to the Google Groups "alembic-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sebastian Marino

unread,
Nov 27, 2013, 5:41:31 PM11/27/13
to alembic-d...@googlegroups.com

Hi Lucas,


Thanks!  That sounds about right.  However, I'm just building the unmodified Albembic distro.  Is there perhaps a configuration setting I've missed during bootstrap or while calling CMake?  I'm happy to dive in and add libhdf5_hl.a to the build for that test, but is that the correct fix?


Thanks again!  Best,

-Seb.
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discussion+unsub...@googlegroups.com.

Lucas Miller

unread,
Nov 27, 2013, 5:52:18 PM11/27/13
to alembic-d...@googlegroups.com
Is libhdf5_hl.a installed in the same directory  as libhdf5.a?

The bootstrap only asks for libhdf5.a so it most likely assumes they are in the same directory together.

Lucas


To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.

Sebastian Marino

unread,
Nov 27, 2013, 8:56:39 PM11/27/13
to alembic-d...@googlegroups.com

It is, here's a list of the HDF5 libs from my /usr/local/lib:

sebastian@ubuntu:/usr/local/lib$ ls -d1 libhdf5*
libhdf5.a
libhdf5_hl.a
libhdf5_hl.so
libhdf5_hl.so.7
libhdf5_hl.so.7.0.3
libhdf5_hl.so.8
libhdf5_hl.so.8.0.1
libhdf5.settings
libhdf5.so
libhdf5.so.7
libhdf5.so.7.0.3
libhdf5.so.8
libhdf5.so.8.0.1


Thanks!

-Seb.

Sebastian Marino

unread,
Dec 2, 2013, 5:37:03 PM12/2/13
to alembic-d...@googlegroups.com

Hi all,


Wondering if the consensus is that I'll need to modify the CMake files to successfully compile the distribution?


Thanks very much,

-Seb.

Bo Zhou

unread,
Dec 3, 2013, 12:00:07 AM12/3/13
to alembic-d...@googlegroups.com
I used to modify the CMake generated Makefile directly to solve this problem.

BTW, an suggestion, people should always use the static Ilmbase HDF5 Boost for Alembic (also static) to prevent the "undefined symbol" linking problem, not mix with the dynamic libraries, for distribution, people don't have to ship the all the other .so files.

Sebastian Marino

unread,
Dec 8, 2013, 11:18:48 PM12/8/13
to alembic-d...@googlegroups.com

Thanks very much, everyone.  It was good to hear that there are frequent modifications needed to build the library.


Here's my solution:


Changed build/AlsmbicHDF5.cmake from:

90   #SET( ALEMBIC_HDF5_LIBS ${HDF5_LIBRARIES} )

to 

90   SET( ALEMBIC_HDF5_LIBS ${HDF5_hdf5_hl_LIBRARY} ${HDF5_hdf5_LIBRARY} )

Noting that the order of the above is important: hdf5_hl must precede hdf5.


The following build issues have been addressed in other threads, but I'll reiterate here for completeness:


- Added 'glut' explicitly to top-level CMakeLists.txt:

208   SET( ALEMBIC_GL_LIBS GLEW glut ${GLUT_LIBRARY} ${OPENGL_LIBRARIES} )

Not sure why ${GLUT_LIBRARY} wasn't working, but didn't have time to track it down.  Quick & dirty fix.


And finally the following mod to examples/bin/AbcTree/AbcTree.cpp:

315         int ii = 0;
316         while ( std::getline( ss, segment, '/' ) ) {
317             if ( !isFile ( fp.str() ) ) {
318                 if ( ii != 0 )
319                     fp << "/";
320                 fp << segment;
321             } else {
322                 seglist.push_back( segment );
323             }
324             ++ii;
325         }


Best,

-Seb.
Reply all
Reply to author
Forward
0 new messages