diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fc49400b..fdf3954a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1490,6 +1490,7 @@ if(NOT MATIO_FOUND) endif(CMAKE_VERSION VERSION_LESS 3.2) set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES} ) set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include ) + set(MATIO_LOCAL true) endif(HDF5_FOUND) endif(ZLIB_FOUND) endif(NOT MATIO_FOUND) diff --git a/README.md b/README.md index a72c79577..1b513a25e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time libboost-serialization-dev libboost-program-options-dev libboost-test-dev \ liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr libblas-dev liblapack-dev \ libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libgtest-dev \ - python-mako python-six + python-mako python-six libmatio-dev ~~~~~~ Alternatively, and starting from Ubuntu 16.04 LTS, you can install all the required dependencies by adding the line @@ -495,6 +495,7 @@ $ sudo port install gnutls $ sudo port install google-glog +gflags $ sudo port install py27-mako $ sudo port install py27-six +$ sudo port install matio ~~~~~~ You also might need to activate a Python installation. The list of installed versions can be retrieved with: @@ -533,6 +534,7 @@ $ brew install cmake hdf5 arpack superlu $ brew install armadillo $ brew install glog gflags gnutls $ brew install gnuradio +$ brew install libmatio $ pip install mako $ pip install six ~~~~~~ diff --git a/src/tests/unit-tests/arithmetic/matio_test.cc b/src/tests/unit-tests/arithmetic/matio_test.cc index 8ef276bdc..e49cf7b63 100644 --- a/src/tests/unit-tests/arithmetic/matio_test.cc +++ b/src/tests/unit-tests/arithmetic/matio_test.cc @@ -66,6 +66,7 @@ TEST(MatioTest, WriteAndReadDoubles) matvar_read = Mat_VarRead(matfp_read, "x"); double *x_read = reinterpret_cast(matvar_read->data); Mat_Close(matfp_read); + Mat_VarFree(matvar_read); for(int i = 0; i < 10; i++) { EXPECT_DOUBLE_EQ(x[i], x_read[i]); @@ -84,7 +85,7 @@ TEST(MatioTest, WriteAndReadGrComplex) ASSERT_FALSE(reinterpret_cast(matfp) == NULL) << "Error creating .mat file"; std::vector x_v = { {1, 10}, {2, 9}, {3, 8}, {4, 7}, {5, 6}, {6, -5}, {7, -4}, {8, 3}, {9, 2}, {10, 1}}; - const int size = x_v.size(); + const unsigned int size = x_v.size(); float x_real[size]; float x_imag[size]; unsigned int i = 0; @@ -126,8 +127,9 @@ TEST(MatioTest, WriteAndReadGrComplex) } Mat_Close(matfp_read); + Mat_VarFree(matvar_read); - for(int i = 0; i < size; i++) + for(unsigned int i = 0; i < size; i++) { EXPECT_FLOAT_EQ(x_v[i].real(), x_v_read[i].real()); EXPECT_FLOAT_EQ(x_v[i].imag(), x_v_read[i].imag());