clapack-3.2.1-noblasf2c.patch 5.7 KB

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