public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/betagarden:master commit in: sci-libs/levmar/files/, sci-libs/levmar/
@ 2011-11-26 21:30 Alexey Shvetsov
  0 siblings, 0 replies; only message in thread
From: Alexey Shvetsov @ 2011-11-26 21:30 UTC (permalink / raw
  To: gentoo-commits

commit:     a56736695bb5da2625ad1b839cb848abed953d6a
Author:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 21:27:52 2011 +0000
Commit:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 21:27:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=a5673669

[sci-libs/levmar] Import from alexxy overlay

(Portage version: 2.2.0_alpha78/git/Linux x86_64, signed Manifest commit with key F82F92E6)

---
 sci-libs/levmar/files/cmakeusage-2.5.patch |  128 ++++++++++++++++++++++++++++
 sci-libs/levmar/levmar-2.5.ebuild          |   61 +++++++++++++
 sci-libs/levmar/metadata.xml               |   17 ++++
 3 files changed, 206 insertions(+), 0 deletions(-)

diff --git a/sci-libs/levmar/files/cmakeusage-2.5.patch b/sci-libs/levmar/files/cmakeusage-2.5.patch
new file mode 100644
index 0000000..ed709ca
--- /dev/null
+++ b/sci-libs/levmar/files/cmakeusage-2.5.patch
@@ -0,0 +1,128 @@
+diff -ur levmar-2.5/CMakeLists.txt levmar-2.5.new/CMakeLists.txt
+--- levmar-2.5/CMakeLists.txt	2009-09-01 14:23:07.000000000 +0200
++++ levmar-2.5.new/CMakeLists.txt	2010-05-18 16:58:48.943757800 +0200
+@@ -2,53 +2,50 @@
+ #                        http://www.insightsoftwareconsortium.org/wiki/index.php/CMake_Tutorial
+ 
+ PROJECT(LEVMAR)
+-#CMAKE_MINIMUM_REQUIRED(VERSION 1.4)
++CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+ 
+-# compiler flags
+-#ADD_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # do not free memory between linear solvers calls
+-#REMOVE_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # free memory between calls
+-
+-# f2c is sometimes equivalent to libF77 & libI77; in that case, set HAVE_F2C to 0
+-SET(HAVE_F2C 1 CACHE BOOL "Do we have f2c or F77/I77?" )
+-
+-# the directory where the lapack/blas/f2c libraries reside
+-SET(LAPACKBLAS_DIR /usr/lib CACHE PATH "Path to lapack/blas libraries")
+-
+-# actual names for the lapack/blas/f2c libraries
+-SET(LAPACK_LIB lapack CACHE STRING "The name of the lapack library")
+-SET(BLAS_LIB blas CACHE STRING "The name of the blas library")
+-IF(HAVE_F2C)
+-  SET(F2C_LIB f2c CACHE STRING "The name of the f2c library")
+-ELSE(HAVE_F2C)
+-  SET(F77_LIB libF77 CACHE STRING "The name of the F77 library")
+-  SET(I77_LIB libI77 CACHE STRING "The name of the I77 library")
+-ENDIF(HAVE_F2C)
++if(COMMAND cmake_policy)
++  cmake_policy(SET CMP0003 NEW)
++endif(COMMAND cmake_policy)
+ 
+-########################## NO CHANGES BEYOND THIS POINT ##########################
+ 
+-INCLUDE_DIRECTORIES(.)
+-#INCLUDE_DIRECTORIES(/usr/include)
++OPTION(SUPPORT_DOUBLE_PRECICION "support double precicion solver" TRUE)
++OPTION(SUPPORT_SINGLE_PRECICION "support single precicion solver" TRUE)
++OPTION(BUILD_EXAMPLE "build example" FALSE)
++
++IF(SUPPORT_DOUBLE_PRECICION) 
++  ADD_DEFINITIONS(-DLM_DBL_PREC)
++ENDIF(SUPPORT_DOUBLE_PRECICION) 
++
++IF(SUPPORT_SINGLE_PRECICION) 
++  ADD_DEFINITIONS(-DLM_SNGL_PREC)
++ENDIF(SUPPORT_SINGLE_PRECICION) 
++
++ENABLE_LANGUAGE(Fortran)
++
++FIND_PACKAGE(LAPACK REQUIRED)
++IF(LAPACK_FOUND)
++  ADD_DEFINITIONS(-DHAVE_LAPACK)
++ENDIF(LAPACK_FOUND)
+ 
+ # levmar library source files
+-ADD_LIBRARY(levmar STATIC
++ADD_LIBRARY(levmar SHARED
+   lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c lmbleic.c
+-  levmar.h misc.h compiler.h
+ )
+ 
+-# demo program
+-LINK_DIRECTORIES(${LAPACKBLAS_DIR})
+-LINK_DIRECTORIES(.)
+-ADD_EXECUTABLE(lmdemo lmdemo.c levmar.h)
+-# libraries the demo depends on
+-IF(HAVE_F2C)
+-  TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F2C_LIB})
+-ELSE(HAVE_F2C)
+-  TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F77_LIB} ${I77_LIB})
+-ENDIF(HAVE_F2C)
+-
+-# make sure that the library is built before the demo
+-ADD_DEPENDENCIES(lmdemo levmar)
+-
+-#SUBDIRS(matlab)
++IF(LAPACK_FOUND)
++  LINK_DIRECTORIES(${LAPACK_LINKER_FLAGS})  
++  TARGET_LINK_LIBRARIES(levmar ${LAPACK_LIBRARIES})
++ENDIF(LAPACK_FOUND)
++ 
++IF(BUILD_EXAMPLE)
++  ADD_EXECUTABLE(lmdemo lmdemo.c)
++  TARGET_LINK_LIBRARIES(lmdemo levmar)
++ENDIF(BUILD_EXAMPLE)
++
++INSTALL(TARGETS levmar 
++  RUNTIME DESTINATION "bin"
++  LIBRARY DESTINATION "lib"
++  ARCHIVE DESTINATION "lib")
+ 
+-#ADD_TEST(levmar_tst lmdemo)
++INSTALL(FILES levmar.h DESTINATION "include")
+diff -ur levmar-2.5/levmar.h levmar-2.5.new/levmar.h
+--- levmar-2.5/levmar.h	2009-12-02 11:23:35.000000000 +0100
++++ levmar-2.5.new/levmar.h	2010-05-18 16:43:24.986917129 +0200
+@@ -26,7 +26,7 @@
+ /************************************* Start of configuration options *************************************/
+ 
+ /* specify whether to use LAPACK or not. The first option is strongly recommended */
+-#define HAVE_LAPACK /* use LAPACK */
++//#define HAVE_LAPACK /* use LAPACK */
+ /* #undef HAVE_LAPACK */  /* uncomment this to force not using LAPACK */
+ 
+ /* to avoid the overhead of repeated mallocs(), routines in Axb.c can be instructed to
+@@ -34,15 +34,15 @@
+  * non-reentrant and is not safe in a shared memory multiprocessing environment.
+  * Bellow, this option is turned on only when not compiling with OpenMP.
+  */
+-#if !defined(_OPENMP) 
+-#define LINSOLVERS_RETAIN_MEMORY /* comment this if you don't want routines in Axb.c retain working memory between calls */
+-#endif
++//#if !defined(_OPENMP) 
++//#define LINSOLVERS_RETAIN_MEMORY /* comment this if you don't want routines in Axb.c retain working memory between calls */
++//#endif
+ 
+ /* determine the precision variants to be build. Default settings build
+  * both the single and double precision routines
+  */
+-#define LM_DBL_PREC  /* comment this if you don't want the double precision routines to be compiled */
+-#define LM_SNGL_PREC /* comment this if you don't want the single precision routines to be compiled */
++//#define LM_DBL_PREC  /* comment this if you don't want the double precision routines to be compiled */
++//#define LM_SNGL_PREC /* comment this if you don't want the single precision routines to be compiled */
+ 
+ /****************** End of configuration options, no changes necessary beyond this point ******************/
+ 

diff --git a/sci-libs/levmar/levmar-2.5.ebuild b/sci-libs/levmar/levmar-2.5.ebuild
new file mode 100644
index 0000000..73142e7
--- /dev/null
+++ b/sci-libs/levmar/levmar-2.5.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libexif/libexif-0.6.12-r4.ebuild,v 1.8 2006/01/07 11:43:17 eradicator Exp $
+
+EAPI="3"
+
+inherit eutils
+
+DESCRIPTION="A C++ implementation of the Levenberg-Marquardt non-linear regression"
+HOMEPAGE="http://www.ics.forth.gr/~lourakis/levmar/"
+SRC_URI="http://www.ics.forth.gr/~lourakis/levmar/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="nosingle nodouble examples"
+
+RDEPEND="virtual/lapack"
+DEPEND="${RDEPEND}
+		>=dev-util/cmake-2.6"
+
+src_prepare() {
+	epatch "${FILESDIR}/cmakeusage-2.5.patch"
+}
+
+src_compile() {
+	local CMAKE_VARIABLES=""
+	CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_INSTALL_PREFIX:PATH=/usr"
+
+	if use nosingle; then
+		CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_SINGLE_PRECICION:BOOL=OFF"
+	else
+		CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_SINGLE_PRECICION:BOOL=ON"
+	fi
+
+	if use nodouble; then
+		CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_DOUBLE_PRECICION:BOOL=OFF"
+	else
+		CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_DOUBLE_PRECICION:BOOL=ON"
+	fi
+
+	if use examples; then
+		CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_EXAMPLE:BOOL=ON"
+	else
+		CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_EXAMPLE:BOOL=OFF"
+	fi
+
+	cmake ${CMAKE_VARIABLES} . || die "cmake configuration failed"
+
+	emake || die "make failed"
+}
+
+src_install() {
+	make DESTDIR="${D}" install || die "make install failed"
+	dodoc README.txt
+
+	if use examples; then
+		dodir /usr/share/${P}/examples/ || die "Failed to create examples directory"
+		cp "lmdemo.c" "${D}/usr/share/${P}/examples/" || die "Failed to copy example files"
+	fi
+}

diff --git a/sci-libs/levmar/metadata.xml b/sci-libs/levmar/metadata.xml
new file mode 100644
index 0000000..867a8ef
--- /dev/null
+++ b/sci-libs/levmar/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <herd>sci</herd>
+  <maintainer>
+    <email>gw.fossdev@gmail.com</email>
+    <name>Gert Wollny</name>
+  </maintainer>
+<longdescription>
+  levmar is a C/C++ implementation of the Levenberg-Marquard optimization algorithm 
+</longdescription>
+<use>
+  <flag name='nosingle'>Build and install without support for single precicion math</flag>
+  <flag name='nodouble'>Build and install without support for double precicion math</flag>
+  <flag name='examples'>Build the example to test the compile and install its source</flag>
+</use>
+</pkgmetadata>



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-26 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-26 21:30 [gentoo-commits] proj/betagarden:master commit in: sci-libs/levmar/files/, sci-libs/levmar/ Alexey Shvetsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox