2016-10-13 3 views
1

kompilieren Ich habe HDF5 zusammengestellt folgende Schritte ausführen:HDF5 Fehler während eine andere Bibliothek

untar hdf5-xxx.tar.gz 
cd hdf5-xxx 
make 
make install 

Doch während ich eine andere Bibliothek (OpenGM) installieren, die HDF5 verlangen, gebe ich die folgenden Argumente:

HDF5_CORE_LIBRARY    /Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5                
HDF5_CPP_LIBRARY     /Users/Florian/Documents/THESE/hdf5-1.8.7/c++                
HDF5_HL_LIBRARY     /Users/Florian/Documents/THESE/hdf5-1.8.7/hl                
HDF5_INCLUDE_DIR     /Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5/include              
HDF5_Z_LIBRARY     /usr/lib/libz.dylib 

Nach CMake verwenden und erzeugen, die ich erhalten:

WARNING: Target "example-io" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may link only to libraries. 
    CMake is dropping the item. 

WARNING: Target "example-io" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hl". Targets may link only to libraries. 
CMake is dropping the item. 

WARNING: Target "external-library-daoopt" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may link only 
to libraries. CMake is dropping the item. 

WARNING: Target "external-library-daoopt" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hl". Targets may link only to 
libraries. CMake is dropping the item. 

WARNING: Target "external-library-daoopt-shared" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may 
link only to libraries. CMake is dropping the item. 

WARNING: Target "external-library-daoopt-shared" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hl". Targets may link 
only to libraries. CMake is dropping the item. 

WARNING: Target "_opengmcore" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may link only to 
libraries. CMake is dropping the item. 

WARNING: Target "_opengmcore" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may link only to 
libraries. CMake is dropping the item. 

WARNING: Target "_opengmcore" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hl". Targets may link only to libraries. 
CMake is dropping the item. 

WARNING: Target "_hdf5" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may link only to libraries. 
CMake is dropping the item. 

WARNING: Target "_hdf5" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hl". Targets may link only to libraries. CMake 
is dropping the item. 

WARNING: Target "modelIO" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may link only to libraries. 
CMake is dropping the item. 

WARNING: Target "modelIO" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hl". Targets may link only to libraries. 
CMake is dropping the item. 

WARNING: Target "buildFoE" requests linking to directory "/Users/Florian/Documents/THESE/hdf5-1.8.7/hdf5". Targets may link only to libraries. 
CMake is dropping the item. 

Wie das sind „nur“ Warnungen, ich meine OpenGM kompilieren Bibliothek:

make 

Aber ich also mit dem folgenden Fehler am Ende:

Undefined symbols for architecture x86_64: 
    "_H5Aclose", referenced from: 
     void marray::hdf5::save<unsigned long>(int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, marray::Marray<unsigned long, std::__1::allocator<unsigned long> > const&) in io_graphical_model.cxx.o 
     void marray::hdf5::save<float>(int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, marray::Marray<float, std::__1::allocator<unsigned long> > const&) in io_graphical_model.cxx.o 
     void marray::hdf5::save<double>(int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, marray::Marray<double, std::__1::allocator<unsigned long> > const&) in io_graphical_model.cxx.o 
     void marray::hdf5::save<long>(int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, marray::Marray<long, std::__1::allocator<unsigned long> > const&) in io_graphical_model.cxx.o 
... 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Da beide Warnungen und Fehler Deal mit HDF5, ich nehme an, das Hauptproblem aus dieser Bibliothek kommt.

Ich benutze MacOSX, wenn es helfen kann.

** EDIT: ** In der FindHDF5.cmake

# - Find HDF5, a library for reading and writing self describing array data. 
# 
FIND_PATH(HDF5_INCLUDE_DIR hdf5.h) 

FIND_LIBRARY(HDF5_CORE_LIBRARY NAMES hdf5dll hdf5 ) 
FIND_LIBRARY(HDF5_HL_LIBRARY NAMES hdf5_hldll hdf5_hl ) 
FIND_LIBRARY(HDF5_CPP_LIBRARY NAMES hdf5_cppdll hdf5_cpp) 

IF(WIN32 AND HDF5_CORE_LIBRARY MATCHES "dll.lib$") 
    SET(HDF5_CFLAGS "-D_HDF5USEDLL_") 
    SET(HDF5_CPPFLAGS "-D_HDF5USEDLL_ -DHDF5CPP_USEDLL") 
ELSE() 
    SET(HDF5_CFLAGS) 
    SET(HDF5_CPPFLAGS) 
ENDIF() 

SET(HDF5_VERSION_MAJOR 1) 
SET(HDF5_VERSION_MINOR 8) 

set(HDF5_SUFFICIENT_VERSION FALSE) 

TRY_COMPILE(HDF5_SUFFICIENT_VERSION 
      ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}/checkHDF5version.c 
      COMPILE_DEFINITIONS "-I\"${HDF5_INCLUDE_DIR}\" -DMIN_MAJOR=${HDF5_VERSION_MAJOR} -DMIN_MINOR=${HDF5_VERSION_MINOR}") 

if(HDF5_SUFFICIENT_VERSION) 
    MESSAGE(STATUS 
      "Checking HDF5 version (at least ${HDF5_VERSION_MAJOR}.${HDF5_VERSION_MINOR}): ok") 
else() 
    MESSAGE(STATUS "HDF5: need at least version ${HDF5_VERSION_MAJOR}.${HDF5_VERSION_MINOR}") 
endif() 

set(HDF5_USES_ZLIB FALSE) 
TRY_COMPILE(HDF5_USES_ZLIB 
      ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}/checkHDF5usesCompression.c 
      COMPILE_DEFINITIONS "-I\"${HDF5_INCLUDE_DIR}\" -DH5_SOMETHING=H5_HAVE_FILTER_DEFLATE") 

if(HDF5_USES_ZLIB) 
    FIND_LIBRARY(HDF5_Z_LIBRARY NAMES zlib1 zlib z) 
    set(HDF5_ZLIB_OK ${HDF5_Z_LIBRARY}) 
else() 
    set(HDF5_ZLIB_OK TRUE) 
    set(HDF5_Z_LIBRARY "") 
endif() 

set(HDF5_USES_SZLIB FALSE) 
TRY_COMPILE(HDF5_USES_SZLIB 
      ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}/checkHDF5usesCompression.c 
      COMPILE_DEFINITIONS "-I\"${HDF5_INCLUDE_DIR}\" -DH5_SOMETHING=H5_HAVE_FILTER_SZIP") 

if(HDF5_USES_SZLIB) 
    FIND_LIBRARY(HDF5_SZ_LIBRARY NAMES szlibdll sz) 
    set(HDF5_SZLIB_OK ${HDF5_SZ_LIBRARY}) 
else() 
    set(HDF5_SZLIB_OK TRUE) 
    set(HDF5_SZ_LIBRARY "") 
endif() 

# handle the QUIETLY and REQUIRED arguments and set HDF5_FOUND to TRUE if 
# all listed variables are TRUE 
INCLUDE(FindPackageHandleStandardArgs) 

FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG HDF5_CORE_LIBRARY 
     HDF5_HL_LIBRARY HDF5_ZLIB_OK HDF5_SZLIB_OK HDF5_INCLUDE_DIR) 

IF(HDF5_FOUND) 
    SET(HDF5_LIBRARIES ${HDF5_CORE_LIBRARY} ${HDF5_HL_LIBRARY} ${HDF5_Z_LIBRARY} ${HDF5_SZ_LIBRARY}) 
ELSE() 
    SET(HDF5_CORE_LIBRARY HDF5_CORE_LIBRARY-NOTFOUND) 
    SET(HDF5_HL_LIBRARY HDF5_HL_LIBRARY-NOTFOUND) 
    SET(HDF5_Z_LIBRARY HDF5_Z_LIBRARY-NOTFOUND) 
    SET(HDF5_SZ_LIBRARY HDF5_SZ_LIBRARY-NOTFOUND) 
ENDIF(HDF5_FOUND) 
+0

'... wo ich den Pfad zur HDF5-Bibliothek stelle ...' - Sieht so aus, als würde man ** Verzeichnis ** einer Variablen zuweisen, die eine ** Bibliotheksdatei ** sein soll. Deshalb haben Sie gewarnt. – Tsyvarev

+0

Sehen Sie meine Bearbeitung, um zu sehen, was ich als CMake-Argumente angegeben habe. – floflo29

+0

Genau das, was ich vorher gesagt habe: Sie weisen * Verzeichnisse * Variablen ('HDF5_CORE_LIBRARY',' HDF5_HL_LIBRARY') zu, die eine ** Bibliotheksdatei ** sein sollten. – Tsyvarev

Antwort

1

Das Problem bei der Erstellung der HDF5 Bibliothek mit dem --with_cxx fag gelöst wurde Datei der C++ Schnittstelle zu bauen. Außerdem installiere ich die HDF5-Bibliothek in/usr/local, damit sie bei der Installation von opengm automatisch gefunden wird.

+0

Ich habe ein ähnliches Problem. Das Problem ist, obwohl ich OpenGM erfolgreich kompilieren kann, kann ich keine einfache C++ Datei kompilieren, die opengm-Bibliotheken und hdf5 aufruft. – Ahmedov

Verwandte Themen