]>
Commit | Line | Data |
---|---|---|
8271ff34 AM |
1 | diff -u -r -N clapack-3.2.1-CMAKE.orig/CMakeLists.txt clapack-3.2.1-CMAKE/CMakeLists.txt |
2 | --- clapack-3.2.1-CMAKE.orig/CMakeLists.txt 2009-08-10 20:46:33.000000000 +0200 | |
3 | +++ clapack-3.2.1-CMAKE/CMakeLists.txt 2010-08-28 14:04:30.000000000 +0200 | |
4 | @@ -1,7 +1,10 @@ | |
5 | cmake_minimum_required(VERSION 2.6) | |
6 | project(CLAPACK C) | |
7 | -enable_testing() | |
8 | -include(CTest) | |
9 | + | |
10 | +if(ENABLE_TESTS) | |
11 | + enable_testing() | |
12 | + include(CTest) | |
13 | +endif(ENABLE_TESTS) | |
14 | ||
15 | if(WIN32 AND NOT CYGWIN) | |
16 | set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c) | |
17 | @@ -11,24 +14,34 @@ | |
18 | set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/second.c) | |
19 | set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/dsecnd.c) | |
20 | endif() | |
21 | -enable_testing() | |
22 | + | |
23 | option(USE_BLAS_WRAP "pre-pend f2c_ to each function in blas" OFF) | |
24 | if(NOT USE_BLAS_WRAP) | |
25 | # _zrotg_ seems to be missing in the wrap header | |
26 | add_definitions(-DNO_BLAS_WRAP) | |
27 | endif() | |
28 | + | |
29 | include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE) | |
30 | -add_subdirectory(F2CLIBS) | |
31 | -add_subdirectory(BLAS) | |
32 | -add_subdirectory(SRC) | |
33 | -add_subdirectory(TESTING) | |
34 | + | |
35 | set(CLAPACK_VERSION 3.2.1) | |
36 | set(CPACK_PACKAGE_VERSION_MAJOR 3) | |
37 | set(CPACK_PACKAGE_VERSION_MINOR 2) | |
38 | set(CPACK_PACKAGE_VERSION_PATCH 1) | |
39 | + | |
40 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") | |
41 | + | |
42 | +add_subdirectory(SRC) | |
43 | + | |
44 | +if(ENABLE_TESTS) | |
45 | + add_subdirectory(TESTING) | |
46 | +endif(ENABLE_TESTS) | |
47 | + | |
48 | include(CPack) | |
49 | -export(TARGETS f2c blas lapack FILE clapack-targets.cmake) | |
50 | + | |
51 | +export(TARGETS clapack FILE clapack-targets.cmake) | |
52 | + | |
53 | configure_file(${CLAPACK_SOURCE_DIR}/clapack-config-version.cmake.in | |
54 | ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY) | |
55 | configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in | |
56 | ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY) | |
57 | + | |
58 | diff -u -r -N clapack-3.2.1-CMAKE.orig/SRC/CMakeLists.txt clapack-3.2.1-CMAKE/SRC/CMakeLists.txt | |
59 | --- clapack-3.2.1-CMAKE.orig/SRC/CMakeLists.txt 2009-08-10 19:47:54.000000000 +0200 | |
60 | +++ clapack-3.2.1-CMAKE/SRC/CMakeLists.txt 2010-08-28 14:32:17.000000000 +0200 | |
61 | @@ -375,6 +375,20 @@ | |
62 | if(BUILD_COMPLEX16) | |
63 | set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX}) | |
64 | endif() | |
65 | -add_library(lapack ${ALLOBJ} ${ALLXOBJ}) | |
66 | -target_link_libraries(lapack blas) | |
67 | ||
68 | +add_library(clapack SHARED ${ALLOBJ} ${ALLXOBJ}) | |
69 | +target_link_libraries(clapack blas f2c m) | |
70 | +set_target_properties(clapack PROPERTIES SOVERSION "${CLAPACK_VERSION}") | |
71 | + | |
72 | +install( | |
73 | + TARGETS clapack EXPORT clapack | |
74 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | |
75 | +) | |
76 | + | |
77 | +install( | |
78 | + FILES ../INCLUDE/clapack.h DESTINATION include/clapack | |
79 | +) | |
80 | + | |
81 | +install( | |
82 | + EXPORT clapack DESTINATION "share/cmake/Modules" FILE clapack-config.cmake | |
83 | +) | |
84 | diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/EIG/CMakeLists.txt clapack-3.2.1-CMAKE/TESTING/EIG/CMakeLists.txt | |
85 | --- clapack-3.2.1-CMAKE.orig/TESTING/EIG/CMakeLists.txt 2009-08-10 19:47:54.000000000 +0200 | |
86 | +++ clapack-3.2.1-CMAKE/TESTING/EIG/CMakeLists.txt 2010-08-28 13:46:40.000000000 +0200 | |
87 | @@ -119,7 +119,7 @@ | |
88 | ||
89 | macro(add_eig_executable name ) | |
90 | add_executable(${name} ${ARGN}) | |
91 | - target_link_libraries(${name} tmglib lapack ) | |
92 | + target_link_libraries(${name} tmglib clapack ) | |
93 | endmacro(add_eig_executable) | |
94 | ||
95 | add_eig_executable(xeigtsts ${SEIGTST} ${SCIGTST} ${AEIGTST} | |
96 | diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/LIN/CMakeLists.txt clapack-3.2.1-CMAKE/TESTING/LIN/CMakeLists.txt | |
97 | --- clapack-3.2.1-CMAKE.orig/TESTING/LIN/CMakeLists.txt 2009-08-10 20:06:06.000000000 +0200 | |
98 | +++ clapack-3.2.1-CMAKE/TESTING/LIN/CMakeLists.txt 2010-08-28 13:46:40.000000000 +0200 | |
99 | @@ -189,7 +189,7 @@ | |
100 | ||
101 | macro(add_lin_executable name ) | |
102 | add_executable(${name} ${ARGN}) | |
103 | - target_link_libraries(${name} tmglib lapack) | |
104 | + target_link_libraries(${name} tmglib clapack) | |
105 | endmacro(add_lin_executable) | |
106 | ||
107 | add_lin_executable(xlintsts ${ALINTST} ${SCLNTST} ${SLINTST} | |
108 | diff -u -r -N clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/CMakeLists.txt clapack-3.2.1-CMAKE/TESTING/MATGEN/CMakeLists.txt | |
109 | --- clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/CMakeLists.txt 2009-08-10 19:47:54.000000000 +0200 | |
110 | +++ clapack-3.2.1-CMAKE/TESTING/MATGEN/CMakeLists.txt 2010-08-28 13:46:40.000000000 +0200 | |
111 | @@ -65,5 +65,6 @@ | |
112 | if(BUILD_COMPLEX16) | |
113 | set(ALLOBJ $(ZMATGEN) $(DZATGEN)) | |
114 | endif() | |
115 | -add_library(tmglib ${ALLOBJ} ) | |
116 | + | |
117 | +add_library(tmglib ${ALLOBJ} i_len_trim.c i_ceiling.c ) | |
118 | ||
119 | 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 | |
120 | --- clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/i_ceiling.c 1970-01-01 01:00:00.000000000 +0100 | |
121 | +++ clapack-3.2.1-CMAKE/TESTING/MATGEN/i_ceiling.c 2010-08-28 13:46:40.000000000 +0200 | |
122 | @@ -0,0 +1,38 @@ | |
123 | +/* file has been copied from the included f2c library - dilfridge */ | |
124 | + | |
125 | +#include <f2c.h> | |
126 | + | |
127 | +#ifdef KR_headers | |
128 | +integer i_sceiling(x) real *x; | |
129 | +#else | |
130 | +#ifdef __cplusplus | |
131 | +extern "C" { | |
132 | +#endif | |
133 | +integer i_sceiling(real *x) | |
134 | +#endif | |
135 | +{ | |
136 | +#define CEIL(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | |
137 | + | |
138 | + return (integer) CEIL(*x); | |
139 | +} | |
140 | +#ifdef __cplusplus | |
141 | +} | |
142 | +#endif | |
143 | + | |
144 | + | |
145 | +#ifdef KR_headers | |
146 | +integer i_dceiling(x) doublereal *x; | |
147 | +#else | |
148 | +#ifdef __cplusplus | |
149 | +extern "C" { | |
150 | +#endif | |
151 | +integer i_dceiling(doublereal *x) | |
152 | +#endif | |
153 | +{ | |
154 | +#define CEIL(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | |
155 | + | |
156 | + return (integer) CEIL(*x); | |
157 | +} | |
158 | +#ifdef __cplusplus | |
159 | +} | |
160 | +#endif | |
161 | 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 | |
162 | --- clapack-3.2.1-CMAKE.orig/TESTING/MATGEN/i_len_trim.c 1970-01-01 01:00:00.000000000 +0100 | |
163 | +++ clapack-3.2.1-CMAKE/TESTING/MATGEN/i_len_trim.c 2010-08-28 13:46:40.000000000 +0200 | |
164 | @@ -0,0 +1,25 @@ | |
165 | +/* file has been copied from the included f2c library - dilfridge */ | |
166 | + | |
167 | +#include <f2c.h> | |
168 | + | |
169 | +#ifdef __cplusplus | |
170 | +extern "C" { | |
171 | +#endif | |
172 | + | |
173 | +#ifdef KR_headers | |
174 | +integer i_len_trim(s, n) char *s; ftnlen n; | |
175 | +#else | |
176 | +integer i_len_trim(char *s, ftnlen n) | |
177 | +#endif | |
178 | +{ | |
179 | + int i; | |
180 | + | |
181 | + for(i=n-1;i>=0;i--) | |
182 | + if(s[i] != ' ') | |
183 | + return i + 1; | |
184 | + | |
185 | + return(0); | |
186 | +} | |
187 | +#ifdef __cplusplus | |
188 | +} | |
189 | +#endif |