Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/clapack/files: clapack-3.2.1-noblasf2c.patch
Date: Sun, 29 Aug 2010 17:22:28
Message-Id: 20100829172224.68D0E20054@flycatcher.gentoo.org
1 bicatali 10/08/29 17:22:24
2
3 Added: clapack-3.2.1-noblasf2c.patch
4 Log:
5 Now uses cmake tar ball. Added a patch from dilfridge that adds a shared library, an install target, builds test on request, and provides a clapack-config.cmake. So far, no more static libraries is being built.
6
7 (Portage version: 2.2_rc68/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sci-libs/clapack/files/clapack-3.2.1-noblasf2c.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/clapack/files/clapack-3.2.1-noblasf2c.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/clapack/files/clapack-3.2.1-noblasf2c.patch?rev=1.1&content-type=text/plain
14
15 Index: clapack-3.2.1-noblasf2c.patch
16 ===================================================================
17 diff -u -r -N clapack-3.2.1-CMAKE.orig/CMakeLists.txt clapack-3.2.1-CMAKE/CMakeLists.txt
18 --- clapack-3.2.1-CMAKE.orig/CMakeLists.txt 2009-08-10 20:46:33.000000000 +0200
19 +++ clapack-3.2.1-CMAKE/CMakeLists.txt 2010-08-28 14:04:30.000000000 +0200
20 @@ -1,7 +1,10 @@
21 cmake_minimum_required(VERSION 2.6)
22 project(CLAPACK C)
23 -enable_testing()
24 -include(CTest)
25 +
26 +if(ENABLE_TESTS)
27 + enable_testing()
28 + include(CTest)
29 +endif(ENABLE_TESTS)
30
31 if(WIN32 AND NOT CYGWIN)
32 set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c)
33 @@ -11,24 +14,34 @@
34 set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/second.c)
35 set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/dsecnd.c)
36 endif()
37 -enable_testing()
38 +
39 option(USE_BLAS_WRAP "pre-pend f2c_ to each function in blas" OFF)
40 if(NOT USE_BLAS_WRAP)
41 # _zrotg_ seems to be missing in the wrap header
42 add_definitions(-DNO_BLAS_WRAP)
43 endif()
44 +
45 include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE)
46 -add_subdirectory(F2CLIBS)
47 -add_subdirectory(BLAS)
48 -add_subdirectory(SRC)
49 -add_subdirectory(TESTING)
50 +
51 set(CLAPACK_VERSION 3.2.1)
52 set(CPACK_PACKAGE_VERSION_MAJOR 3)
53 set(CPACK_PACKAGE_VERSION_MINOR 2)
54 set(CPACK_PACKAGE_VERSION_PATCH 1)
55 +
56 +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
57 +
58 +add_subdirectory(SRC)
59 +
60 +if(ENABLE_TESTS)
61 + add_subdirectory(TESTING)
62 +endif(ENABLE_TESTS)
63 +
64 include(CPack)
65 -export(TARGETS f2c blas lapack FILE clapack-targets.cmake)
66 +
67 +export(TARGETS clapack FILE clapack-targets.cmake)
68 +
69 configure_file(${CLAPACK_SOURCE_DIR}/clapack-config-version.cmake.in
70 ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY)
71 configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in
72 ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY)
73 +
74 diff -u -r -N clapack-3.2.1-CMAKE.orig/SRC/CMakeLists.txt clapack-3.2.1-CMAKE/SRC/CMakeLists.txt
75 --- clapack-3.2.1-CMAKE.orig/SRC/CMakeLists.txt 2009-08-10 19:47:54.000000000 +0200
76 +++ clapack-3.2.1-CMAKE/SRC/CMakeLists.txt 2010-08-28 14:32:17.000000000 +0200
77 @@ -375,6 +375,20 @@
78 if(BUILD_COMPLEX16)
79 set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
80 endif()
81 -add_library(lapack ${ALLOBJ} ${ALLXOBJ})
82 -target_link_libraries(lapack blas)
83
84 +add_library(clapack SHARED ${ALLOBJ} ${ALLXOBJ})
85 +target_link_libraries(clapack blas f2c)
86 +set_target_properties(clapack PROPERTIES SOVERSION "${CLAPACK_VERSION}")
87 +
88 +install(
89 + TARGETS clapack EXPORT clapack
90 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
91 +)
92 +
93 +install(
94 + FILES ../INCLUDE/clapack.h DESTINATION include/clapack
95 +)
96 +
97 +install(
98 + EXPORT clapack DESTINATION "share/cmake/Modules" FILE clapack-config.cmake
99 +)
100 diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/EIG/CMakeLists.txt clapack-3.2.1-CMAKE/TESTING/EIG/CMakeLists.txt
101 --- clapack-3.2.1-CMAKE.orig/TESTING/EIG/CMakeLists.txt 2009-08-10 19:47:54.000000000 +0200
102 +++ clapack-3.2.1-CMAKE/TESTING/EIG/CMakeLists.txt 2010-08-28 13:46:40.000000000 +0200
103 @@ -119,7 +119,7 @@
104
105 macro(add_eig_executable name )
106 add_executable(${name} ${ARGN})
107 - target_link_libraries(${name} tmglib lapack )
108 + target_link_libraries(${name} tmglib clapack )
109 endmacro(add_eig_executable)
110
111 add_eig_executable(xeigtsts ${SEIGTST} ${SCIGTST} ${AEIGTST}
112 diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/LIN/CMakeLists.txt clapack-3.2.1-CMAKE/TESTING/LIN/CMakeLists.txt
113 --- clapack-3.2.1-CMAKE.orig/TESTING/LIN/CMakeLists.txt 2009-08-10 20:06:06.000000000 +0200
114 +++ clapack-3.2.1-CMAKE/TESTING/LIN/CMakeLists.txt 2010-08-28 13:46:40.000000000 +0200
115 @@ -189,7 +189,7 @@
116
117 macro(add_lin_executable name )
118 add_executable(${name} ${ARGN})
119 - target_link_libraries(${name} tmglib lapack)
120 + target_link_libraries(${name} tmglib clapack)
121 endmacro(add_lin_executable)
122
123 add_lin_executable(xlintsts ${ALINTST} ${SCLNTST} ${SLINTST}
124 diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/CMakeLists.txt clapack-3.2.1-CMAKE/TESTING/MATGEN/CMakeLists.txt
125 --- clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/CMakeLists.txt 2009-08-10 19:47:54.000000000 +0200
126 +++ clapack-3.2.1-CMAKE/TESTING/MATGEN/CMakeLists.txt 2010-08-28 13:46:40.000000000 +0200
127 @@ -65,5 +65,6 @@
128 if(BUILD_COMPLEX16)
129 set(ALLOBJ $(ZMATGEN) $(DZATGEN))
130 endif()
131 -add_library(tmglib ${ALLOBJ} )
132 +
133 +add_library(tmglib ${ALLOBJ} i_len_trim.c i_ceiling.c )
134
135 diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/i_ceiling.c clapack-3.2.1-CMAKE/TESTING/MATGEN/i_ceiling.c
136 --- clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/i_ceiling.c 1970-01-01 01:00:00.000000000 +0100
137 +++ clapack-3.2.1-CMAKE/TESTING/MATGEN/i_ceiling.c 2010-08-28 13:46:40.000000000 +0200
138 @@ -0,0 +1,38 @@
139 +/* file has been copied from the included f2c library - dilfridge */
140 +
141 +#include <f2c.h>
142 +
143 +#ifdef KR_headers
144 +integer i_sceiling(x) real *x;
145 +#else
146 +#ifdef __cplusplus
147 +extern "C" {
148 +#endif
149 +integer i_sceiling(real *x)
150 +#endif
151 +{
152 +#define CEIL(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
153 +
154 + return (integer) CEIL(*x);
155 +}
156 +#ifdef __cplusplus
157 +}
158 +#endif
159 +
160 +
161 +#ifdef KR_headers
162 +integer i_dceiling(x) doublereal *x;
163 +#else
164 +#ifdef __cplusplus
165 +extern "C" {
166 +#endif
167 +integer i_dceiling(doublereal *x)
168 +#endif
169 +{
170 +#define CEIL(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
171 +
172 + return (integer) CEIL(*x);
173 +}
174 +#ifdef __cplusplus
175 +}
176 +#endif
177 diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/i_len_trim.c clapack-3.2.1-CMAKE/TESTING/MATGEN/i_len_trim.c
178 --- clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/i_len_trim.c 1970-01-01 01:00:00.000000000 +0100
179 +++ clapack-3.2.1-CMAKE/TESTING/MATGEN/i_len_trim.c 2010-08-28 13:46:40.000000000 +0200
180 @@ -0,0 +1,25 @@
181 +/* file has been copied from the included f2c library - dilfridge */
182 +
183 +#include <f2c.h>
184 +
185 +#ifdef __cplusplus
186 +extern "C" {
187 +#endif
188 +
189 +#ifdef KR_headers
190 +integer i_len_trim(s, n) char *s; ftnlen n;
191 +#else
192 +integer i_len_trim(char *s, ftnlen n)
193 +#endif
194 +{
195 + int i;
196 +
197 + for(i=n-1;i>=0;i--)
198 + if(s[i] != ' ')
199 + return i + 1;
200 +
201 + return(0);
202 +}
203 +#ifdef __cplusplus
204 +}
205 +#endif