diff options
author | Christian Frisson <christian.frisson@gmail.com> | 2012-09-09 15:01:46 (GMT) |
---|---|---|
committer | Christian Frisson <christian.frisson@gmail.com> | 2012-09-09 15:01:46 (GMT) |
commit | 9920490a34d324a8075f0101b1e029bb84b15b7b (patch) | |
tree | 2f36dbd1ee9cf637af3046e597c31ddaafcd264c /src | |
parent | dd54b69d76820de034501a211d44aa5c1ab7c973 (diff) | |
download | mxe-9920490a34d324a8075f0101b1e029bb84b15b7b.zip mxe-9920490a34d324a8075f0101b1e029bb84b15b7b.tar.gz mxe-9920490a34d324a8075f0101b1e029bb84b15b7b.tar.bz2 |
added armadillo 3.4.0 with test
Diffstat (limited to 'src')
-rw-r--r-- | src/armadillo-1-staticlib.patch | 43 | ||||
-rw-r--r-- | src/armadillo-test.cpp | 24 | ||||
-rw-r--r-- | src/armadillo.mk | 30 |
3 files changed, 97 insertions, 0 deletions
diff --git a/src/armadillo-1-staticlib.patch b/src/armadillo-1-staticlib.patch new file mode 100644 index 0000000..d4be9a6 --- /dev/null +++ b/src/armadillo-1-staticlib.patch @@ -0,0 +1,43 @@ +This file is part of MXE. +See index.html for further information. + +--- armadillo-3.4.0/CMakeLists.txt.orig 2012-09-06 09:43:16.000000000 +0200 ++++ armadillo-3.4.0/CMakeLists.txt 2012-09-09 16:18:57.000000000 +0200 +@@ -40,7 +40,7 @@ + set(ARMA_USE_ATLAS false) + set(ARMA_USE_BOOST false) + set(ARMA_USE_HDF5 false) +-set(ARMA_USE_WRAPPER true ) ++set(ARMA_USE_WRAPPER false) + + + if(WIN32) +@@ -158,15 +158,15 @@ + endif() + + else() ++ ++ if(ARMA_USE_LAPACK STREQUAL true) ++ set(ARMA_LIBS ${ARMA_LIBS} ${LAPACK_LIBRARIES}) ++ endif() + + if(ARMA_USE_BLAS STREQUAL true) + set(ARMA_LIBS ${ARMA_LIBS} ${BLAS_LIBRARIES}) + endif() + +- if(ARMA_USE_LAPACK STREQUAL true) +- set(ARMA_LIBS ${ARMA_LIBS} ${LAPACK_LIBRARIES}) +- endif() +- + if(ARMA_USE_ATLAS STREQUAL true) + set(ARMA_LIBS ${ARMA_LIBS} ${CBLAS_LIBRARIES}) + set(ARMA_LIBS ${ARMA_LIBS} ${CLAPACK_LIBRARIES}) +@@ -263,7 +263,7 @@ + #set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + +-add_library( armadillo SHARED src/wrap_libs ) ++add_library( armadillo STATIC src/wrap_libs ) + target_link_libraries( armadillo ${ARMA_LIBS} ) + + set_target_properties(armadillo PROPERTIES VERSION ${ARMA_MAJOR}.${ARMA_MINOR}.${ARMA_PATCH} SOVERSION 3) diff --git a/src/armadillo-test.cpp b/src/armadillo-test.cpp new file mode 100644 index 0000000..da32512 --- /dev/null +++ b/src/armadillo-test.cpp @@ -0,0 +1,24 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include <armadillo> + +using namespace arma; + +int main() +{ + mat A = randu<mat>(50,50); + mat B = trans(A)*A; // generate a symmetric matrix + + vec eigval; + mat eigvec; + + // use standard algorithm by default + eig_sym(eigval, eigvec, B); + + // use divide & conquer algorithm + eig_sym(eigval, eigvec, B, "dc"); + return 0; +} diff --git a/src/armadillo.mk b/src/armadillo.mk new file mode 100644 index 0000000..04462ac --- /dev/null +++ b/src/armadillo.mk @@ -0,0 +1,30 @@ +# This file is part of MXE. +# See index.html for further information. + +# armadillo +PKG := armadillo +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := e7fdb6518172aabaa28c84412b52db7d86ef37a5 +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/arma/$($(PKG)_FILE) +$(PKG)_DEPS := gcc boost blas lapack + +define $(PKG)_UPDATE + wget -q -O- 'http://sourceforge.net/projects/arma/files/' | \ + $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && \ + cmake . -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' + $(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1 + +# note: don't use -Werror with GCC 4.7.0 and .1 +'$(TARGET)-g++' \ + -W -Wall \ + '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-armadillo.exe' \ + -larmadillo -llapack -lblas -lgfortran + -lboost_serialization-mt -lboost_thread_win32-mt -lboost_system-mt +endef |