forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move each dep into its own Makefile (JuliaLang#16504)
- Loading branch information
Showing
22 changed files
with
1,899 additions
and
1,908 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
## ARPACK ## | ||
ARPACK_FFLAGS := $(GFORTBLAS_FFLAGS) | ||
ARPACK_CFLAGS := | ||
|
||
ifeq ($(USE_BLAS64), 1) | ||
ARPACK_CFLAGS += -DBLASINT=int64_t | ||
ifneq ($(USEIFC),1) | ||
ifeq ($(USE_SYSTEM_BLAS), 0) | ||
ifeq ($(OPENBLAS_SYMBOLSUFFIX), 64_) | ||
ARPACK_FFLAGS += -cpp -ffixed-line-length-none | ||
ARPACK_OPENBLASFCNS1 := axpy copy gemv geqr2 lacpy lahqr lanhs larnv lartg lascl laset scal trevc trmm trsen gbmv gbtrf gbtrs gttrf gttrs pttrf pttrs | ||
ARPACK_OPENBLASFCNS2 := dot ger labad laev2 lamch lanst lanv2 lapy2 larf larfg lasr nrm2 orm2r rot steqr swap | ||
ARPACK_OPENBLASFCNS3 := dotc geru unm2r | ||
ARPACK_OPENBLASFCNS4 := COPY LABAD LAMCH LANHS LANV2 LARFG ROT GEMV | ||
ARPACK_FFLAGS += $(foreach fcn, $(ARPACK_OPENBLASFCNS1) $(ARPACK_OPENBLASFCNS2), -Ds$(fcn)=s$(fcn)_64 -Dd$(fcn)=d$(fcn)_64) | ||
ARPACK_FFLAGS += $(foreach fcn, $(ARPACK_OPENBLASFCNS1) $(ARPACK_OPENBLASFCNS3), -Dc$(fcn)=c$(fcn)_64 -Dz$(fcn)=z$(fcn)_64) | ||
ARPACK_FFLAGS += $(foreach fcn, $(ARPACK_OPENBLASFCNS4), -DS$(fcn)=S$(fcn)_64 -DD$(fcn)=D$(fcn)_64) | ||
ARPACK_FFLAGS += -Dscnrm2=scnrm2_64 -Ddznrm2=dznrm2_64 -Dcsscal=csscal_64 -Dzdscal=zdscal_64 | ||
# CFLAGS are for the configure checks | ||
ARPACK_CFLAGS += -Dsgemm_=sgemm_64_ -Dcheev_=cheev_64_ | ||
endif | ||
endif | ||
endif | ||
endif | ||
|
||
ifeq ($(OS),WINNT) | ||
ARPACK_OBJ_SOURCE := $(BUILDDIR)/arpack-ng-$(ARPACK_VER)/.libs/libarpack-2.$(SHLIB_EXT) | ||
else | ||
ARPACK_OBJ_SOURCE := $(BUILDDIR)/arpack-ng-$(ARPACK_VER)/.libs/libarpack.$(SHLIB_EXT) | ||
endif | ||
ARPACK_OBJ_TARGET := $(build_shlibdir)/libarpack.$(SHLIB_EXT) | ||
|
||
ARPACK_MFLAGS := F77="$(FC)" MPIF77="$(FC)" | ||
ARPACK_FFLAGS += $(FFLAGS) $(JFFLAGS) | ||
ARPACK_FLAGS := --with-blas="$(LIBBLAS)" --with-lapack="$(LIBLAPACK)" --disable-mpi --enable-shared FFLAGS="$(ARPACK_FFLAGS)" CFLAGS="$(CFLAGS) $(ARPACK_CFLAGS)" | ||
ifneq ($(OS),WINNT) | ||
ARPACK_FLAGS += LDFLAGS="$(LDFLAGS) -Wl,-rpath,'$(build_libdir)'" | ||
endif | ||
|
||
# ARPACK-NG upstream keeps changing their download filenames | ||
$(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER).tar.gz: | $(SRCDIR)/srccache | ||
$(JLDOWNLOAD) $@ https://s3.amazonaws.com/julialang/src/arpack-ng-$(ARPACK_VER).tar.gz | ||
touch -c $@ | ||
$(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)-testA.mtx: | $(SRCDIR)/srccache | ||
$(JLDOWNLOAD) $@ https://raw.githubusercontent.com/opencollab/arpack-ng/$(ARPACK_VER)/TESTS/testA.mtx | ||
touch -c $@ | ||
$(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)/configure: $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER).tar.gz | ||
$(JLCHECKSUM) $< | ||
cd $(dir $<) && $(TAR) zxf $< | ||
touch -c $@ | ||
|
||
ifeq ($(USE_ATLAS), 1) | ||
$(BUILDDIR)/arpack-ng-$(ARPACK_VER)/config.status: | $(ATLAS_OBJ_TARGET) | ||
endif | ||
|
||
ifeq ($(USE_SYSTEM_BLAS), 0) | ||
$(BUILDDIR)/arpack-ng-$(ARPACK_VER)/config.status: | $(OPENBLAS_OBJ_TARGET) | ||
else ifeq ($(USE_SYSTEM_LAPACK), 0) | ||
$(BUILDDIR)/arpack-ng-$(ARPACK_VER)/config.status: | $(LAPACK_OBJ_TARGET) | ||
endif | ||
|
||
$(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)/arpack-tests-blasint.patch-applied: $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)/configure | ||
cd $(dir $@) && patch -p1 < $(SRCDIR)/arpack-tests-blasint.patch | ||
echo 1 > $@ | ||
$(BUILDDIR)/arpack-ng-$(ARPACK_VER)/config.status: $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)/configure $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)/arpack-tests-blasint.patch-applied | ||
mkdir -p $(dir $@) | ||
cd $(dir $@) && \ | ||
$< $(CONFIGURE_COMMON) $(ARPACK_FLAGS) | ||
touch -c $@ | ||
$(ARPACK_OBJ_SOURCE): $(BUILDDIR)/arpack-ng-$(ARPACK_VER)/config.status | ||
$(MAKE) -C $(dir $<) $(ARPACK_MFLAGS) | ||
touch -c $@ | ||
$(BUILDDIR)/arpack-ng-$(ARPACK_VER)/checked: $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)-testA.mtx $(ARPACK_OBJ_SOURCE) | ||
$(JLCHECKSUM) $< | ||
cp $< $(dir $@)/TESTS/testA.mtx | ||
ifeq ($(OS),$(BUILD_OS)) | ||
$(MAKE) -C $(dir $@) check $(ARPACK_MFLAGS) | ||
endif | ||
echo 1 > $@ | ||
$(ARPACK_OBJ_TARGET): $(ARPACK_OBJ_SOURCE) | $(build_shlibdir) | ||
$(call make-install,arpack-ng-$(ARPACK_VER),$(ARPACK_MFLAGS)) | ||
ifeq ($(OS), WINNT) | ||
mv $(build_shlibdir)/libarpack-2.dll $@ | ||
endif | ||
$(INSTALL_NAME_CMD)libarpack.$(SHLIB_EXT) $(build_shlibdir)/libarpack.$(SHLIB_EXT) | ||
ifeq ($(OS), Linux) | ||
for filename in $(build_shlibdir)/libarpack.so* ; do \ | ||
[ -L $$filename ] || $(PATCHELF_BIN) --set-rpath '$$ORIGIN' $$filename ;\ | ||
done | ||
endif | ||
touch -c $@ | ||
ifneq ($(PATCHELF),patchelf) | ||
$(ARPACK_OBJ_TARGET): $(PATCHELF) | ||
endif | ||
|
||
clean-arpack: | ||
-$(MAKE) -C $(BUILDDIR)/arpack-ng-$(ARPACK_VER) clean | ||
-rm -f $(ARPACK_OBJ_SOURCE) $(ARPACK_OBJ_TARGET) | ||
distclean-arpack: | ||
-rm -rf $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER).tar.gz \ | ||
$(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER) \ | ||
$(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)-testA.mtx \ | ||
$(BUILDDIR)/arpack-ng-$(ARPACK_VER) | ||
|
||
get-arpack: $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER).tar.gz $(SRCDIR)/srccache/arpack-ng-$(ARPACK_VER)-testA.mtx | ||
configure-arpack: $(BUILDDIR)/arpack-ng-$(ARPACK_VER)/config.status | ||
compile-arpack: $(ARPACK_OBJ_SOURCE) | ||
check-arpack: $(BUILDDIR)/arpack-ng-$(ARPACK_VER)/checked | ||
install-arpack: $(ARPACK_OBJ_TARGET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
## OpenBLAS ## | ||
# LAPACK is built into OpenBLAS by default | ||
OPENBLAS_GIT_URL := git://github.com/xianyi/OpenBLAS.git | ||
OPENBLAS_TAR_URL = https://api.github.com/repos/xianyi/OpenBLAS/tarball/$1 | ||
$(eval $(call git-external,openblas,OPENBLAS,Makefile,$(LIBBLASNAME).$(SHLIB_EXT),$(BUILDDIR))) | ||
|
||
OPENBLAS_OBJ_SOURCE := $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/$(LIBBLASNAME).$(SHLIB_EXT) | ||
OPENBLAS_OBJ_TARGET := $(build_shlibdir)/$(LIBBLASNAME).$(SHLIB_EXT) | ||
OPENBLAS_BUILD_OPTS := CC="$(CC)" FC="$(FC)" RANLIB="$(RANLIB)" FFLAGS="$(FFLAGS) $(JFFLAGS)" TARGET=$(OPENBLAS_TARGET_ARCH) BINARY=$(BINARY) | ||
|
||
# Thread support | ||
ifeq ($(OPENBLAS_USE_THREAD), 1) | ||
OPENBLAS_BUILD_OPTS += USE_THREAD=1 | ||
OPENBLAS_BUILD_OPTS += GEMM_MULTITHREADING_THRESHOLD=50 | ||
# Maximum number of threads for parallelism | ||
ifneq ($(ARCH),x86_64) | ||
# Assume we can't address much memory to spawn many threads | ||
# It is also unlikely that 32-bit architectures have too many cores | ||
OPENBLAS_BUILD_OPTS += NUM_THREADS=8 | ||
else ifeq ($(OS),WINNT) | ||
# Windows seems unable to handle very many | ||
OPENBLAS_BUILD_OPTS += NUM_THREADS=16 | ||
else ifeq ($(OS),Darwin) | ||
# This should suffice for the largest macs | ||
OPENBLAS_BUILD_OPTS += NUM_THREADS=16 | ||
else | ||
# On linux, try to provision for the largest possible machine currently | ||
OPENBLAS_BUILD_OPTS += NUM_THREADS=16 | ||
endif | ||
else | ||
OPENBLAS_BUILD_OPTS += USE_THREAD=0 | ||
endif | ||
|
||
# don't touch scheduler affinity since we manage this ourselves | ||
OPENBLAS_BUILD_OPTS += NO_AFFINITY=1 | ||
|
||
# Build for all architectures - required for distribution | ||
ifeq ($(OPENBLAS_DYNAMIC_ARCH), 1) | ||
OPENBLAS_BUILD_OPTS += DYNAMIC_ARCH=1 | ||
endif | ||
|
||
# 64-bit BLAS interface | ||
ifeq ($(USE_BLAS64), 1) | ||
OPENBLAS_BUILD_OPTS += INTERFACE64=1 SYMBOLSUFFIX="$(OPENBLAS_SYMBOLSUFFIX)" LIBPREFIX="$(LIBBLASNAME)" | ||
ifeq ($(OS), Darwin) | ||
OPENBLAS_BUILD_OPTS += OBJCONV=$(abspath $(BUILDDIR)/objconv/objconv) | ||
$(OPENBLAS_OBJ_SOURCE): $(OBJCONV_SOURCE) | ||
endif | ||
endif | ||
|
||
# Decide whether to build for 32-bit or 64-bit arch | ||
ifneq ($(BUILD_OS),$(OS)) | ||
OPENBLAS_BUILD_OPTS += OSNAME=$(OS) CROSS=1 HOSTCC=$(HOSTCC) | ||
endif | ||
ifeq ($(OS),WINNT) | ||
ifneq ($(ARCH),x86_64) | ||
OPENBLAS_BUILD_OPTS += CFLAGS="$(CFLAGS) -mincoming-stack-boundary=2" | ||
OPENBLAS_BUILD_OPTS += FFLAGS="$(FFLAGS) -mincoming-stack-boundary=2" | ||
endif | ||
endif | ||
|
||
# Debug OpenBLAS | ||
ifeq ($(OPENBLAS_DEBUG), 1) | ||
OPENBLAS_BUILD_OPTS += DEBUG=1 | ||
endif | ||
|
||
# Allow disabling AVX for older binutils | ||
ifeq ($(OPENBLAS_NO_AVX), 1) | ||
OPENBLAS_BUILD_OPTS += NO_AVX=1 NO_AVX2=1 | ||
else ifeq ($(OPENBLAS_NO_AVX2), 1) | ||
OPENBLAS_BUILD_OPTS += NO_AVX2=1 | ||
endif | ||
|
||
# Do not overwrite the "-j" flag | ||
OPENBLAS_BUILD_OPTS += MAKE_NB_JOBS=0 | ||
|
||
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/config.status: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/Makefile | ||
perl -i -ple 's/^\s*(EXTRALIB\s*\+=\s*-lSystemStubs)\s*$$/# $$1/g' $<.system | ||
touch $@ | ||
$(OPENBLAS_OBJ_SOURCE): $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/config.status | ||
echo $(MAKE) -C $(dir $<) $(OPENBLAS_BUILD_OPTS) # echo first, so we only print the error message below in a failure case | ||
@$(MAKE) -C $(dir $<) $(OPENBLAS_BUILD_OPTS) || (echo $(WARNCOLOR)"*** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild with 'make OPENBLAS_USE_THREAD=0' if OpenBLAS had trouble linking libpthread.so, and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were errors building SandyBridge support. Both these options can also be used simultaneously. ***"$(ENDCOLOR) && false) | ||
touch -c $@ | ||
ifneq ($(USE_SYSTEM_BLAS),1) | ||
$(OPENBLAS_OBJ_TARGET): $(OPENBLAS_OBJ_SOURCE) | $(build_shlibdir) | ||
cp -f $< $@ | ||
ifeq ($(OS), Linux) | ||
cd $(dir $@) && \ | ||
ln -sf $(LIBBLASNAME).$(SHLIB_EXT) $(LIBBLASNAME).$(SHLIB_EXT).0 | ||
endif | ||
$(INSTALL_NAME_CMD)$(LIBBLASNAME).$(SHLIB_EXT) $@ | ||
endif | ||
|
||
clean-openblas: | ||
-$(MAKE) -C $(BUILDDIR)/$(OPENBLAS_SRC_DIR) clean | ||
|
||
get-openblas: $(OPENBLAS_SRC_FILE) | ||
configure-openblas: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/config.status | ||
compile-openblas: $(OPENBLAS_OBJ_SOURCE) | ||
check-openblas: compile-openblas | ||
install-openblas: $(OPENBLAS_OBJ_TARGET) | ||
|
||
|
||
## ATLAS (currently 3.10.0) ## | ||
|
||
# no threading, with full lapack, shared library | ||
# should always be compiled with (a real) gcc, it's | ||
# configure script will search for the best match | ||
# (gcc 4.7, gcc, clang,ICC/microsoft/others) | ||
ATLAS_OBJ_SOURCE := $(BUILDDIR)/atlas/build/lib/libsatlas.$(SHLIB_EXT) | ||
ATLAS_OBJ_TARGET := $(build_shlibdir)/libsatlas.$(SHLIB_EXT) | ||
ATLAS_FLAGS := --shared --prefix=$(build_prefix) --cc=gcc -t 0 \ | ||
--with-netlib-lapack-tarfile=$(JULIAHOME)/deps/lapack-$(LAPACK_VER).tgz | ||
ifeq ($(OS), WINNT) | ||
ATLAS_FLAGS += -b 32 | ||
endif | ||
|
||
#force backwards compatibility (pick any 1) | ||
#ATLAS_FLAGS += -V 192 -A 13 # requires SSE2 (P4 & later) | ||
#ATLAS_FLAGS += -V 128 -A 12 # requires SSE1 (P3 & later) | ||
#ATLAS_FLAGS += -V -1 -A 11 # any x87 (PentiumPro or Athlon & later) | ||
#ATLAS_FLAGS += -A 25 # requires Corei132 (Corei232 doesn't have definition yet) | ||
|
||
$(SRCDIR)/srccache/atlas/configure: | ||
git clone git://github.com/vtjnash/atlas-3.10.0.git $(SRCDIR)/srccache/atlas | ||
ifeq "$(MAKECMDGOALS)" "compile-atlas" | ||
# only allow building atlas as the sole target (without -jN) | ||
# since it internally handles parallelism, for tuning timing accuracy | ||
$(BUILDDIR)/atlas/Make.top: $(SRCDIR)/srccache/atlas/configure $(SRCDIR)/srccache/lapack-$(LAPACK_VER).tgz | ||
mkdir -p $(dir $@) | ||
cd $(dir $@) && \ | ||
$< $(ATLAS_FLAGS) | ||
touch -c $@ | ||
$(ATLAS_OBJ_SOURCE): $(BUILDDIR)/atlas/Make.top | ||
$(MAKE) -C $(dir $<) -j1 | ||
touch -c $@ | ||
else | ||
$(ATLAS_OBJ_SOURCE): | ||
$(error cannot build atlas in parallel with anything else) | ||
endif | ||
|
||
$(ATLAS_OBJ_TARGET): $(ATLAS_OBJ_SOURCE) | ||
cp -f $(ATLAS_OBJ_SOURCE) $@ | ||
$(INSTALL_NAME_CMD)libsatlas.$(SHLIB_EXT) $@ | ||
touch -c $@ | ||
|
||
clean-atlas: | ||
rm -rf $(BUILDDIR)/atlas/build | ||
distclean-atlas: | ||
rm -rf $(BUILDDIR)/atlas | ||
|
||
get-atlas: $(SRCDIR)/srccache/atlas/configure $(SRCDIR)/srccache/lapack-$(LAPACK_VER).tgz | ||
configure-atlas: $(BUILDDIR)/atlas/Make.top | ||
compile-atlas: $(ATLAS_OBJ_SOURCE) | ||
check-atlas: compile-atlas | ||
install-atlas: $(ATLAS_OBJ_TARGET) | ||
|
||
## Mac gfortran BLAS wrapper ## | ||
GFORTBLAS_FFLAGS := | ||
ifeq ($(USE_BLAS64), 1) | ||
ifeq ($(USEIFC),1) | ||
GFORTBLAS_FFLAGS += -i8 | ||
else | ||
GFORTBLAS_FFLAGS += -fdefault-integer-8 | ||
endif | ||
endif | ||
ifeq ($(OS),Darwin) | ||
ifeq ($(USE_SYSTEM_BLAS),1) | ||
ifeq ($(USE_SYSTEM_LAPACK),0) | ||
GFORTBLAS_FFLAGS += -cpp -ffree-line-length-0 -ffixed-line-length-0 \ | ||
-Dsasum=sasum_gfort -Dscasum=scasum_gfort \ | ||
-Dscnrm2=scnrm2_gfort -Dsdot=sdot_gfort \ | ||
-Dsdsdot=sdsdot_gfort -Dsnrm2=snrm2_gfort \ | ||
-Dcdotc=cdotc_gfort -Dcdotu=cdotu_gfort \ | ||
-Dzdotc=zdotc_gfort -Dzdotu=zdotu_gfort \ | ||
\ | ||
-DSASUM=SASUM_GFORT -DSCASUM=SCASUM_GFORT \ | ||
-DSCNRM2=SCNRM2_GFORT -DSDOT=SDOT_GFORT \ | ||
-DSDSDOT=SDSDOT_GFORT -DSNRM2=SNRM2_GFORT \ | ||
-DCDOTC=CDOTC_GFORT -DCDOTU=CDOTU_GFORT \ | ||
-DZDOTC=ZDOTC_GFORT -DZDOTU=ZDOTU_GFORT | ||
endif | ||
endif | ||
|
||
$(BUILDDIR)/libgfortblas.$(SHLIB_EXT): $(SRCDIR)/gfortblas.c $(SRCDIR)/gfortblas.alias | ||
$(CC) -Wall -O3 $(CPPFLAGS) $(CFLAGS) $(fPIC) -shared $< -o $@ -pipe \ | ||
-Wl,-reexport_framework,Accelerate -Wl,-alias_list,$(SRCDIR)/gfortblas.alias | ||
$(build_shlibdir)/libgfortblas.$(SHLIB_EXT): $(BUILDDIR)/libgfortblas.$(SHLIB_EXT) | ||
cp -f $< $@ | ||
$(INSTALL_NAME_CMD)libgfortblas.$(SHLIB_EXT) $@ | ||
endif | ||
|
||
## LAPACK ## | ||
|
||
ifeq ($(USE_SYSTEM_LAPACK), 0) | ||
LAPACK_OBJ_TARGET := $(build_shlibdir)/liblapack.$(SHLIB_EXT) | ||
LAPACK_OBJ_SOURCE := $(BUILDDIR)/lapack-$(LAPACK_VER)/liblapack.$(SHLIB_EXT) | ||
else | ||
LAPACK_OBJ_TARGET := | ||
LAPACK_OBJ_SOURCE := | ||
endif | ||
|
||
LAPACK_MFLAGS := NOOPT="$(FFLAGS) $(JFFLAGS) $(GFORTBLAS_FFLAGS) -O0" OPTS="$(FFLAGS) $(JFFLAGS) $(GFORTBLAS_FFLAGS)" FORTRAN="$(FC)" LOADER="$(FC)" | ||
ifneq ($(OS),WINNT) | ||
LAPACK_MFLAGS += BLASLIB="-Wl,-rpath,'$(build_libdir)' $(LIBBLAS)" | ||
endif | ||
|
||
$(SRCDIR)/srccache/lapack-$(LAPACK_VER).tgz: | $(SRCDIR)/srccache | ||
$(JLDOWNLOAD) $@ http://www.netlib.org/lapack/$(notdir $@) | ||
$(BUILDDIR)/lapack-$(LAPACK_VER)/make.inc: $(SRCDIR)/srccache/lapack-$(LAPACK_VER).tgz | ||
$(JLCHECKSUM) $< | ||
cd $(BUILDDIR) && $(TAR) zxf $< | ||
cp $(dir $@)INSTALL/make.inc.gfortran $(dir $@)make.inc | ||
touch -c $@ | ||
ifeq ($(USE_SYSTEM_BLAS), 0) | ||
$(BUILDDIR)/lapack-$(LAPACK_VER)/liblapack.a: | $(OPENBLAS_OBJ_TARGET) | ||
else ifeq ($(OS),Darwin) | ||
$(BUILDDIR)/lapack-$(LAPACK_VER)/liblapack.a: | $(build_shlibdir)/libgfortblas.$(SHLIB_EXT) | ||
endif | ||
$(BUILDDIR)/lapack-$(LAPACK_VER)/liblapack.a: $(BUILDDIR)/lapack-$(LAPACK_VER)/make.inc | ||
$(MAKE) -C $(dir $@) lapacklib $(LAPACK_MFLAGS) | ||
touch -c $@ | ||
$(BUILDDIR)/lapack-$(LAPACK_VER)/checked: $(BUILDDIR)/lapack-$(LAPACK_VER)/liblapack.a | ||
ifeq ($(BUILD_OS),$(OS)) | ||
$(MAKE) -C $(dir $@) lapack_testing $(LAPACK_MFLAGS) -k | ||
endif | ||
touch $@ | ||
$(LAPACK_OBJ_SOURCE): $(BUILDDIR)/lapack-$(LAPACK_VER)/liblapack.a | ||
$(FC) -shared $(FFLAGS) $(JFFLAGS) $(dir $<)/SRC/*.o $(dir $<)/INSTALL/dlamch.o $(dir $<)/INSTALL/dsecnd_INT_ETIME.o $(dir $<)/INSTALL/ilaver.o $(dir $<)/INSTALL/slamch.o $(LIBBLAS) -o $@ | ||
$(LAPACK_OBJ_TARGET): $(LAPACK_OBJ_SOURCE) | ||
cp $< $@ | ||
$(INSTALL_NAME_CMD)liblapack.$(SHLIB_EXT) $@ | ||
|
||
clean-lapack: | ||
-$(MAKE) -C $(BUILDDIR)/lapack-$(LAPACK_VER) clean | ||
-rm -f $(LAPACK_OBJ_SOURCE) $(LAPACK_OBJ_TARGET) | ||
distclean-lapack: | ||
-rm -rf $(SRCDIR)/srccache/lapack-$(LAPACK_VER).tgz $(BUILDDIR)/lapack-$(LAPACK_VER) | ||
|
||
get-lapack: $(SRCDIR)/srccache/lapack-$(LAPACK_VER).tgz | ||
configure-lapack: $(BUILDDIR)/lapack-$(LAPACK_VER)/make.inc | ||
compile-lapack: $(LAPACK_OBJ_SOURCE) | ||
check-lapack: $(BUILDDIR)/lapack-$(LAPACK_VER)/checked | ||
install-lapack: $(LAPACK_OBJ_TARGET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
## DSFMT ## | ||
|
||
DSFMT_OBJ_TARGET := $(build_shlibdir)/libdSFMT.$(SHLIB_EXT) $(build_includedir)/dSFMT.h | ||
DSFMT_OBJ_SOURCE := $(BUILDDIR)/dsfmt-$(DSFMT_VER)/libdSFMT.$(SHLIB_EXT) | ||
|
||
DSFMT_CFLAGS := $(CFLAGS) -DNDEBUG -DDSFMT_MEXP=19937 $(fPIC) -DDSFMT_DO_NOT_USE_OLD_NAMES | ||
ifneq ($(USEMSVC), 1) | ||
DSFMT_CFLAGS += -O3 -finline-functions -fomit-frame-pointer -fno-strict-aliasing \ | ||
--param max-inline-insns-single=1800 -Wmissing-prototypes -Wall -std=c99 -shared | ||
else | ||
DSFMT_CFLAGS += -Wl,-dll,-def:../../libdSFMT.def | ||
endif | ||
ifeq ($(ARCH), x86_64) | ||
DSFMT_CFLAGS += -msse2 -DHAVE_SSE2 | ||
endif | ||
|
||
$(SRCDIR)/srccache/dsfmt-$(DSFMT_VER).tar.gz: | $(SRCDIR)/srccache | ||
$(JLDOWNLOAD) $@ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-$(DSFMT_VER).tar.gz | ||
touch -c $@ | ||
$(BUILDDIR)/dsfmt-$(DSFMT_VER)/config.status: $(SRCDIR)/srccache/dsfmt-$(DSFMT_VER).tar.gz | ||
$(JLCHECKSUM) $< | ||
mkdir -p $(dir $@) && \ | ||
$(TAR) -C $(dir $@) --strip-components 1 -xf $< && \ | ||
cd $(dir $@) && patch < $(SRCDIR)/dSFMT.h.patch | ||
cd $(dir $@) && patch < $(SRCDIR)/dSFMT.c.patch | ||
echo 1 > $@ | ||
$(DSFMT_OBJ_SOURCE): $(BUILDDIR)/dsfmt-$(DSFMT_VER)/config.status | ||
cd $(dir $<) && \ | ||
$(CC) $(CPPFLAGS) $(DSFMT_CFLAGS) $(LDFLAGS) dSFMT.c -o libdSFMT.$(SHLIB_EXT) | ||
$(build_shlibdir)/libdSFMT%$(SHLIB_EXT) $(build_includedir)/dSFMT%h: $(DSFMT_OBJ_SOURCE) | $(build_includedir) $(build_shlibdir) | ||
cp $(dir $<)/dSFMT.h $(build_includedir) | ||
cp $< $(build_shlibdir)/libdSFMT.$(SHLIB_EXT) && \ | ||
$(INSTALL_NAME_CMD)libdSFMT.$(SHLIB_EXT) $(build_shlibdir)/libdSFMT.$(SHLIB_EXT) | ||
|
||
clean-dsfmt: | ||
-rm -f $(BUILDDIR)/dsfmt-$(DSFMT_VER)/libdSFMT.$(SHLIB_EXT) | ||
distclean-dsfmt: | ||
-rm -rf $(SRCDIR)/srccache/dsfmt*.tar.gz $(SRCDIR)/srccache/dsfmt-$(DSFMT_VER) $(BUILDDIR)/dsfmt-$(DSFMT_VER) | ||
|
||
get-dsfmt: $(SRCDIR)/srccache/dsfmt-$(DSFMT_VER).tar.gz | ||
configure-dsfmt: $(BUILDDIR)/dsfmt-$(DSFMT_VER)/config.status | ||
compile-dsfmt: $(DSFMT_OBJ_SOURCE) | ||
check-dsfmt: compile-dsfmt | ||
install-dsfmt: $(DSFMT_OBJ_TARGET) |
Oops, something went wrong.