how to compile the refblas as a shared library (dynamically linked library)
I tried the following method but failed, anyone knows why?
BTW, I successfully compiled lapack as a shared library use a similar
procedure
In make.inc, I added
NOOPT = -fPIC
In Makefile, I appended libblas.so to the "all:..." (line 58)
all: $(BLASLIB) libblas.so
and right below the part
$(BLASLIB): $(ALLOBJ)
$(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ)
$(RANLIB) $@
I added:
libblas.so: $(ALLOBJ)
cc -shared -Wl,-soname,libblas.so -o libblas.so $(ALLOBJ)
but I got following error messages:
isamax.o: In function `isamax_':
isamax.f:(.text+0x0): multiple definition of `isamax_'
isamax.o:isamax.f:(.text+0x0): first defined here
sasum.o: In function `sasum_':
sasum.f:(.text+0x0): multiple definition of `sasum_'
sasum.o:sasum.f:(.text+0x0): first defined here
saxpy.o: In function `saxpy_':
saxpy.f:(.text+0x0): multiple definition of `saxpy_'
saxpy.o:saxpy.f:(.text+0x0): first defined here
scopy.o: In function `scopy_':
scopy.f:(.text+0x0): multiple definition of `scopy_'
scopy.o:scopy.f:(.text+0x0): first defined here
snrm2.o: In function `snrm2_':
snrm2.f:(.text+0x0): multiple definition of `snrm2_'
snrm2.o:snrm2.f:(.text+0x0): first defined here
sscal.o: In function `sscal_':
sscal.f:(.text+0x0): multiple definition of `sscal_'
sscal.o:sscal.f:(.text+0x0): first defined here
idamax.o: In function `idamax_':
idamax.f:(.text+0x0): multiple definition of `idamax_'
idamax.o:idamax.f:(.text+0x0): first defined here
dasum.o: In function `dasum_':
dasum.f:(.text+0x0): multiple definition of `dasum_'
dasum.o:dasum.f:(.text+0x0): first defined here
daxpy.o: In function `daxpy_':
daxpy.f:(.text+0x0): multiple definition of `daxpy_'
daxpy.o:daxpy.f:(.text+0x0): first defined here
dcopy.o: In function `dcopy_':
dcopy.f:(.text+0x0): multiple definition of `dcopy_'
dcopy.o:dcopy.f:(.text+0x0): first defined here
dnrm2.o: In function `dnrm2_':
dnrm2.f:(.text+0x0): multiple definition of `dnrm2_'
dnrm2.o:dnrm2.f:(.text+0x0): first defined here
dscal.o: In function `dscal_':
dscal.f:(.text+0x0): multiple definition of `dscal_'
dscal.o:dscal.f:(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [libblas.so] Error 1
I hope get some hint here,
thanks in advance
Xiaoyong