|
|
2c4cfd |
OBJCOPY = objcopy
|
|
|
2c4cfd |
|
|
|
2c4cfd |
ifndef SYMBOLSUFFIX
|
|
|
2c4cfd |
SYMBOLSUFFIX =
|
|
|
2c4cfd |
endif
|
|
|
2c4cfd |
|
|
|
2c4cfd |
clean:
|
|
|
2c4cfd |
rm -f *.o libcblas.a libcblas.so*
|
|
|
2c4cfd |
|
|
|
2c4cfd |
ERRHAND= cblas_globals.o cblas_xerbla.o xerbla.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
SLEV1= cblas_srotg.o cblas_srotmg.o cblas_srot.o cblas_srotm.o \
|
|
|
2c4cfd |
cblas_sswap.o cblas_sscal.o cblas_scopy.o cblas_saxpy.o \
|
|
|
2c4cfd |
cblas_sdot.o cblas_sdsdot.o cblas_snrm2.o cblas_sasum.o \
|
|
|
2c4cfd |
cblas_isamax.o sdotsub.o sdsdotsub.o snrm2sub.o sasumsub.o \
|
|
|
2c4cfd |
isamaxsub.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
DLEV1= cblas_drotg.o cblas_drotmg.o cblas_drot.o cblas_drotm.o \
|
|
|
2c4cfd |
cblas_dswap.o cblas_dscal.o cblas_dcopy.o cblas_daxpy.o \
|
|
|
2c4cfd |
cblas_ddot.o cblas_dsdot.o cblas_dnrm2.o cblas_dasum.o \
|
|
|
2c4cfd |
cblas_idamax.o ddotsub.f dsdotsub.o dnrm2sub.o \
|
|
|
2c4cfd |
dasumsub.o idamaxsub.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
CLEV1= cblas_cswap.o cblas_cscal.o cblas_csscal.o cblas_ccopy.o \
|
|
|
2c4cfd |
cblas_caxpy.o cblas_cdotu_sub.o cblas_cdotc_sub.o \
|
|
|
2c4cfd |
cblas_icamax.o cdotcsub.o cdotusub.o icamaxsub.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
ZLEV1= cblas_zswap.o cblas_zscal.o cblas_zdscal.o cblas_zcopy.o \
|
|
|
2c4cfd |
cblas_zaxpy.o cblas_zdotu_sub.o cblas_zdotc_sub.o cblas_dznrm2.o \
|
|
|
2c4cfd |
cblas_dzasum.o cblas_izamax.o zdotcsub.o zdotusub.o \
|
|
|
2c4cfd |
dzasumsub.o dznrm2sub.o izamaxsub.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
SCLEV1= cblas_scasum.o scasumsub.o cblas_scnrm2.o scnrm2sub.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
SLEV2= cblas_sgemv.o cblas_sgbmv.o cblas_sger.o cblas_ssbmv.o cblas_sspmv.o \
|
|
|
2c4cfd |
cblas_sspr.o cblas_sspr2.o cblas_ssymv.o cblas_ssyr.o cblas_ssyr2.o \
|
|
|
2c4cfd |
cblas_stbmv.o cblas_stbsv.o cblas_stpmv.o cblas_stpsv.o cblas_strmv.o \
|
|
|
2c4cfd |
cblas_strsv.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
DLEV2= cblas_dgemv.o cblas_dgbmv.o cblas_dger.o cblas_dsbmv.o cblas_dspmv.o \
|
|
|
2c4cfd |
cblas_dspr.o cblas_dspr2.o cblas_dsymv.o cblas_dsyr.o cblas_dsyr2.o \
|
|
|
2c4cfd |
cblas_dtbmv.o cblas_dtbsv.o cblas_dtpmv.o cblas_dtpsv.o cblas_dtrmv.o \
|
|
|
2c4cfd |
cblas_dtrsv.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
CLEV2= cblas_cgemv.o cblas_cgbmv.o cblas_chemv.o cblas_chbmv.o cblas_chpmv.o \
|
|
|
2c4cfd |
cblas_ctrmv.o cblas_ctbmv.o cblas_ctpmv.o cblas_ctrsv.o cblas_ctbsv.o \
|
|
|
2c4cfd |
cblas_ctpsv.o cblas_cgeru.o cblas_cgerc.o cblas_cher.o cblas_cher2.o \
|
|
|
2c4cfd |
cblas_chpr.o cblas_chpr2.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
ZLEV2= cblas_zgemv.o cblas_zgbmv.o cblas_zhemv.o cblas_zhbmv.o cblas_zhpmv.o \
|
|
|
2c4cfd |
cblas_ztrmv.o cblas_ztbmv.o cblas_ztpmv.o cblas_ztrsv.o cblas_ztbsv.o \
|
|
|
2c4cfd |
cblas_ztpsv.o cblas_zgeru.o cblas_zgerc.o cblas_zher.o cblas_zher2.o \
|
|
|
2c4cfd |
cblas_zhpr.o cblas_zhpr2.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
SLEV3= cblas_sgemm.o cblas_ssymm.o cblas_ssyrk.o cblas_ssyr2k.o cblas_strmm.o \
|
|
|
2c4cfd |
cblas_strsm.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
DLEV3= cblas_dgemm.o cblas_dsymm.o cblas_dsyrk.o cblas_dsyr2k.o cblas_dtrmm.o \
|
|
|
2c4cfd |
cblas_dtrsm.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
CLEV3= cblas_cgemm.o cblas_csymm.o cblas_chemm.o cblas_cherk.o \
|
|
|
2c4cfd |
cblas_cher2k.o cblas_ctrmm.o cblas_ctrsm.o cblas_csyrk.o \
|
|
|
2c4cfd |
cblas_csyr2k.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
ZLEV3= cblas_zgemm.o cblas_zsymm.o cblas_zhemm.o cblas_zherk.o \
|
|
|
2c4cfd |
cblas_zher2k.o cblas_ztrmm.o cblas_ztrsm.o cblas_zsyrk.o \
|
|
|
2c4cfd |
cblas_zsyr2k.o
|
|
|
2c4cfd |
|
|
|
2c4cfd |
OBJS= $(SLEV1) $(DLEV1) $(CLEV1) $(ZLEV1) $(SCLEV1) $(SLEV2) $(DLEV2) $(CLEV2) \
|
|
|
2c4cfd |
$(ZLEV2) $(SLEV3) $(DLEV3) $(CLEV3) $(ZLEV3) $(ERRHAND)
|
|
|
2c4cfd |
|
|
|
2c4cfd |
static: $(OBJS)
|
|
|
2c4cfd |
ifeq "$(SYMBOLSUFFIX)" ""
|
|
|
2c4cfd |
ar ruv libcblas.a $(OBJS)
|
|
|
2c4cfd |
ranlib libcblas.a
|
|
|
2c4cfd |
else
|
|
|
2c4cfd |
ar ruv libcblas$(SYMBOLSUFFIX).a $(OBJS)
|
|
|
2c4cfd |
ranlib libcblas$(SYMBOLSUFFIX).a
|
|
|
2c4cfd |
for i in `nm libcblas$(SYMBOLSUFFIX).a |grep " T " | awk '{print $$3}'`; do echo "$$i" "64_$$i"; done > cblas-static-prefix.def.dirty
|
|
|
2c4cfd |
sort -n cblas-static-prefix.def.dirty | uniq > cblas-static-prefix.def
|
|
|
2c4cfd |
$(OBJCOPY) --redefine-syms cblas-static-prefix.def libcblas$(SYMBOLSUFFIX).a libcblas$(SYMBOLSUFFIX).a.fixed
|
|
|
2c4cfd |
rm -rf libcblas$(SYMBOLSUFFIX).a
|
|
|
2c4cfd |
mv libcblas$(SYMBOLSUFFIX).a.fixed libcblas$(SYMBOLSUFFIX).a
|
|
|
2c4cfd |
endif
|
|
|
2c4cfd |
|
|
|
2c4cfd |
shared: $(OBJS)
|
|
|
2c4cfd |
ifeq "$(SYMBOLSUFFIX)" ""
|
|
|
2c4cfd |
# No renaming needed
|
|
|
2c4cfd |
cc $(CFLAGS) -shared -Wl,-soname,libcblas.so.@SHORTVER@ -o libcblas.so.@LONGVER@ $(OBJS) $(LDFLAGS) -L../../ -lblas -lm -lgfortran -lc
|
|
|
2c4cfd |
else
|
|
|
2c4cfd |
cc $(CFLAGS) -shared -Wl,-soname,libcblas$(SYMBOLSUFFIX).so.@SHORTVER@ -o libcblas$(SYMBOLSUFFIX).so.@LONGVER@ $(OBJS) $(LDFLAGS) -L../.. -lblas -lm -lgfortran -lc
|
|
|
2c4cfd |
# generate a list of all symbols in shared library and rename with SYMBOLSUFFIX
|
|
|
2c4cfd |
for i in `readelf -Ws libcblas$(SYMBOLSUFFIX).so.@LONGVER@ | awk '{print $$8}' | grep -v GLIBC |grep -v GFORTRAN |grep -v "Name" `; do echo "$$i" "64_$$i"; done > cblas-prefix.def.dirty
|
|
|
2c4cfd |
sort -n cblas-prefix.def.dirty | uniq > cblas-prefix.def
|
|
|
2c4cfd |
$(OBJCOPY) --redefine-syms cblas-prefix.def libcblas$(SYMBOLSUFFIX).so.@LONGVER@ libcblas$(SYMBOLSUFFIX).so.@LONGVER@.fixed
|
|
|
2c4cfd |
rm -rf libcblas$(SYMBOLSUFFIX).so.@LONGVER@
|
|
|
2c4cfd |
mv libcblas$(SYMBOLSUFFIX).so.@LONGVER@.fixed libcblas$(SYMBOLSUFFIX).so.@LONGVER@
|
|
|
2c4cfd |
endif
|
|
|
2c4cfd |
|