1 |
commit: a56736695bb5da2625ad1b839cb848abed953d6a |
2 |
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 26 21:27:52 2011 +0000 |
4 |
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 26 21:27:52 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=a5673669 |
7 |
|
8 |
[sci-libs/levmar] Import from alexxy overlay |
9 |
|
10 |
(Portage version: 2.2.0_alpha78/git/Linux x86_64, signed Manifest commit with key F82F92E6) |
11 |
|
12 |
--- |
13 |
sci-libs/levmar/files/cmakeusage-2.5.patch | 128 ++++++++++++++++++++++++++++ |
14 |
sci-libs/levmar/levmar-2.5.ebuild | 61 +++++++++++++ |
15 |
sci-libs/levmar/metadata.xml | 17 ++++ |
16 |
3 files changed, 206 insertions(+), 0 deletions(-) |
17 |
|
18 |
diff --git a/sci-libs/levmar/files/cmakeusage-2.5.patch b/sci-libs/levmar/files/cmakeusage-2.5.patch |
19 |
new file mode 100644 |
20 |
index 0000000..ed709ca |
21 |
--- /dev/null |
22 |
+++ b/sci-libs/levmar/files/cmakeusage-2.5.patch |
23 |
@@ -0,0 +1,128 @@ |
24 |
+diff -ur levmar-2.5/CMakeLists.txt levmar-2.5.new/CMakeLists.txt |
25 |
+--- levmar-2.5/CMakeLists.txt 2009-09-01 14:23:07.000000000 +0200 |
26 |
++++ levmar-2.5.new/CMakeLists.txt 2010-05-18 16:58:48.943757800 +0200 |
27 |
+@@ -2,53 +2,50 @@ |
28 |
+ # http://www.insightsoftwareconsortium.org/wiki/index.php/CMake_Tutorial |
29 |
+ |
30 |
+ PROJECT(LEVMAR) |
31 |
+-#CMAKE_MINIMUM_REQUIRED(VERSION 1.4) |
32 |
++CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
33 |
+ |
34 |
+-# compiler flags |
35 |
+-#ADD_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # do not free memory between linear solvers calls |
36 |
+-#REMOVE_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # free memory between calls |
37 |
+- |
38 |
+-# f2c is sometimes equivalent to libF77 & libI77; in that case, set HAVE_F2C to 0 |
39 |
+-SET(HAVE_F2C 1 CACHE BOOL "Do we have f2c or F77/I77?" ) |
40 |
+- |
41 |
+-# the directory where the lapack/blas/f2c libraries reside |
42 |
+-SET(LAPACKBLAS_DIR /usr/lib CACHE PATH "Path to lapack/blas libraries") |
43 |
+- |
44 |
+-# actual names for the lapack/blas/f2c libraries |
45 |
+-SET(LAPACK_LIB lapack CACHE STRING "The name of the lapack library") |
46 |
+-SET(BLAS_LIB blas CACHE STRING "The name of the blas library") |
47 |
+-IF(HAVE_F2C) |
48 |
+- SET(F2C_LIB f2c CACHE STRING "The name of the f2c library") |
49 |
+-ELSE(HAVE_F2C) |
50 |
+- SET(F77_LIB libF77 CACHE STRING "The name of the F77 library") |
51 |
+- SET(I77_LIB libI77 CACHE STRING "The name of the I77 library") |
52 |
+-ENDIF(HAVE_F2C) |
53 |
++if(COMMAND cmake_policy) |
54 |
++ cmake_policy(SET CMP0003 NEW) |
55 |
++endif(COMMAND cmake_policy) |
56 |
+ |
57 |
+-########################## NO CHANGES BEYOND THIS POINT ########################## |
58 |
+ |
59 |
+-INCLUDE_DIRECTORIES(.) |
60 |
+-#INCLUDE_DIRECTORIES(/usr/include) |
61 |
++OPTION(SUPPORT_DOUBLE_PRECICION "support double precicion solver" TRUE) |
62 |
++OPTION(SUPPORT_SINGLE_PRECICION "support single precicion solver" TRUE) |
63 |
++OPTION(BUILD_EXAMPLE "build example" FALSE) |
64 |
++ |
65 |
++IF(SUPPORT_DOUBLE_PRECICION) |
66 |
++ ADD_DEFINITIONS(-DLM_DBL_PREC) |
67 |
++ENDIF(SUPPORT_DOUBLE_PRECICION) |
68 |
++ |
69 |
++IF(SUPPORT_SINGLE_PRECICION) |
70 |
++ ADD_DEFINITIONS(-DLM_SNGL_PREC) |
71 |
++ENDIF(SUPPORT_SINGLE_PRECICION) |
72 |
++ |
73 |
++ENABLE_LANGUAGE(Fortran) |
74 |
++ |
75 |
++FIND_PACKAGE(LAPACK REQUIRED) |
76 |
++IF(LAPACK_FOUND) |
77 |
++ ADD_DEFINITIONS(-DHAVE_LAPACK) |
78 |
++ENDIF(LAPACK_FOUND) |
79 |
+ |
80 |
+ # levmar library source files |
81 |
+-ADD_LIBRARY(levmar STATIC |
82 |
++ADD_LIBRARY(levmar SHARED |
83 |
+ lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c lmbleic.c |
84 |
+- levmar.h misc.h compiler.h |
85 |
+ ) |
86 |
+ |
87 |
+-# demo program |
88 |
+-LINK_DIRECTORIES(${LAPACKBLAS_DIR}) |
89 |
+-LINK_DIRECTORIES(.) |
90 |
+-ADD_EXECUTABLE(lmdemo lmdemo.c levmar.h) |
91 |
+-# libraries the demo depends on |
92 |
+-IF(HAVE_F2C) |
93 |
+- TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F2C_LIB}) |
94 |
+-ELSE(HAVE_F2C) |
95 |
+- TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F77_LIB} ${I77_LIB}) |
96 |
+-ENDIF(HAVE_F2C) |
97 |
+- |
98 |
+-# make sure that the library is built before the demo |
99 |
+-ADD_DEPENDENCIES(lmdemo levmar) |
100 |
+- |
101 |
+-#SUBDIRS(matlab) |
102 |
++IF(LAPACK_FOUND) |
103 |
++ LINK_DIRECTORIES(${LAPACK_LINKER_FLAGS}) |
104 |
++ TARGET_LINK_LIBRARIES(levmar ${LAPACK_LIBRARIES}) |
105 |
++ENDIF(LAPACK_FOUND) |
106 |
++ |
107 |
++IF(BUILD_EXAMPLE) |
108 |
++ ADD_EXECUTABLE(lmdemo lmdemo.c) |
109 |
++ TARGET_LINK_LIBRARIES(lmdemo levmar) |
110 |
++ENDIF(BUILD_EXAMPLE) |
111 |
++ |
112 |
++INSTALL(TARGETS levmar |
113 |
++ RUNTIME DESTINATION "bin" |
114 |
++ LIBRARY DESTINATION "lib" |
115 |
++ ARCHIVE DESTINATION "lib") |
116 |
+ |
117 |
+-#ADD_TEST(levmar_tst lmdemo) |
118 |
++INSTALL(FILES levmar.h DESTINATION "include") |
119 |
+diff -ur levmar-2.5/levmar.h levmar-2.5.new/levmar.h |
120 |
+--- levmar-2.5/levmar.h 2009-12-02 11:23:35.000000000 +0100 |
121 |
++++ levmar-2.5.new/levmar.h 2010-05-18 16:43:24.986917129 +0200 |
122 |
+@@ -26,7 +26,7 @@ |
123 |
+ /************************************* Start of configuration options *************************************/ |
124 |
+ |
125 |
+ /* specify whether to use LAPACK or not. The first option is strongly recommended */ |
126 |
+-#define HAVE_LAPACK /* use LAPACK */ |
127 |
++//#define HAVE_LAPACK /* use LAPACK */ |
128 |
+ /* #undef HAVE_LAPACK */ /* uncomment this to force not using LAPACK */ |
129 |
+ |
130 |
+ /* to avoid the overhead of repeated mallocs(), routines in Axb.c can be instructed to |
131 |
+@@ -34,15 +34,15 @@ |
132 |
+ * non-reentrant and is not safe in a shared memory multiprocessing environment. |
133 |
+ * Bellow, this option is turned on only when not compiling with OpenMP. |
134 |
+ */ |
135 |
+-#if !defined(_OPENMP) |
136 |
+-#define LINSOLVERS_RETAIN_MEMORY /* comment this if you don't want routines in Axb.c retain working memory between calls */ |
137 |
+-#endif |
138 |
++//#if !defined(_OPENMP) |
139 |
++//#define LINSOLVERS_RETAIN_MEMORY /* comment this if you don't want routines in Axb.c retain working memory between calls */ |
140 |
++//#endif |
141 |
+ |
142 |
+ /* determine the precision variants to be build. Default settings build |
143 |
+ * both the single and double precision routines |
144 |
+ */ |
145 |
+-#define LM_DBL_PREC /* comment this if you don't want the double precision routines to be compiled */ |
146 |
+-#define LM_SNGL_PREC /* comment this if you don't want the single precision routines to be compiled */ |
147 |
++//#define LM_DBL_PREC /* comment this if you don't want the double precision routines to be compiled */ |
148 |
++//#define LM_SNGL_PREC /* comment this if you don't want the single precision routines to be compiled */ |
149 |
+ |
150 |
+ /****************** End of configuration options, no changes necessary beyond this point ******************/ |
151 |
+ |
152 |
|
153 |
diff --git a/sci-libs/levmar/levmar-2.5.ebuild b/sci-libs/levmar/levmar-2.5.ebuild |
154 |
new file mode 100644 |
155 |
index 0000000..73142e7 |
156 |
--- /dev/null |
157 |
+++ b/sci-libs/levmar/levmar-2.5.ebuild |
158 |
@@ -0,0 +1,61 @@ |
159 |
+# Copyright 1999-2011 Gentoo Foundation |
160 |
+# Distributed under the terms of the GNU General Public License v2 |
161 |
+# $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 $ |
162 |
+ |
163 |
+EAPI="3" |
164 |
+ |
165 |
+inherit eutils |
166 |
+ |
167 |
+DESCRIPTION="A C++ implementation of the Levenberg-Marquardt non-linear regression" |
168 |
+HOMEPAGE="http://www.ics.forth.gr/~lourakis/levmar/" |
169 |
+SRC_URI="http://www.ics.forth.gr/~lourakis/levmar/${P}.tgz" |
170 |
+ |
171 |
+LICENSE="GPL-2" |
172 |
+SLOT="0" |
173 |
+KEYWORDS="~x86 ~amd64" |
174 |
+IUSE="nosingle nodouble examples" |
175 |
+ |
176 |
+RDEPEND="virtual/lapack" |
177 |
+DEPEND="${RDEPEND} |
178 |
+ >=dev-util/cmake-2.6" |
179 |
+ |
180 |
+src_prepare() { |
181 |
+ epatch "${FILESDIR}/cmakeusage-2.5.patch" |
182 |
+} |
183 |
+ |
184 |
+src_compile() { |
185 |
+ local CMAKE_VARIABLES="" |
186 |
+ CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_INSTALL_PREFIX:PATH=/usr" |
187 |
+ |
188 |
+ if use nosingle; then |
189 |
+ CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_SINGLE_PRECICION:BOOL=OFF" |
190 |
+ else |
191 |
+ CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_SINGLE_PRECICION:BOOL=ON" |
192 |
+ fi |
193 |
+ |
194 |
+ if use nodouble; then |
195 |
+ CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_DOUBLE_PRECICION:BOOL=OFF" |
196 |
+ else |
197 |
+ CMAKE_VARIABLES="${CMAKE_VARIABLES} -DSUPPORT_DOUBLE_PRECICION:BOOL=ON" |
198 |
+ fi |
199 |
+ |
200 |
+ if use examples; then |
201 |
+ CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_EXAMPLE:BOOL=ON" |
202 |
+ else |
203 |
+ CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_EXAMPLE:BOOL=OFF" |
204 |
+ fi |
205 |
+ |
206 |
+ cmake ${CMAKE_VARIABLES} . || die "cmake configuration failed" |
207 |
+ |
208 |
+ emake || die "make failed" |
209 |
+} |
210 |
+ |
211 |
+src_install() { |
212 |
+ make DESTDIR="${D}" install || die "make install failed" |
213 |
+ dodoc README.txt |
214 |
+ |
215 |
+ if use examples; then |
216 |
+ dodir /usr/share/${P}/examples/ || die "Failed to create examples directory" |
217 |
+ cp "lmdemo.c" "${D}/usr/share/${P}/examples/" || die "Failed to copy example files" |
218 |
+ fi |
219 |
+} |
220 |
|
221 |
diff --git a/sci-libs/levmar/metadata.xml b/sci-libs/levmar/metadata.xml |
222 |
new file mode 100644 |
223 |
index 0000000..867a8ef |
224 |
--- /dev/null |
225 |
+++ b/sci-libs/levmar/metadata.xml |
226 |
@@ -0,0 +1,17 @@ |
227 |
+<?xml version="1.0" encoding="UTF-8"?> |
228 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
229 |
+<pkgmetadata> |
230 |
+ <herd>sci</herd> |
231 |
+ <maintainer> |
232 |
+ <email>gw.fossdev@×××××.com</email> |
233 |
+ <name>Gert Wollny</name> |
234 |
+ </maintainer> |
235 |
+<longdescription> |
236 |
+ levmar is a C/C++ implementation of the Levenberg-Marquard optimization algorithm |
237 |
+</longdescription> |
238 |
+<use> |
239 |
+ <flag name='nosingle'>Build and install without support for single precicion math</flag> |
240 |
+ <flag name='nodouble'>Build and install without support for double precicion math</flag> |
241 |
+ <flag name='examples'>Build the example to test the compile and install its source</flag> |
242 |
+</use> |
243 |
+</pkgmetadata> |