2016-10-13 10 views
1

をコンパイルしながら、私は以下の手順に従ってHDF5をまとめました:HDF5エラー別のライブラリ

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

をしかし、私はHDF5を要求する別のライブラリ(OpenGM)を、インストールしている間、私は次の引数を与える:

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 

CMakeのを使用して生成した後、私が取得:ものと

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. 

は「ただ」の警告は、私は私のOpenGMをコンパイルすることができます図書館:

make 

しかし、私はこのように、次のエラーで終わる:警告やHDF5とエラーの契約の両方として

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) 

、私は主な問題は、このライブラリから来ていると仮定します。

私はMacOSXを使用しています。

** EDIT:** 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

'...私はHDF5ライブラリへのパスを提供しています...' - **ディレクトリ**を変数に割り当てたように見えますが、**ライブラリファイル**が必要です。そういうわけで、警告を出したのです。 – Tsyvarev

+0

私の編集を見て、私がCMakeの引数として与えたものを見てください。 – floflo29

+0

前に言ったことは、*ディレクトリ*を変数( 'HDF5_CORE_LIBRARY'、' HDF5_HL_LIBRARY')に割り当てます。これは**ライブラリファイル**でなければなりません。 – Tsyvarev

答えて

1

問題は、C++インタフェースを構築するための--with_cxx FAGとHDF5ライブラリをコンパイルするには解決されたファイルを追加します。また、/ usr/localにHDF5ライブラリをインストールして、opengmのインストール時に自動的に見つかるようにします。

+0

私も同様の問題があります。問題は、OpenGMを正常にコンパイルできたにもかかわらず、opengmライブラリとhdf5を呼び出す単純なC++ファイルをコンパイルできないことです。 – Ahmedov

関連する問題