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.4 kB

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