C++ building error for a simple code using armadillo and hdf5 libraries -
I am quite new to C ++ and Armandillo, and I get stuck with a building error described below. I am trying to check the following simple code to save an Armadillo matrix in the form of a HDF 5 file:
#include & lt; Iostream & gt; #include & lt; Armandillo & gt; using namespace std; Using Namespace ARMA; Int main () {mat A = Random & lt; Mat (240,320); A.save ("A.hdf5", hdf5_binary); Return 0; } When compiling, I get the following errors:
/usr/include/armadillo_bits/hdf5_misc.hpp:131:  «undefined reference arma_H5T_NATIVE_DOUBLE » /usr/include/armadillo_bits/hdf5_misc.hpp:131:  «arma_H5Tcopy a undefined terms» obj / debug / main.o: «function bool Arma :: diskio :: save_hdf5_binary & LT; Double & gt; (Arma :: Mat & LT; double & gt; constant & amp;, std :: string const & amp;)  »: /usr/include/armadillo_bits/diskio_meat.hpp:1299: undefined reference« arma_H5Eset_auto  In »/ usr / include / armadillo_bits / diskio_meat .hpp: 1308: «undefined terms in a Arma :: H5check_version (unsigned int, unsigned int, unsigned int) » /usr/include/armadillo_bits/diskio_meat.hpp:1308:  «arma_H5Fcreate  »/ undefined reference usr / / Armadillo_bits / diskio_meat.hpp: 1315: a« unreserved terms arma_H5Screate_simple a »/usr/include/armadillo_bits/diskio_meat.hpp:1324: unnatural context« arma_H5Dcreate a »in / u sr / include / armadillo_bits / diskio_meat.hpp: 1330:  «arma_H5Dwrite » undefined in /usr/include/armadillo_bits/diskio_meat.hpp:1333 reference:  «arma_H5Dclose » /usr/include/armadillo_bits/diskio_meat.hpp:1334 undefined reference:  «undefined reference arma_H5Tclose« an undefined reference to a Aarm_aac 5 Scolej auser_include / armadillo_bits / diskio_meat.hpp1335 "» /usr/include/armadillo_bits/diskio_meat.hpp:1336: :  «arma_H5Fclose » compiling reference undefined instruction is followed g ++ -Wall -fexceptions -O2 G -larmadillo -lhdf5 -c main.cpp -o main
I have a linux with codeblocks on Fedora 20 system I am working. I packed HDF5-is devel and #define ARMA_USE_HDF5 in using the Armadillo / usr / include / I can get active hdf5.h in HDF5 .hpp . I use the latest version of Armadillo (4.450) and GCC 4.8.3. Did I lose a link? For me, Junk-Larmandilo and LLDF 5 (as stated in the Armadillo's User Guide) should be enough. any clue ? Thanks
After
Different versions of HDF5 libraries on Linux-based systems, due to various issues with Vermi's authors Automatic detection of HDF 5 library has disabled if you want to use HDF 5 with Armando, then there are two options:
1. Open the Armadillo .tar.gz package, and edit the CMakeLists.txt file. Dismiss 231 to 238 lines of lines beginning with find_package (HDF5) (i.e. remove # letters). Once you modify CMakeLists.txt, run the CMK based installation as described in the README.txt file. OR
2 Install Armadillo (without modifying CMakeLists.txt), and then compile your programs using (all on one line): < / p>
g ++ main.cpp -o main -O2 -DARMA_DONT_USE_WRAPPER -DARMA_USE_BLAS -DARMA_USE_LAPACK - bonus points: If you have installed high-speed library and want Armdilo use it instead of the standard bat , Then -lblas to -lopenblas
Comments
Post a Comment