Skip to content

Commit

Permalink
switch openblas to a git-external resource
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Apr 13, 2015
1 parent ebe6189 commit 27a823d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 26 deletions.
9 changes: 6 additions & 3 deletions deps/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@
/llvm-*
/lldb-*
/mpfr-*
/openblas-*
/patchelf-*
/pcre-*
!pcre-gcc49-compile.patch
/root
/SuiteSparse-*
/zlib-*
/utf8proc-*
/librandom.*
/virtualenv-*
/julia-env
/objconv*
/Rmath-julia*

# git externals:
# git-externals:
/libuv
/libuv-*
/openblas
/openblas-*
/openlibm
/openlibm-*
/openspecfun
/openspecfun-*
/utf8proc
/utf8proc-*
34 changes: 14 additions & 20 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -946,10 +946,12 @@ install-objconv: $(OBJCONV_TARGET)

## OpenBLAS ##
# LAPACK is built into OpenBLAS by default
OPENBLAS_GIT_URL = git:https://github.com/xianyi/OpenBLAS.git
OPENBLAS_TAR_URL = https://api.github.com/repos/xianyi/OpenBLAS/tarball/$1
$(eval $(call git-external,openblas,OPENBLAS,Makefile,libopenblas.$(SHLIB_EXT)))

OPENBLAS_OBJ_SOURCE = openblas-$(OPENBLAS_VER)/libopenblas.$(SHLIB_EXT)
OPENBLAS_OBJ_SOURCE = $(OPENBLAS_SRC_DIR)/libopenblas.$(SHLIB_EXT)
OPENBLAS_OBJ_TARGET = $(build_shlibdir)/libopenblas.$(SHLIB_EXT)

OPENBLAS_BUILD_OPTS = CC="$(CC)" FC="$(FC)" RANLIB="$(RANLIB)" FFLAGS="$(FFLAGS) $(JFFLAGS)" LDFLAGS="$(LDFLAGS)" TARGET=$(OPENBLAS_TARGET_ARCH) BINARY=$(BINARY)

# Thread support
Expand Down Expand Up @@ -1015,34 +1017,26 @@ else ifeq ($(OPENBLAS_NO_AVX2), 1)
OPENBLAS_BUILD_OPTS += NO_AVX2=1
endif

openblas-$(OPENBLAS_VER).tar.gz:
$(JLDOWNLOAD) $@ https://api.github.com/repos/xianyi/OpenBLAS/tarball/$(OPENBLAS_VER)
openblas-$(OPENBLAS_VER)/config.status: openblas-$(OPENBLAS_VER).tar.gz
ifneq ($(OPENBLAS_VER),develop)
$(JLCHECKSUM) $<
endif
mkdir -p openblas-$(OPENBLAS_VER) && \
$(TAR) -C openblas-$(OPENBLAS_VER) --strip-components 1 -xf $<
perl -i -ple 's/^\s*(EXTRALIB\s*\+=\s*-lSystemStubs)\s*$$/# $$1/g' openblas-$(OPENBLAS_VER)/Makefile.system
echo 1 > $@
$(OPENBLAS_OBJ_SOURCE): openblas-$(OPENBLAS_VER)/config.status
$(MAKE) -C openblas-$(OPENBLAS_VER) $(OPENBLAS_BUILD_OPTS) || (echo "*** 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. ***" && false)
$(OPENBLAS_SRC_DIR)/config.status: $(OPENBLAS_SRC_DIR)/Makefile
perl -i -ple 's/^\s*(EXTRALIB\s*\+=\s*-lSystemStubs)\s*$$/# $$1/g' $(OPENBLAS_SRC_DIR)/Makefile.system
touch $@
$(OPENBLAS_OBJ_SOURCE): $(OPENBLAS_SRC_DIR)/config.status
echo $(MAKE) -C $(OPENBLAS_SRC_DIR) $(OPENBLAS_BUILD_OPTS) # echo first, so we only print the error message below in a failure case
@$(MAKE) -C $(OPENBLAS_SRC_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 $@
$(OPENBLAS_OBJ_TARGET): $(OPENBLAS_OBJ_SOURCE) | $(build_shlibdir)
cp -f openblas-$(OPENBLAS_VER)/libopenblas.$(SHLIB_EXT) $(build_shlibdir)
cp -f $(OPENBLAS_SRC_DIR)/libopenblas.$(SHLIB_EXT) $(build_shlibdir)
ifeq ($(OS), Linux)
cd $(build_shlibdir) && \
ln -sf libopenblas.$(SHLIB_EXT) libopenblas.$(SHLIB_EXT).0
endif
$(INSTALL_NAME_CMD)libopenblas.$(SHLIB_EXT) $(build_shlibdir)/libopenblas.$(SHLIB_EXT)

clean-openblas:
-$(MAKE) -C openblas-$(OPENBLAS_VER) clean
distclean-openblas:
-rm -rf openblas-$(OPENBLAS_VER).tar.gz openblas-$(OPENBLAS_VER)
-$(MAKE) -C $(OPENBLAS_SRC_DIR) clean

get-openblas: openblas-$(OPENBLAS_VER).tar.gz
configure-openblas: openblas-$(OPENBLAS_VER)/config.status
get-openblas: $(OPENBLAS_SRC_DIR)/Makefile
configure-openblas: $(OPENBLAS_SRC_DIR)/config.status
compile-openblas: $(OPENBLAS_OBJ_SOURCE)
check-openblas: compile-openblas
install-openblas: $(OPENBLAS_OBJ_TARGET)
Expand Down
1 change: 0 additions & 1 deletion deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ LLVM_VER = 3.3
LLVM_LIB_SUFFIX =
PCRE_VER = 8.36
DSFMT_VER = 2.2.3
OPENBLAS_VER = v0.2.14
LAPACK_VER = 3.5.0
ARPACK_VER = 3.2.0
FFTW_VER = 3.3.4
Expand Down
2 changes: 1 addition & 1 deletion deps/checksums/openblas-v0.2.14.tar.gz/md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
53cda7f420e1ba0ea55de536b24c9701
d340dc3d8a03f549ae29488d737b9c30
2 changes: 1 addition & 1 deletion deps/checksums/openblas-v0.2.14.tar.gz/sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8ab1e50cad6fe403addd892e0eebd008cd5009e33f9b29c19a6bc4c8623b6af055fe43d896edbe3ecbda0f5f8c208c2965ad56d2c6945442cce0ec7f3606452f
5028c0cae1eea168593d951c053d2c3692ea4bf34257b2d6cd533d43dd98d1e4ab982f56c57232e53dcc358a2f8e1e51e15a746235ff6eb64d427a97b1449b60
2 changes: 2 additions & 0 deletions deps/openblas.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OPENBLAS_BRANCH=v0.2.14
OPENBLAS_SHA1=d0c51c4de91b2356b770f92862c6b0e1d54953cd

0 comments on commit 27a823d

Please sign in to comment.