You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 6.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. #
  2. # The Makefile compiles c wrappers and testers for CBLAS.
  3. #
  4. TOPDIR = ..
  5. include $(TOPDIR)/Makefile.system
  6. override CFLAGS += -DADD$(BU) -DCBLAS
  7. ifeq ($(F_COMPILER),GFORTRAN)
  8. override FFLAGS += -fno-tree-vectorize
  9. endif
  10. override TARGET_ARCH=
  11. override TARGET_MACH=
  12. LIB = $(TOPDIR)/$(LIBNAME)
  13. stestl1o = c_sblas1.o
  14. stestl2o = c_sblas2.o c_s2chke.o auxiliary.o c_xerbla.o constant.o
  15. stestl3o = c_sblas3.o c_s3chke.o auxiliary.o c_xerbla.o constant.o
  16. dtestl1o = c_dblas1.o
  17. dtestl2o = c_dblas2.o c_d2chke.o auxiliary.o c_xerbla.o constant.o
  18. dtestl3o = c_dblas3.o c_d3chke.o auxiliary.o c_xerbla.o constant.o
  19. ctestl1o = c_cblas1.o
  20. ctestl2o = c_cblas2.o c_c2chke.o auxiliary.o c_xerbla.o constant.o
  21. ctestl3o = c_cblas3.o c_c3chke.o auxiliary.o c_xerbla.o constant.o
  22. ctestl3o_3m = c_cblas3_3m.o c_c3chke_3m.o auxiliary.o c_xerbla.o constant.o
  23. ztestl1o = c_zblas1.o
  24. ztestl2o = c_zblas2.o c_z2chke.o auxiliary.o c_xerbla.o constant.o
  25. ztestl3o = c_zblas3.o c_z3chke.o auxiliary.o c_xerbla.o constant.o
  26. ztestl3o_3m = c_zblas3_3m.o c_z3chke_3m.o auxiliary.o c_xerbla.o constant.o
  27. ifeq ($(NOFORTRAN),1)
  28. all ::
  29. else
  30. all :: all1 all2 all3
  31. endif
  32. ifeq ($(BUILD_SINGLE),1)
  33. all1targets += xscblat1
  34. endif
  35. ifeq ($(BUILD_DOUBLE),1)
  36. all1targets += xdcblat1
  37. endif
  38. ifeq ($(BUILD_COMPLEX),1)
  39. all1targets += xccblat1
  40. endif
  41. ifeq ($(BUILD_COMPLEX16),1)
  42. all1targets += xzcblat1
  43. endif
  44. all1: $(all1targets)
  45. ifneq ($(CROSS), 1)
  46. ifeq ($(USE_OPENMP), 1)
  47. ifeq ($(BUILD_SINGLE),1)
  48. OMP_NUM_THREADS=2 ./xscblat1
  49. endif
  50. ifeq ($(BUILD_DOUBLE),1)
  51. OMP_NUM_THREADS=2 ./xdcblat1
  52. endif
  53. ifeq ($(BUILD_COMPLEX),1)
  54. OMP_NUM_THREADS=2 ./xccblat1
  55. endif
  56. ifeq ($(BUILD_COMPLEX16),1)
  57. OMP_NUM_THREADS=2 ./xzcblat1
  58. endif
  59. else
  60. ifeq ($(BUILD_SINGLE),1)
  61. OPENBLAS_NUM_THREADS=2 ./xscblat1
  62. endif
  63. ifeq ($(BUILD_DOUBLE),1)
  64. OPENBLAS_NUM_THREADS=2 ./xdcblat1
  65. endif
  66. ifeq ($(BUILD_COMPLEX),1)
  67. OPENBLAS_NUM_THREADS=2 ./xccblat1
  68. endif
  69. ifeq ($(BUILD_COMPLEX16),1)
  70. OPENBLAS_NUM_THREADS=2 ./xzcblat1
  71. endif
  72. endif
  73. endif
  74. ifeq ($(BUILD_SINGLE),1)
  75. all2targets += xscblat2
  76. endif
  77. ifeq ($(BUILD_DOUBLE),1)
  78. all2targets += xdcblat2
  79. endif
  80. ifeq ($(BUILD_COMPLEX),1)
  81. all2targets += xccblat2
  82. endif
  83. ifeq ($(BUILD_COMPLEX16),1)
  84. all2targets += xzcblat2
  85. endif
  86. all2: $(all2targets)
  87. ifneq ($(CROSS), 1)
  88. ifeq ($(USE_OPENMP), 1)
  89. ifeq ($(BUILD_SINGLE),1)
  90. OMP_NUM_THREADS=2 ./xscblat2 < sin2
  91. endif
  92. ifeq ($(BUILD_DOUBLE),1)
  93. OMP_NUM_THREADS=2 ./xdcblat2 < din2
  94. endif
  95. ifeq ($(BUILD_COMPLEX),1)
  96. OMP_NUM_THREADS=2 ./xccblat2 < cin2
  97. endif
  98. ifeq ($(BUILD_COMPLEX16),1)
  99. OMP_NUM_THREADS=2 ./xzcblat2 < zin2
  100. endif
  101. else
  102. ifeq ($(BUILD_SINGLE),1)
  103. OPENBLAS_NUM_THREADS=2 ./xscblat2 < sin2
  104. endif
  105. ifeq ($(BUILD_DOUBLE),1)
  106. OPENBLAS_NUM_THREADS=2 ./xdcblat2 < din2
  107. endif
  108. ifeq ($(BUILD_COMPLEX),1)
  109. OPENBLAS_NUM_THREADS=2 ./xccblat2 < cin2
  110. endif
  111. ifeq ($(BUILD_COMPLEX16),1)
  112. OPENBLAS_NUM_THREADS=2 ./xzcblat2 < zin2
  113. endif
  114. endif
  115. endif
  116. ifeq ($(BUILD_SINGLE),1)
  117. all3targets += xscblat3
  118. endif
  119. ifeq ($(BUILD_DOUBLE),1)
  120. all3targets += xdcblat3
  121. endif
  122. ifeq ($(BUILD_COMPLEX),1)
  123. all3targets += xccblat3
  124. endif
  125. ifeq ($(BUILD_COMPLEX16),1)
  126. all3targets += xzcblat3
  127. endif
  128. all3: $(all3targets)
  129. ifneq ($(CROSS), 1)
  130. ifeq ($(USE_OPENMP), 1)
  131. ifeq ($(BUILD_SINGLE),1)
  132. OMP_NUM_THREADS=2 ./xscblat3 < sin3
  133. endif
  134. ifeq ($(BUILD_DOUBLE),1)
  135. OMP_NUM_THREADS=2 ./xdcblat3 < din3
  136. endif
  137. ifeq ($(BUILD_COMPLEX),1)
  138. OMP_NUM_THREADS=2 ./xccblat3 < cin3
  139. endif
  140. ifeq ($(BUILD_COMPLEX16),1)
  141. OMP_NUM_THREADS=2 ./xzcblat3 < zin3
  142. endif
  143. else
  144. ifeq ($(BUILD_SINGLE),1)
  145. OPENBLAS_NUM_THREADS=2 ./xscblat3 < sin3
  146. endif
  147. ifeq ($(BUILD_DOUBLE),1)
  148. OPENBLAS_NUM_THREADS=2 ./xdcblat3 < din3
  149. endif
  150. ifeq ($(BUILD_COMPLEX),1)
  151. OPENBLAS_NUM_THREADS=2 ./xccblat3 < cin3
  152. endif
  153. ifeq ($(BUILD_COMPLEX16),1)
  154. OPENBLAS_NUM_THREADS=2 ./xzcblat3 < zin3
  155. endif
  156. endif
  157. endif
  158. all3_3m: xzcblat3_3m xccblat3_3m
  159. ifeq ($(USE_OPENMP), 1)
  160. ifeq ($(BUILD_SINGLE),1)
  161. OMP_NUM_THREADS=2 ./xccblat3_3m < cin3_3m
  162. endif
  163. ifeq ($(BUILD_COMPLEX16),1)
  164. OMP_NUM_THREADS=2 ./xzcblat3_3m < zin3_3m
  165. endif
  166. else
  167. ifeq ($(BUILD_COMPLEX),1)
  168. OPENBLAS_NUM_THREADS=2 ./xccblat3_3m < cin3_3m
  169. endif
  170. ifeq ($(BUILD_COMPLEX16),1)
  171. OPENBLAS_NUM_THREADS=2 ./xzcblat3_3m < zin3_3m
  172. endif
  173. endif
  174. clean ::
  175. rm -f x*
  176. FLDFLAGS = $(FFLAGS:-fPIC=) $(LDFLAGS)
  177. ifeq ($(USE_OPENMP), 1)
  178. ifeq ($(F_COMPILER), GFORTRAN)
  179. ifeq ($(C_COMPILER), CLANG)
  180. CEXTRALIB = -lomp
  181. endif
  182. endif
  183. ifeq ($(F_COMPILER), NAG)
  184. CEXTRALIB = -lgomp
  185. endif
  186. endif
  187. ifeq ($(BUILD_SINGLE),1)
  188. # Single real
  189. xscblat1: $(stestl1o) c_sblat1.o $(TOPDIR)/$(LIBNAME)
  190. $(FC) $(FLDFLAGS) -o xscblat1 c_sblat1.o $(stestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  191. xscblat2: $(stestl2o) c_sblat2.o $(TOPDIR)/$(LIBNAME)
  192. $(FC) $(FLDFLAGS) -o xscblat2 c_sblat2.o $(stestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  193. xscblat3: $(stestl3o) c_sblat3.o $(TOPDIR)/$(LIBNAME)
  194. $(FC) $(FLDFLAGS) -o xscblat3 c_sblat3.o $(stestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  195. endif
  196. ifeq ($(BUILD_DOUBLE),1)
  197. # Double real
  198. xdcblat1: $(dtestl1o) c_dblat1.o $(TOPDIR)/$(LIBNAME)
  199. $(FC) $(FLDFLAGS) -o xdcblat1 c_dblat1.o $(dtestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  200. xdcblat2: $(dtestl2o) c_dblat2.o $(TOPDIR)/$(LIBNAME)
  201. $(FC) $(FLDFLAGS) -o xdcblat2 c_dblat2.o $(dtestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  202. xdcblat3: $(dtestl3o) c_dblat3.o $(TOPDIR)/$(LIBNAME)
  203. $(FC) $(FLDFLAGS) -o xdcblat3 c_dblat3.o $(dtestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  204. endif
  205. ifeq ($(BUILD_COMPLEX),1)
  206. # Single complex
  207. xccblat1: $(ctestl1o) c_cblat1.o $(TOPDIR)/$(LIBNAME)
  208. $(FC) $(FLDFLAGS) -o xccblat1 c_cblat1.o $(ctestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  209. xccblat2: $(ctestl2o) c_cblat2.o $(TOPDIR)/$(LIBNAME)
  210. $(FC) $(FLDFLAGS) -o xccblat2 c_cblat2.o $(ctestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  211. xccblat3: $(ctestl3o) c_cblat3.o $(TOPDIR)/$(LIBNAME)
  212. $(FC) $(FLDFLAGS) -o xccblat3 c_cblat3.o $(ctestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  213. xccblat3_3m: $(ctestl3o_3m) c_cblat3_3m.o $(TOPDIR)/$(LIBNAME)
  214. $(FC) $(FLDFLAGS) -o xccblat3_3m c_cblat3_3m.o $(ctestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  215. endif
  216. ifeq ($(BUILD_COMPLEX16),1)
  217. # Double complex
  218. xzcblat1: $(ztestl1o) c_zblat1.o $(TOPDIR)/$(LIBNAME)
  219. $(FC) $(FLDFLAGS) -o xzcblat1 c_zblat1.o $(ztestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  220. xzcblat2: $(ztestl2o) c_zblat2.o $(TOPDIR)/$(LIBNAME)
  221. $(FC) $(FLDFLAGS) -o xzcblat2 c_zblat2.o $(ztestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  222. xzcblat3: $(ztestl3o) c_zblat3.o $(TOPDIR)/$(LIBNAME)
  223. $(FC) $(FLDFLAGS) -o xzcblat3 c_zblat3.o $(ztestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  224. xzcblat3_3m: $(ztestl3o_3m) c_zblat3_3m.o $(TOPDIR)/$(LIBNAME)
  225. $(FC) $(FLDFLAGS) -o xzcblat3_3m c_zblat3_3m.o $(ztestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
  226. endif
  227. include $(TOPDIR)/Makefile.tail