# HG changeset patch # User Christian Frisson # Date 1347202906 -7200 # Node ID 82d1044a44342308fd645975df7de750441f5d76 # Parent c38f62ba10b1c389e336ec3c5837ea4a85c48c9d added armadillo 3.4.0 with test diff -r c38f62ba10b1 -r 82d1044a4434 index.html --- a/index.html Thu Sep 06 23:16:41 2012 +0200 +++ b/index.html Sun Sep 09 17:01:46 2012 +0200 @@ -924,6 +924,11 @@ APR + armadillo + 3.4.0 + Armadillo C++ linear algebra library + + atk 2.4.0 ATK diff -r c38f62ba10b1 -r 82d1044a4434 src/armadillo-1-staticlib.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/armadillo-1-staticlib.patch Sun Sep 09 17:01:46 2012 +0200 @@ -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 -r c38f62ba10b1 -r 82d1044a4434 src/armadillo-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/armadillo-test.cpp Sun Sep 09 17:01:46 2012 +0200 @@ -0,0 +1,24 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include + +using namespace arma; + +int main() +{ + mat A = randu(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 -r c38f62ba10b1 -r 82d1044a4434 src/armadillo.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/armadillo.mk Sun Sep 09 17:01:46 2012 +0200 @@ -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