changeset 2720:82d1044a4434

added armadillo 3.4.0 with test
author Christian Frisson <christian.frisson@gmail.com>
date Sun, 09 Sep 2012 17:01:46 +0200
parents c38f62ba10b1
children 1334d9ed9c39
files index.html src/armadillo-1-staticlib.patch src/armadillo-test.cpp src/armadillo.mk
diffstat 4 files changed, 102 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
         <td id="apr-website"><a href="http://apr.apache.org/">APR</a></td>
     </tr>
     <tr>
+        <td id="armadillo-package">armadillo</td>
+        <td id="armadillo-version">3.4.0</td>
+        <td id="armadillo-website"><a href="http://armadillo.sf.net/">Armadillo C++ linear algebra library</a></td>
+    </tr>
+    <tr>
         <td id="atk-package">atk</td>
         <td id="atk-version">2.4.0</td>
         <td id="atk-website"><a href="http://www.gtk.org/">ATK</a></td>
--- /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)
--- /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 <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;
+}
--- /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