diff --git a/Make.inc b/Make.inc index a4660b612bf61..519720a861ed7 100644 --- a/Make.inc +++ b/Make.inc @@ -60,25 +60,9 @@ USE_SYSTEM_P7ZIP:=0 # Link to the LLVM shared library USE_LLVM_SHLIB := 1 -## Settings for various Intel tools -# Set to 1 to use MKL -USE_INTEL_MKL ?= 0 -# Set to 1 to use Intel LIBM -USE_INTEL_LIBM ?= 0 -# Set to 1 to enable profiling with Intel VTune Amplifier -USE_INTEL_JITEVENTS ?= 0 -# Set to 1 to use Intel C, C++, and FORTRAN compilers -USEICC ?= 0 -USEIFC ?= 0 - # Enable threading with one thread JULIA_THREADS := 1 -ifeq ($(USE_MKL), 1) -$(warning "The julia make variable USE_MKL has been renamed to USE_INTEL_MKL") -USE_INTEL_MKL := 1 -endif - # Set to 1 to enable profiling with OProfile USE_OPROFILE_JITEVENTS ?= 0 @@ -1068,11 +1052,7 @@ endif # Use ILP64 BLAS interface when building openblas from source on 64-bit architectures ifeq ($(BINARY), 64) ifeq ($(USE_SYSTEM_BLAS), 1) -ifeq ($(USE_INTEL_MKL), 1) -USE_BLAS64 ?= 1 -else # non MKL system blas is most likely LP64 USE_BLAS64 ?= 0 -endif else USE_BLAS64 ?= 1 endif @@ -1168,7 +1148,7 @@ BB_TRIPLET_CXXABI := $(subst $(SPACE),-,$(filter-out libgfortran%,$(subst -,$(SP BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI))))) # This is the set of projects that BinaryBuilder dependencies are hooked up for. -BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP CSL +BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP CSL define SET_BB_DEFAULT # First, check to see if BB is disabled on a global setting ifeq ($$(USE_BINARYBUILDER),0) @@ -1332,38 +1312,6 @@ ifeq ($(USE_PERF_JITEVENTS), 1) JCPPFLAGS += -DJL_USE_PERF_JITEVENTS endif - -# Intel libraries - -ifeq ($(USE_INTEL_LIBM), 1) -USE_SYSTEM_LIBM := 1 -LIBM := -L$(MKLROOT)/../compiler/lib/intel64 -limf -LIBMNAME := libimf -endif - -ifeq ($(USE_INTEL_MKL), 1) -ifeq ($(USE_BLAS64), 1) -export MKL_INTERFACE_LAYER := ILP64 -MKLLIB := $(MKLROOT)/lib/intel64 -else -MKLLIB := $(MKLROOT)/lib/ia32 -endif -USE_SYSTEM_BLAS:=1 -USE_SYSTEM_LAPACK:=1 -LIBBLASNAME := libmkl_rt -LIBLAPACKNAME := libmkl_rt -MKL_LDFLAGS := -L$(MKLLIB) -lmkl_rt -ifneq ($(strip $(MKLLIB)),) - ifeq ($(OS), Linux) - RPATH_MKL := -Wl,-rpath,$(MKLLIB) - RPATH += $(RPATH_MKL) - MKL_LDFLAGS += $(RPATH_MKL) - endif -endif -LIBBLAS := $(MKL_LDFLAGS) -LIBLAPACK := $(MKL_LDFLAGS) -endif - ifeq ($(HAVE_SSP),1) JCPPFLAGS += -DHAVE_SSP=1 ifeq ($(USEGCC),1) @@ -1371,24 +1319,6 @@ OSLIBS += -lssp endif endif -# ATLAS - -# ATLAS must have been previously installed to usr/lib/libatlas -# (built as a shared library, for your platform, single threaded) -USE_ATLAS := 0 -ATLAS_LIBDIR := $(build_libdir) -#or ATLAS_LIBDIR := /path/to/system/atlas/lib - -ifeq ($(USE_ATLAS), 1) -USE_BLAS64 := 0 -USE_SYSTEM_BLAS := 1 -USE_SYSTEM_LAPACK := 1 -LIBBLAS := -L$(ATLAS_LIBDIR) -lsatlas -LIBLAPACK := $(LIBBLAS) -LIBBLASNAME := libsatlas -LIBLAPACKNAME := $(LIBBLASNAME) -endif - # Renaming OpenBLAS symbols, see #4923 and #8734 ifeq ($(USE_SYSTEM_BLAS), 0) ifeq ($(USE_BLAS64), 1) diff --git a/Makefile b/Makefile index 7681f5c090c12..63f6fa3514754 100644 --- a/Makefile +++ b/Makefile @@ -164,7 +164,7 @@ JL_TARGETS += julia-debug endif # private libraries, that are installed in $(prefix)/lib/julia -JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal +JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal libblastrampoline ifeq ($(BUNDLE_DEBUG_LIBS),1) JL_PRIVATE_LIBS-0 += libjulia-internal-debug endif @@ -356,7 +356,7 @@ endif $(call stringreplace,$${DEBUG_TARGET},sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT)); \ fi; endif - + # Set rpath for libjulia-internal, which is moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD ifneq (,$(findstring $(OS),Linux FreeBSD)) $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal.$(SHLIB_EXT) diff --git a/NEWS.md b/NEWS.md index 4f9c315659ae5..b5e0aa8be589f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -60,6 +60,10 @@ Standard library changes #### LinearAlgebra +* Use [Libblastrampoline](https://github.com/staticfloat/libblastrampoline/) to pick a BLAS and LAPACK at runtime. By default it forwards to OpenBLAS in the Julia distribution. The forwarding mechanism can be used by packages to replace the BLAS and LAPACK with user preferences. ([#39455]) +* On aarch64, OpenBLAS now uses an ILP64 BLAS like all other 64-bit platforms. ([#39436]) +* OpenBLAS is updated to 0.3.13. ([#39216]) +* SuiteSparse is updated to 5.8.1. ([#39455]) #### Markdown diff --git a/contrib/refresh_checksums.mk b/contrib/refresh_checksums.mk index f578e71ce0dc5..91b548fbe2b0e 100644 --- a/contrib/refresh_checksums.mk +++ b/contrib/refresh_checksums.mk @@ -19,7 +19,7 @@ CLANG_TRIPLETS=$(filter %-darwin %-freebsd,$(TRIPLETS)) NON_CLANG_TRIPLETS=$(filter-out %-darwin %-freebsd,$(TRIPLETS)) # These are the projects currently using BinaryBuilder; both GCC-expanded and non-GCC-expanded: -BB_PROJECTS=mbedtls libssh2 nghttp2 mpfr curl libgit2 pcre libuv unwind llvmunwind dsfmt objconv p7zip zlib suitesparse openlibm +BB_PROJECTS=mbedtls libssh2 nghttp2 mpfr curl libgit2 pcre libuv unwind llvmunwind dsfmt objconv p7zip zlib suitesparse openlibm blastrampoline BB_GCC_EXPANDED_PROJECTS=openblas csl BB_CXX_EXPANDED_PROJECTS=gmp llvm clang llvm-tools # These are non-BB source-only deps diff --git a/deps/Makefile b/deps/Makefile index da815c6aa1981..cc5d7a05f3902 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -24,7 +24,7 @@ BUILDDIR := $(BUILDDIR)$(MAYBE_HOST) # if you are adding a new target, it can help to copy an similar, existing target # # autoconf configure-driven scripts: pcre unwind gmp mpfr patchelf libuv curl -# custom Makefile rules: openlibm dsfmt suitesparse-wrapper suitesparse lapack openblas utf8proc objconv libwhich +# custom Makefile rules: openlibm dsfmt suitesparse-wrapper suitesparse lapack blastrampoline openblas utf8proc objconv libwhich # CMake libs: llvm llvmunwind libgit2 libssh2 mbedtls # # downloadable via git: llvm-svn, libuv, libopenlibm, utf8proc, libgit2, libssh2 @@ -39,6 +39,9 @@ unexport CONFIG_SITE DEP_LIBS := +# Always use libblastrampoline +DEP_LIBS += blastrampoline + ifeq ($(USE_SYSTEM_CSL), 0) DEP_LIBS += csl endif @@ -184,7 +187,7 @@ install: $(addprefix install-, $(DEP_LIBS)) cleanall: $(addprefix clean-, $(DEP_LIBS)) distcleanall: $(addprefix distclean-, $(DEP_LIBS)) rm -rf $(build_prefix) -getall: get-llvm get-libuv get-pcre get-openlibm get-dsfmt get-openblas get-lapack get-suitesparse get-unwind get-gmp get-mpfr get-patchelf get-utf8proc get-objconv get-mbedtls get-libssh2 get-nghttp2 get-curl get-libgit2 get-libwhich get-zlib get-p7zip get-csl +getall: get-llvm get-libuv get-pcre get-openlibm get-dsfmt get-blastrampoline get-openblas get-lapack get-suitesparse get-unwind get-gmp get-mpfr get-patchelf get-utf8proc get-objconv get-mbedtls get-libssh2 get-nghttp2 get-curl get-libgit2 get-libwhich get-zlib get-p7zip get-csl # If we're building for MacOS, no matter what, `getall` should include `llvmunwind` ifeq ($(OS),Darwin) @@ -203,7 +206,8 @@ include $(SRCDIR)/pcre.mk include $(SRCDIR)/openlibm.mk include $(SRCDIR)/dsfmt.mk include $(SRCDIR)/objconv.mk -include $(SRCDIR)/blas.mk +include $(SRCDIR)/blastrampoline.mk +include $(SRCDIR)/openblas.mk include $(SRCDIR)/utf8proc.mk include $(SRCDIR)/suitesparse.mk include $(SRCDIR)/unwind.mk diff --git a/deps/Versions.make b/deps/Versions.make index 42eaadd88b7a3..e347ee72e07e3 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -73,6 +73,10 @@ OBJCONV_VER := 2.49.1 OBJCONV_JLL_NAME := Objconv OBJCONV_JLL_VER := 2.49.1+0 +# blastrampoline +BLASTRAMPOLINE_VER := 3.0.0 +BLASTRAMPOLINE_JLL_NAME := libblastrampoline + # OpenBLAS OPENBLAS_VER := 0.3.13 OPENBLAS_JLL_NAME := OpenBLAS @@ -93,7 +97,7 @@ PCRE_VER := 10.36 PCRE_JLL_NAME := PCRE2 # SuiteSparse -SUITESPARSE_VER := 5.4.0 +SUITESPARSE_VER := 5.8.1 SUITESPARSE_JLL_NAME := SuiteSparse # unwind diff --git a/deps/blastrampoline.mk b/deps/blastrampoline.mk new file mode 100644 index 0000000000000..1ba1d1cdada8d --- /dev/null +++ b/deps/blastrampoline.mk @@ -0,0 +1,37 @@ +## blastrampoline ## + +ifneq ($(USE_BINARYBUILDER_BLASTRAMPOLINE),1) + +BLASTRAMPOLINE_GIT_URL := git://github.com/staticfloat/libblastrampoline.git +BLASTRAMPOLINE_TAR_URL = https://api.github.com/repos/staticfloat/libblastrampoline/tarball/$1 +$(eval $(call git-external,blastrampoline,BLASTRAMPOLINE,,,$(BUILDDIR))) + +$(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/build-configured: $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/source-extracted + mkdir -p $(dir $@) + echo 1 > $@ + +$(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/build-compiled: $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/build-configured + cd $(dir $@)/src && $(MAKE) $(MAKE_COMMON) + echo 1 > $@ + +define BLASTRAMPOLINE_INSTALL + $(MAKE) -C $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/src $(MAKE_COMMON) install +endef +$(eval $(call staged-install, \ + blastrampoline,$(BLASTRAMPOLINE_SRC_DIR), \ + BLASTRAMPOLINE_INSTALL,, \ + $$(BLASTRAMPOLINE_OBJ_TARGET), \ + $$(INSTALL_NAME_CMD)libblastrampoline.$$(SHLIB_EXT) $$(build_shlibdir)/libblastrampoline.$$(SHLIB_EXT))) + +get-blastrampoline: $(BLASTRAMPOLINE_SRC_FILE) +extract-blastrampoline: $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/source-extracted +configure-blastrampoline: extract-blastrampoline +compile-blastrampoline: $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/build-compiled +fastcheck-blastrampoline: check-blastrampoline +check-blastrampoline: compile-blastrampoline + +else + +$(eval $(call bb-install,blastrampoline,BLASTRAMPOLINE,false)) + +endif # USE_BINARYBUILDER_BLASTRAMPOLINE diff --git a/deps/blastrampoline.version b/deps/blastrampoline.version new file mode 100644 index 0000000000000..5125efd8f922a --- /dev/null +++ b/deps/blastrampoline.version @@ -0,0 +1,2 @@ +BLASTRAMPOLINE_BRANCH=main +BLASTRAMPOLINE_SHA1=45f4a20ffdba5d368db66d71885312f5f73c2dc7 diff --git a/deps/checksums/blastrampoline b/deps/checksums/blastrampoline new file mode 100644 index 0000000000000..0c18806be995b --- /dev/null +++ b/deps/checksums/blastrampoline @@ -0,0 +1,34 @@ +blastrampoline-45f4a20ffdba5d368db66d71885312f5f73c2dc7.tar.gz/md5/00f14fabf8f36a99f97dd42110b21dd5 +blastrampoline-45f4a20ffdba5d368db66d71885312f5f73c2dc7.tar.gz/sha512/e72d14e35ca512e42cd44060c4ccc300df9b82a0e0aa03f85fea3651fc6cc235fc8c4270fe3c93a75a7af20f38e9fe59bcbbdba4c3d62cd747cca2214dfce256 +libblastrampoline.v3.0.0+0.aarch64-apple-darwin.tar.gz/md5/82fecf5e70db5573e3389c5deccdf92c +libblastrampoline.v3.0.0+0.aarch64-apple-darwin.tar.gz/sha512/559ace7a345ead6cafc52ff41748909c86abf75fe2ba272217d259fd2017f7237f675b9075320e31b37fd51d783577a8831744df286f39bd08f6748013d23a63 +libblastrampoline.v3.0.0+0.aarch64-linux-gnu.tar.gz/md5/ea07fcd4b0923403e99420cfe882fa76 +libblastrampoline.v3.0.0+0.aarch64-linux-gnu.tar.gz/sha512/098f67a9054a130d001e015f767113ace893caa8df28cfdb875d52eef36c252e512dd806d46b6dda625101edc613b55497462a1fd7351d907938f607f09ea1ed +libblastrampoline.v3.0.0+0.aarch64-linux-musl.tar.gz/md5/ba3ac2cac82777429f30d445dd8e8138 +libblastrampoline.v3.0.0+0.aarch64-linux-musl.tar.gz/sha512/b30842126adcd308e1b9254075a8cddf534124b6022a5bd6b39c622cb3480af05786d73d698c102b9aeb58045099457fd28a43a8fb1453c4fb1008fbca147cff +libblastrampoline.v3.0.0+0.armv6l-linux-gnueabihf.tar.gz/md5/de3b0e86010239c794aa331d76f855c4 +libblastrampoline.v3.0.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/a94a33e076ce111d63832b6831e02582bf7982ea8866611c14d9d26d74881daa2d9df3ca2ccf01719ecf3f05564239a45fb9efebe34eb4b0dd340bce94617056 +libblastrampoline.v3.0.0+0.armv6l-linux-musleabihf.tar.gz/md5/34c193f72ec4962ec5b4f724e43f46d8 +libblastrampoline.v3.0.0+0.armv6l-linux-musleabihf.tar.gz/sha512/8ccba9921b6baa495c1f17689ad3c3a36042230d14100647dac260c907616f73e971578904a5b7d50b9e53698d65dc8660a2b4f46c41d7432acbf805a9293cea +libblastrampoline.v3.0.0+0.armv7l-linux-gnueabihf.tar.gz/md5/81936b0e9ac1e741864d373dcf3a71a1 +libblastrampoline.v3.0.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/23b74f6efb223919d9ef16396c970ae8dab8c418032a82890cfb34a06c6493cddf8a26ec83c35225c06861aa42375055143fa317bbb0cff1febe745ea411092c +libblastrampoline.v3.0.0+0.armv7l-linux-musleabihf.tar.gz/md5/6648bda00959b1b402d595611ded6335 +libblastrampoline.v3.0.0+0.armv7l-linux-musleabihf.tar.gz/sha512/719b2d4772df813a5606c26f7dfd73b8ee72ab3d57cb978ad155cd23303a7e4e15446756243ced00da800013082ea12fdb6882f475db02d45e6a203e44ec4685 +libblastrampoline.v3.0.0+0.i686-linux-gnu.tar.gz/md5/00a94da0c79ae709e0016aaf12772097 +libblastrampoline.v3.0.0+0.i686-linux-gnu.tar.gz/sha512/8a99f8692362c832e7c90bb150c8c07ac9698b64cc352283d11251ebd16f59f66952967f6a48fcc5649f374b724421fadbcb3f48cee18e034b0450f55a3c8d7e +libblastrampoline.v3.0.0+0.i686-linux-musl.tar.gz/md5/68d4c314fb2c71b089af553f6aa0cfa8 +libblastrampoline.v3.0.0+0.i686-linux-musl.tar.gz/sha512/b1623b421a30169cdca496014b734b783600319bc93d426dc2f513de64b86fab9e0a649b6cc64a0f2d415643083cd0c7672ab64bf1064e8780e03a130e24ae20 +libblastrampoline.v3.0.0+0.i686-w64-mingw32.tar.gz/md5/c4f075c445f0694fa0794972902db6e3 +libblastrampoline.v3.0.0+0.i686-w64-mingw32.tar.gz/sha512/c6a37da8c7a44bb250ded247c98dbe20e43373e9f45c41c70060411666273e2d21ffffbb94d7e89f326f48a212c9df9c1d27b9abcc8bc1545409e09260438c15 +libblastrampoline.v3.0.0+0.powerpc64le-linux-gnu.tar.gz/md5/01159456203e67912e4db9a3ffde81c4 +libblastrampoline.v3.0.0+0.powerpc64le-linux-gnu.tar.gz/sha512/854edaf69df8d044a9994579e493732163a0d393e6a19e363568cc3682f9d9fbf6e63104710173603dc7687670d4a9164a554f6e1130791ce66072e303f4a3a7 +libblastrampoline.v3.0.0+0.x86_64-apple-darwin.tar.gz/md5/80a6e19c518846246b6e3c4d5fd31be8 +libblastrampoline.v3.0.0+0.x86_64-apple-darwin.tar.gz/sha512/f5c52f496fab2c9eb1812b5ffe587a2f018ed92e311ad263fb84080341badda1279e2748798070df8b412b087430bdee12d3dfbafda207eb6a17a71eb6cc22bd +libblastrampoline.v3.0.0+0.x86_64-linux-gnu.tar.gz/md5/e7599dee593200c77114d0fee8783ecd +libblastrampoline.v3.0.0+0.x86_64-linux-gnu.tar.gz/sha512/f3eb3b9517200eb39146bc361476f244aac1ad4b1ffa5757a8f2399ac7d88252862ac9550d727b0e392cd2715f1018c7cdf998d7afc2948ba7fe16a1c2a6ce4a +libblastrampoline.v3.0.0+0.x86_64-linux-musl.tar.gz/md5/2f6eaf5684219ec985d3fe171f162d2f +libblastrampoline.v3.0.0+0.x86_64-linux-musl.tar.gz/sha512/33336fc7b3844c9b4c30351cbfbd48042d4a085799ec61b74925ba2943639da3e476a5de128d431e62a82a0973615d42299619a9705e43ef2e4ea2ff963edf4d +libblastrampoline.v3.0.0+0.x86_64-unknown-freebsd.tar.gz/md5/a9a52349cb509d75d91aa232b6005f66 +libblastrampoline.v3.0.0+0.x86_64-unknown-freebsd.tar.gz/sha512/d2e57a6c7c7b0f08f0767c08b5e4e933eb78195b266377fbf9e95f3890a01654e4b97994fb7e575e2f48b821bad1b02c5fcdbafb6a6efda05622f124199e6ecc +libblastrampoline.v3.0.0+0.x86_64-w64-mingw32.tar.gz/md5/dcc3af7f8bb050ed45d14464f710a013 +libblastrampoline.v3.0.0+0.x86_64-w64-mingw32.tar.gz/sha512/0f95e4eac7e0cd6cb7e86b040574c9404d802f4a4c090e2d27f903ff445b0e5afb5e9dc0e463c56e6c0b296faceb66db66f0d68ce7e493ffd9373e696445178c diff --git a/deps/blas.mk b/deps/openblas.mk similarity index 100% rename from deps/blas.mk rename to deps/openblas.mk diff --git a/deps/suitesparse.mk b/deps/suitesparse.mk index eda7a1c21c12d..5be8589875dc4 100644 --- a/deps/suitesparse.mk +++ b/deps/suitesparse.mk @@ -4,14 +4,12 @@ ifeq ($(USE_BLAS64), 1) UMFPACK_CONFIG := -DLONGBLAS='long long' CHOLMOD_CONFIG := -DLONGBLAS='long long' SPQR_CONFIG := -DLONGBLAS='long long' -ifeq ($(OPENBLAS_SYMBOLSUFFIX), 64_) UMFPACK_CONFIG += -DSUN64 CHOLMOD_CONFIG += -DSUN64 SPQR_CONFIG += -DSUN64 endif -endif -# Disable trying to link against libmetis +# Disable linking to libmetis CHOLMOD_CONFIG += -DNPARTITION ifneq ($(USE_BINARYBUILDER_SUITESPARSE), 1) @@ -23,7 +21,7 @@ SUITE_SPARSE_LIB := $(LDFLAGS) -L"$(abspath $(BUILDDIR))/SuiteSparse-$(SUITESPAR ifeq ($(OS), Darwin) SUITE_SPARSE_LIB += $(RPATH_ESCAPED_ORIGIN) endif -SUITESPARSE_MFLAGS := CC="$(CC)" CXX="$(CXX)" F77="$(FC)" AR="$(AR)" RANLIB="$(RANLIB)" BLAS="$(LIBBLAS)" LAPACK="$(LIBLAPACK)" \ +SUITESPARSE_MFLAGS := CC="$(CC)" CXX="$(CXX)" F77="$(FC)" AR="$(AR)" RANLIB="$(RANLIB)" BLAS="-L$(build_shlibdir) -lblastrampoline" LAPACK="-L$(build_shlibdir) -lblastrampoline" \ LDFLAGS="$(SUITE_SPARSE_LIB)" CFOPENMP="" CUDA=no CUDA_PATH="" \ UMFPACK_CONFIG="$(UMFPACK_CONFIG)" CHOLMOD_CONFIG="$(CHOLMOD_CONFIG)" SPQR_CONFIG="$(SPQR_CONFIG)" ifeq ($(OS),WINNT) @@ -53,11 +51,7 @@ $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-shlib.patch-applied: $(BU $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-shlib.patch-applied -ifeq ($(USE_SYSTEM_BLAS), 0) -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/openblas -else ifeq ($(USE_SYSTEM_LAPACK), 0) -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/lapack -endif +$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/blastrampoline $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted $(MAKE) -C $(dir $<)SuiteSparse_config library config $(SUITESPARSE_MFLAGS) @@ -153,6 +147,6 @@ clean-suitesparse-wrapper: clean-suitesparse distclean-suitesparse-wrapper: distclean-suitesparse install-suitesparse-wrapper: install-suitesparse -# suitesparse depends on OpenBLAS -compile-suitesparse: | $(build_prefix)/manifest/openblas +# suitesparse depends on blastrampoline +compile-suitesparse: | $(build_prefix)/manifest/blastrampoline endif diff --git a/stdlib/Distributed/test/distributed_exec.jl b/stdlib/Distributed/test/distributed_exec.jl index 656792e2d7337..c36a79600773c 100644 --- a/stdlib/Distributed/test/distributed_exec.jl +++ b/stdlib/Distributed/test/distributed_exec.jl @@ -1005,30 +1005,8 @@ end # Test addprocs enable_threaded_blas parameter -const get_num_threads = function() # anonymous so it will be serialized when called - blas = LinearAlgebra.BLAS.vendor() - # Wrap in a try to catch unsupported blas versions - try - if blas == :openblas - return ccall((:openblas_get_num_threads, Base.libblas_name), Cint, ()) - elseif blas == :openblas64 - return ccall((:openblas_get_num_threads64_, Base.libblas_name), Cint, ()) - elseif blas == :mkl - return ccall((:MKL_Get_Max_Num_Threads, Base.libblas_name), Cint, ()) - end - - # OSX BLAS looks at an environment variable - if Sys.isapple() - return tryparse(Cint, get(ENV, "VECLIB_MAXIMUM_THREADS", "1")) - end - catch - end - - return nothing -end - function get_remote_num_threads(processes_added) - return [remotecall_fetch(get_num_threads, proc_id) for proc_id in processes_added] + return [remotecall_fetch(BLAS.get_num_threads, proc_id) for proc_id in processes_added] end function test_blas_config(pid, expected) @@ -1041,7 +1019,7 @@ function test_blas_config(pid, expected) end function test_add_procs_threaded_blas() - master_blas_thread_count = get_num_threads() + master_blas_thread_count = BLAS.get_num_threads() if master_blas_thread_count === nothing @warn "Skipping blas num threads tests due to unsupported blas version" return @@ -1055,7 +1033,7 @@ function test_add_procs_threaded_blas() end # Master thread should not have changed - @test get_num_threads() == master_blas_thread_count + @test BLAS.get_num_threads() == master_blas_thread_count # Threading disabled in children by default thread_counts_by_process = get_remote_num_threads(processes_added) @@ -1069,9 +1047,9 @@ function test_add_procs_threaded_blas() test_blas_config(proc_id, true) end - @test get_num_threads() == master_blas_thread_count + @test BLAS.get_num_threads() == master_blas_thread_count - # BLAS.set_num_threads(`num`) doesn't cause get_num_threads to return `num` + # BLAS.set_num_threads(`num`) doesn't cause BLAS.get_num_threads to return `num` # depending on the machine, the BLAS version, and BLAS configuration, so # we need a very lenient test. thread_counts_by_process = get_remote_num_threads(processes_added) diff --git a/stdlib/LinearAlgebra/Project.toml b/stdlib/LinearAlgebra/Project.toml index eb18e1b2ff085..e12d950774643 100644 --- a/stdlib/LinearAlgebra/Project.toml +++ b/stdlib/LinearAlgebra/Project.toml @@ -3,6 +3,7 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index cc91b113ba637..dc6fef57aa5ae 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -18,6 +18,7 @@ import Base: USE_BLAS64, abs, acos, acosh, acot, acoth, acsc, acsch, adjoint, as using Base: hvcat_fill, IndexLinear, promote_op, promote_typeof, @propagate_inbounds, @pure, reduce, typed_vcat, require_one_based_indexing using Base.Broadcast: Broadcasted, broadcasted +import Libdl export # Modules @@ -424,27 +425,60 @@ end function versioninfo(io::IO=stdout) - if Base.libblas_name == "libopenblas" || BLAS.vendor() === :openblas || BLAS.vendor() === :openblas64 - openblas_config = BLAS.openblas_get_config() - println(io, "BLAS: libopenblas (", openblas_config, ")") + config = BLAS.get_config() + println(io, "BLAS: $(BLAS.libblastrampoline) ($(join(string.(config.build_flags), ", ")))") + for lib in config.loaded_libs + println(io, " --> $(lib.libname) ($(uppercase(string(lib.interface))))") + end + return nothing +end + +function find_blas_library(name) + shlib_ext = string(".", Libdl.dlext) + if !endswith(name, shlib_ext) + name_ext = string(name, shlib_ext) + end + + # On windows, we look in `bin` and never in `lib` + @static if Sys.iswindows() + path = joinpath(Sys.BINDIR, name_ext) + isfile(path) && return path else - println(io, "BLAS: ",Base.libblas_name) + # On other platforms, we check `lib/julia` first, and if that doesn't exist, `lib`. + path = joinpath(Sys.BINDIR, Base.LIBDIR, "julia", name_ext) + isfile(path) && return path + + path = joinpath(Sys.BINDIR, Base.LIBDIR, name_ext) + isfile(path) && return path end - println(io, "LAPACK: ",Base.liblapack_name) + + # If we can't find it by absolute path, we'll try just passing this straight through to `dlopen()` + return name +end + +function get_blas_lapack_path() + blas_path = find_blas_library(Base.liblapack_name) + lapack_path = find_blas_library(Base.liblapack_name) + return (blas_path, lapack_path) end function __init__() + # Eventually, this will be provided via libblastrampoline_jll + libblastrampoline_handle = Libdl.dlopen(BLAS.libblastrampoline) + try - BLAS.check() - if BLAS.vendor() === :mkl - ccall((:MKL_Set_Interface_Layer, Base.libblas_name), Cvoid, (Cint,), USE_BLAS64 ? 1 : 0) + libblas_path = find_blas_library(Base.libblas_name) + liblapack_path = find_blas_library(Base.liblapack_name) + BLAS.lbt_forward(libblas_path; clear=true) + if liblapack_path != libblas_path + BLAS.lbt_forward(liblapack_path) end + BLAS.check() Threads.resize_nthreads!(Abuf) Threads.resize_nthreads!(Bbuf) Threads.resize_nthreads!(Cbuf) catch ex - Base.showerror_nostdio(ex, - "WARNING: Error during initialization of module LinearAlgebra") + Base.showerror_nostdio(ex, "WARNING: Error during initialization of module LinearAlgebra") end # register a hook to disable BLAS threading Base.at_disable_library_threading(() -> BLAS.set_num_threads(1)) diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 272f0f57bdb29..074197176d38f 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -6,7 +6,7 @@ Interface to BLAS subroutines. module BLAS import ..axpy!, ..axpby! -import Base: copyto! +import Base: copyto!, USE_BLAS64 using Base: require_one_based_indexing export @@ -62,39 +62,37 @@ export trsm!, trsm - -const libblas = Base.libblas_name -const liblapack = Base.liblapack_name +# Eventually this will be replaced with `libblastrampoline_jll.libblastrampoline` +const libblastrampoline = "libblastrampoline" +libblastrampoline_handle = C_NULL import LinearAlgebra import LinearAlgebra: BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatch, checksquare, stride1, chkstride1, axpy! -import Libdl +include("lbt.jl") -# utility routines -let lib = C_NULL -global function determine_vendor() - if lib == C_NULL - lib = something(Libdl.dlopen(libblas; throw_error=false), C_NULL) - end - vend = :unknown - if lib != C_NULL - if Libdl.dlsym(lib, :openblas_set_num_threads; throw_error=false) !== nothing - vend = :openblas - elseif Libdl.dlsym(lib, :openblas_set_num_threads64_; throw_error=false) !== nothing - vend = :openblas64 - elseif Libdl.dlsym(lib, :MKL_Set_Num_Threads; throw_error=false) !== nothing - vend = :mkl - end +""" +get_config() + +Return an object representing the current `libblastrampoline` configuration. + +!!! compat "Julia 1.7" + `get_config()` requires at least Julia 1.7. +""" +get_config() = lbt_get_config() + +# We hard-lock `vendor()` to `openblas(64)` here to satisfy older code, but all new code should use +# `get_config()` since it is now possible to have multiple vendors loaded at once. +function vendor() + Base.depwarn("`vendor()` is deprecated, use `BLAS.get_config()` and inspect the output instead", :vendor) + if USE_BLAS64 + return :openblas64 + else + return :openblas end - return vend -end end -const _vendor = determine_vendor() -vendor() = _vendor - -if vendor() === :openblas64 +if USE_BLAS64 macro blasfunc(x) return Expr(:quote, Symbol(x, "64_")) end @@ -104,17 +102,7 @@ else end end -openblas_get_config() = strip(unsafe_string(ccall((@blasfunc(openblas_get_config), libblas), Ptr{UInt8}, () ))) - -function guess_vendor() - # like determine_vendor, but guesses blas in some cases - # where determine_vendor returns :unknown - ret = vendor() - if Sys.isapple() && (ret == :unknown) - ret = :osxblas - end - ret -end +_tryparse_env_int(key) = tryparse(Int, get(ENV, key, "")) """ @@ -124,52 +112,17 @@ end Set the number of threads the BLAS library should use equal to `n::Integer`. Also accepts `nothing`, in which case julia tries to guess the default number of threads. -Passing `nothing` is discouraged and mainly exists for the following reason: - -On exotic variants of BLAS, `nothing` may be returned by `get_num_threads()`. -Thus on exotic variants of BLAS, the following pattern may fail to set the number of threads: - -```julia -old = get_num_threads() -set_num_threads(1) -@threads for i in 1:10 - # single-threaded BLAS calls -end -set_num_threads(old) -``` -Because `set_num_threads` accepts `nothing`, this code can still run -on exotic variants of BLAS without error. Warnings will be raised instead. - -!!! compat "Julia 1.6" - `set_num_threads(::Nothing)` requires at least Julia 1.6. -""" -set_num_threads(n)::Nothing = _set_num_threads(n) - -function _set_num_threads(n::Integer; _blas = guess_vendor()) - if _blas === :openblas || _blas == :openblas64 - return ccall((@blasfunc(openblas_set_num_threads), libblas), Cvoid, (Cint,), n) - elseif _blas === :mkl - # MKL may let us set the number of threads in several ways - return ccall((:MKL_Set_Num_Threads, libblas), Cvoid, (Cint,), n) - elseif _blas === :osxblas - # OSX BLAS looks at an environment variable - ENV["VECLIB_MAXIMUM_THREADS"] = n - else - @assert _blas === :unknown - @warn "Failed to set number of BLAS threads." maxlog=1 - end - return nothing -end - -_tryparse_env_int(key) = tryparse(Int, get(ENV, key, "")) - -function _set_num_threads(::Nothing; _blas = guess_vendor()) - n = something( +Passing `nothing` is discouraged and mainly exists for historical reasons. +""" +set_num_threads(nt::Integer)::Nothing = lbt_set_num_threads(Int32(nt)) +function set_num_threads(::Nothing) + nt = something( _tryparse_env_int("OPENBLAS_NUM_THREADS"), _tryparse_env_int("OMP_NUM_THREADS"), + _tryparse_env_int("VECLIB_MAXIMUM_THREADS"), max(1, Sys.CPU_THREADS ÷ 2), ) - _set_num_threads(n; _blas) + return set_num_threads(nt) end """ @@ -177,74 +130,24 @@ end Get the number of threads the BLAS library is using. -On exotic variants of `BLAS` this function can fail, which is indicated by returning `nothing`. - !!! compat "Julia 1.6" `get_num_threads` requires at least Julia 1.6. """ -get_num_threads()::Union{Int, Nothing} = _get_num_threads() - -function _get_num_threads(; _blas = guess_vendor())::Union{Int, Nothing} - if _blas === :openblas || _blas === :openblas64 - return Int(ccall((@blasfunc(openblas_get_num_threads), libblas), Cint, ())) - elseif _blas === :mkl - return Int(ccall((:mkl_get_max_threads, libblas), Cint, ())) - elseif _blas === :osxblas - key = "VECLIB_MAXIMUM_THREADS" - nt = _tryparse_env_int(key) - if nt === nothing - @warn "Failed to read environment variable $key" maxlog=1 - else - return nt - end - else - @assert _blas === :unknown - end - @warn "Could not get number of BLAS threads. Returning `nothing` instead." maxlog=1 - return nothing -end +get_num_threads()::Int = lbt_get_num_threads() -const _testmat = [1.0 0.0; 0.0 -1.0] function check() - blas = vendor() - if blas === :openblas || blas === :openblas64 - openblas_config = openblas_get_config() - openblas64 = occursin(r".*USE64BITINT.*", openblas_config) - if Base.USE_BLAS64 != openblas64 - if !openblas64 - @error """ - OpenBLAS was not built with 64bit integer support. - You're seeing this error because Julia was built with USE_BLAS64=1. - Please rebuild Julia with USE_BLAS64=0""" - else - @error """ - Julia was not built with support for OpenBLAS with 64bit integer support. - You're seeing this error because Julia was built with USE_BLAS64=0. - Please rebuild Julia with USE_BLAS64=1""" - end - println("Quitting.") - exit() - end - elseif blas === :mkl - if Base.USE_BLAS64 - ENV["MKL_INTERFACE_LAYER"] = "ILP64" - end + # TODO: once we have bitfields of the BLAS functions that are actually forwarded, + # ensure that we have a complete set here (warning on an incomplete BLAS implementation) + config = get_config() + + # Ensure that one of our loaded libraries satisfies our interface requirement + interface = Base.USE_BLAS64 ? :ilp64 : :lp64 + if !any(lib.interface == interface for lib in config.loaded_libs) + interfacestr = uppercase(string(interface)) + @error("No loaded BLAS libraries were built with $(interfacestr) support") + println("Quitting.") + exit() end - - # - # Check if BlasInt is the expected bitsize, by triggering an error - # - (_, info) = LinearAlgebra.LAPACK.potrf!('U', _testmat) - if info != 2 # mangled info code - if info == 2^33 - error("BLAS and LAPACK are compiled with 32-bit integer support, but Julia expects 64-bit integers. Please build Julia with USE_BLAS64=0.") - elseif info == 0 - error("BLAS and LAPACK are compiled with 64-bit integer support but Julia expects 32-bit integers. Please build Julia with USE_BLAS64=1.") - else - error("The LAPACK library produced an undefined error code. Please verify the installation of BLAS and LAPACK.") - end - end - end @@ -265,7 +168,7 @@ for (fname, elty) in ((:dcopy_,:Float64), @eval begin # SUBROUTINE DCOPY(N,DX,INCX,DY,INCY) function blascopy!(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, DX, incx, DY, incy) DY @@ -287,12 +190,12 @@ first `n` elements of array `Y` with stride `incy`. Returns `X` and `Y`. """ function rot! end -for (fname, elty, cty, sty, lib) in ((:drot_, :Float64, :Float64, :Float64, libblas), - (:srot_, :Float32, :Float32, :Float32, libblas), - (:zdrot_, :ComplexF64, :Float64, :Float64, libblas), - (:csrot_, :ComplexF32, :Float32, :Float32, libblas), - (:zrot_, :ComplexF64, :Float64, :ComplexF64, liblapack), - (:crot_, :ComplexF32, :Float32, :ComplexF32, liblapack)) +for (fname, elty, cty, sty, lib) in ((:drot_, :Float64, :Float64, :Float64, libblastrampoline), + (:srot_, :Float32, :Float32, :Float32, libblastrampoline), + (:zdrot_, :ComplexF64, :Float64, :Float64, libblastrampoline), + (:csrot_, :ComplexF32, :Float32, :Float32, libblastrampoline), + (:zrot_, :ComplexF64, :Float64, :ComplexF64, libblastrampoline), + (:crot_, :ComplexF32, :Float32, :ComplexF32, libblastrampoline)) @eval begin # SUBROUTINE DROT(N,DX,INCX,DY,INCY,C,S) function rot!(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer, C::$cty, S::$sty) @@ -327,7 +230,7 @@ for (fname, elty) in ((:dscal_,:Float64), @eval begin # SUBROUTINE DSCAL(N,DA,DX,INCX) function scal!(n::Integer, DA::$elty, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, DA, DX, incx) DX @@ -391,7 +294,7 @@ for (fname, elty) in ((:ddot_,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function dot(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), $elty, + ccall((@blasfunc($fname), libblastrampoline), $elty, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, DX, incx, DY, incy) end @@ -408,7 +311,7 @@ for (fname, elty) in ((:cblas_zdotc_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotc(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -426,7 +329,7 @@ for (fname, elty) in ((:cblas_zdotu_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotu(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -484,7 +387,7 @@ for (fname, elty, ret_type) in ((:dnrm2_,:Float64,:Float64), @eval begin # SUBROUTINE DNRM2(N,X,INCX) function nrm2(n::Integer, X::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblas), $ret_type, + ccall((@blasfunc($fname), libblastrampoline), $ret_type, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, X, incx) end @@ -521,7 +424,7 @@ for (fname, elty, ret_type) in ((:dasum_,:Float64,:Float64), @eval begin # SUBROUTINE ASUM(N, X, INCX) function asum(n::Integer, X::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblas), $ret_type, + ccall((@blasfunc($fname), libblastrampoline), $ret_type, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, X, incx) end @@ -564,7 +467,7 @@ for (fname, elty) in ((:daxpy_,:Float64), #* .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function axpy!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer, dy::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, dy, incy) dy @@ -633,7 +536,7 @@ for (fname, elty) in ((:daxpby_,:Float64), (:saxpby_,:Float32), function axpby!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer, beta::($elty), dy::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, beta, dy, incy) dy @@ -656,7 +559,7 @@ for (fname, elty) in ((:idamax_,:Float64), (:icamax_,:ComplexF32)) @eval begin function iamax(n::Integer, dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblas),BlasInt, + ccall((@blasfunc($fname), libblastrampoline),BlasInt, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, dx, incx) end @@ -701,7 +604,7 @@ for (fname, elty) in ((:dgemv_,:Float64), throw(DimensionMismatch("the transpose of A has dimensions $n, $m, X has length $(length(X)) and Y has length $(length(Y))")) end chkstride1(A) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -781,7 +684,7 @@ for (fname, elty) in ((:dgbmv_,:Float64), y::AbstractVector{$elty}) require_one_based_indexing(A, x, y) chkstride1(A) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -813,10 +716,10 @@ Only the [`ul`](@ref stdlib-blas-uplo) triangle of `A` is used. """ function symv! end -for (fname, elty, lib) in ((:dsymv_,:Float64,libblas), - (:ssymv_,:Float32,libblas), - (:zsymv_,:ComplexF64,liblapack), - (:csymv_,:ComplexF32,liblapack)) +for (fname, elty, lib) in ((:dsymv_,:Float64,libblastrampoline), + (:ssymv_,:Float32,libblastrampoline), + (:zsymv_,:ComplexF64,libblastrampoline), + (:csymv_,:ComplexF32,libblastrampoline)) # Note that the complex symv are not BLAS but auiliary functions in LAPACK @eval begin # SUBROUTINE DSYMV(UPLO,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) @@ -905,7 +808,7 @@ for (fname, elty) in ((:zhemv_,:ComplexF64), lda = max(1, stride(A, 2)) incx = stride(x, 1) incy = stride(y, 1) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -962,7 +865,7 @@ for (fname, elty) in ((:zhpmv_, :ComplexF64), y::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1040,7 +943,7 @@ for (fname, elty) in ((:dsbmv_,:Float64), function sbmv!(uplo::AbstractChar, k::Integer, alpha::($elty), A::AbstractMatrix{$elty}, x::AbstractVector{$elty}, beta::($elty), y::AbstractVector{$elty}) require_one_based_indexing(A, x, y) chkstride1(A) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -1112,7 +1015,7 @@ for (fname, elty) in ((:dspmv_, :Float64), y::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1190,7 +1093,7 @@ for (fname, elty) in ((:zhbmv_,:ComplexF64), function hbmv!(uplo::AbstractChar, k::Integer, alpha::($elty), A::AbstractMatrix{$elty}, x::AbstractVector{$elty}, beta::($elty), y::AbstractVector{$elty}) require_one_based_indexing(A, x, y) chkstride1(A) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -1250,7 +1153,7 @@ for (fname, elty) in ((:dtrmv_,:Float64), throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))")) end chkstride1(A) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), @@ -1305,7 +1208,7 @@ for (fname, elty) in ((:dtrsv_,:Float64), throw(DimensionMismatch("size of A is $n != length(x) = $(length(x))")) end chkstride1(A) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), @@ -1339,7 +1242,7 @@ for (fname, elty) in ((:dger_,:Float64), if m != length(x) || n != length(y) throw(DimensionMismatch("A has size ($m,$n), x has length $(length(x)), y has length $(length(y))")) end - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), @@ -1361,10 +1264,10 @@ Rank-1 update of the symmetric matrix `A` with vector `x` as `alpha*x*transpose( """ function syr! end -for (fname, elty, lib) in ((:dsyr_,:Float64,libblas), - (:ssyr_,:Float32,libblas), - (:zsyr_,:ComplexF64,liblapack), - (:csyr_,:ComplexF32,liblapack)) +for (fname, elty, lib) in ((:dsyr_,:Float64,libblastrampoline), + (:ssyr_,:Float32,libblastrampoline), + (:zsyr_,:ComplexF64,libblastrampoline), + (:csyr_,:ComplexF32,libblastrampoline)) @eval begin function syr!(uplo::AbstractChar, α::$elty, x::AbstractVector{$elty}, A::AbstractMatrix{$elty}) require_one_based_indexing(A, x) @@ -1402,7 +1305,7 @@ for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64), if length(x) != n throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))")) end - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong), uplo, n, α, x, @@ -1455,7 +1358,7 @@ for (gemm, elty) in chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($gemm), libblas), Cvoid, + ccall((@blasfunc($gemm), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -1518,7 +1421,7 @@ for (mfname, elty) in ((:dsymm_,:Float64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($mfname), libblas), Cvoid, + ccall((@blasfunc($mfname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1591,7 +1494,7 @@ for (mfname, elty) in ((:zhemm_,:ComplexF64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($mfname), libblas), Cvoid, + ccall((@blasfunc($mfname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1680,7 +1583,7 @@ for (fname, elty) in ((:dsyrk_,:Float64), k = size(A, trans == 'N' ? 2 : 1) chkstride1(A) chkstride1(C) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1738,7 +1641,7 @@ for (fname, elty, relty) in ((:zherk_, :ComplexF64, :Float64), chkstride1(A) chkstride1(C) k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1781,7 +1684,7 @@ for (fname, elty) in ((:dsyr2k_,:Float64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1848,7 +1751,7 @@ for (fname, elty1, elty2) in ((:zher2k_,:ComplexF64,:Float64), (:cher2k_,:Comple chkstride1(B) chkstride1(C) k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblas), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty1}, Ptr{$elty1}, Ref{BlasInt}, Ptr{$elty1}, Ref{BlasInt}, Ref{$elty2}, Ptr{$elty1}, Ref{BlasInt}, Clong, Clong), @@ -1962,7 +1865,7 @@ for (mmname, smname, elty) in end chkstride1(A) chkstride1(B) - ccall((@blasfunc($mmname), libblas), Cvoid, + ccall((@blasfunc($mmname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong, Clong), @@ -1992,7 +1895,7 @@ for (mmname, smname, elty) in end chkstride1(A) chkstride1(B) - ccall((@blasfunc($smname), libblas), Cvoid, + ccall((@blasfunc($smname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, diff --git a/stdlib/LinearAlgebra/src/lapack.jl b/stdlib/LinearAlgebra/src/lapack.jl index b7bfd6060ce7c..b997b13fd7c5b 100644 --- a/stdlib/LinearAlgebra/src/lapack.jl +++ b/stdlib/LinearAlgebra/src/lapack.jl @@ -5,7 +5,7 @@ module LAPACK Interfaces to LAPACK subroutines. """ LAPACK -const liblapack = Base.liblapack_name +const libblastrampoline = "libblastrampoline" import ..LinearAlgebra.BLAS.@blasfunc @@ -118,7 +118,7 @@ function version() major = Ref{BlasInt}(0) minor = Ref{BlasInt}(0) patch = Ref{BlasInt}(0) - ccall((@blasfunc(ilaver_), liblapack), Cvoid, + ccall((@blasfunc(ilaver_), libblastrampoline), Cvoid, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), major, minor, patch) return VersionNumber(major[], minor[], patch[]) @@ -144,7 +144,7 @@ for (gbtrf, gbtrs, elty) in mnmn = min(m, n) ipiv = similar(AB, BlasInt, mnmn) info = Ref{BlasInt}() - ccall((@blasfunc($gbtrf), liblapack), Cvoid, + ccall((@blasfunc($gbtrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, kl, ku, AB, max(1,stride(AB,2)), ipiv, info) @@ -170,7 +170,7 @@ for (gbtrf, gbtrs, elty) in if m != n || m != size(B,1) throw(DimensionMismatch("matrix AB has dimensions $(size(AB)), but right hand side matrix B has dimensions $(size(B))")) end - ccall((@blasfunc($gbtrs), liblapack), Cvoid, + ccall((@blasfunc($gbtrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -224,7 +224,7 @@ for (gebal, gebak, elty, relty) in ilo = Ref{BlasInt}() scale = similar(A, $relty, n) info = Ref{BlasInt}() - ccall((@blasfunc($gebal), liblapack), Cvoid, + ccall((@blasfunc($gebal), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong), job, n, A, max(1,stride(A,2)), ilo, ihi, scale, info, 1) @@ -247,7 +247,7 @@ for (gebal, gebak, elty, relty) in chkfinite(V) # balancing routines don't support NaNs and Infs n = checksquare(V) info = Ref{BlasInt}() - ccall((@blasfunc($gebak), liblapack), Cvoid, + ccall((@blasfunc($gebak), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -314,7 +314,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gebrd), liblapack), Cvoid, + ccall((@blasfunc($gebrd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -348,7 +348,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelqf), liblapack), Cvoid, + ccall((@blasfunc($gelqf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -379,7 +379,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqlf), liblapack), Cvoid, + ccall((@blasfunc($geqlf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -421,7 +421,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geqp3), liblapack), Cvoid, + ccall((@blasfunc($geqp3), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), @@ -429,7 +429,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty jpvt, tau, work, lwork, rwork, info) else - ccall((@blasfunc($geqp3), liblapack), Cvoid, + ccall((@blasfunc($geqp3), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -459,7 +459,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, nb*n) if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt), liblapack), Cvoid, + ccall((@blasfunc($geqrt), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -485,7 +485,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty end if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt3), liblapack), Cvoid, + ccall((@blasfunc($geqrt3), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1, stride(A, 2)), @@ -512,7 +512,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqrf), liblapack), Cvoid, + ccall((@blasfunc($geqrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -541,7 +541,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gerqf), liblapack), Cvoid, + ccall((@blasfunc($gerqf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -567,7 +567,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lda = max(1,stride(A, 2)) ipiv = similar(A, BlasInt, min(m,n)) info = Ref{BlasInt}() - ccall((@blasfunc($getrf), liblapack), Cvoid, + ccall((@blasfunc($getrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, A, lda, ipiv, info) @@ -774,7 +774,7 @@ for (larfg, elty) in α = Ref{$elty}(x[1]) incx = BlasInt(1) τ = Ref{$elty}(0) - ccall((@blasfunc($larfg), liblapack), Cvoid, + ccall((@blasfunc($larfg), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}), N, α, pointer(x, 2), incx, τ) @inbounds x[1] = one($elty) @@ -803,7 +803,7 @@ for (larf, elty) in ldc = max(1, stride(C, 2)) l = side == 'L' ? n : m incv = BlasInt(1) - ccall((@blasfunc($larf), liblapack), Cvoid, + ccall((@blasfunc($larf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Clong), side, m, n, v, incv, @@ -848,7 +848,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($tzrzf), liblapack), Cvoid, + ccall((@blasfunc($tzrzf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, @@ -886,7 +886,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrz), liblapack), Cvoid, + ccall((@blasfunc($ormrz), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -951,7 +951,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(undef, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gels), liblapack), Cvoid, + ccall((@blasfunc($gels), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -992,7 +992,7 @@ for (gels, gesv, getrs, getri, elty) in end ipiv = similar(A, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gesv), liblapack), Cvoid, + ccall((@blasfunc($gesv), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -1017,7 +1017,7 @@ for (gels, gesv, getrs, getri, elty) in end nrhs = size(B, 2) info = Ref{BlasInt}() - ccall((@blasfunc($getrs), liblapack), Cvoid, + ccall((@blasfunc($getrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), trans, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -1043,7 +1043,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($getri), liblapack), Cvoid, + ccall((@blasfunc($getri), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, A, lda, ipiv, work, lwork, info) @@ -1139,7 +1139,7 @@ for (gesvx, elty) in iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), liblapack), Cvoid, + ccall((@blasfunc($gesvx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1209,7 +1209,7 @@ for (gesvx, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), liblapack), Cvoid, + ccall((@blasfunc($gesvx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, @@ -1305,7 +1305,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) iwork = Vector{BlasInt}(undef, 1) for i = 1:2 # first call returns lwork as work[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), liblapack), Cvoid, + ccall((@blasfunc($gelsd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1351,7 +1351,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), liblapack), Cvoid, + ccall((@blasfunc($gelsy), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1401,7 +1401,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(undef, 1) iwork = Vector{BlasInt}(undef, 1) for i = 1:2 # first call returns lwork as work[1], rwork length as rwork[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), liblapack), Cvoid, + ccall((@blasfunc($gelsd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1449,7 +1449,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), liblapack), Cvoid, + ccall((@blasfunc($gelsy), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1524,7 +1524,7 @@ for (gglse, elty) in ((:dgglse_, :Float64), work = Vector{$elty}(undef, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gglse), liblapack), Cvoid, + ccall((@blasfunc($gglse), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1587,7 +1587,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geev), liblapack), Cvoid, + ccall((@blasfunc($geev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1595,7 +1595,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobvl, jobvr, n, A, max(1,stride(A,2)), W, VL, n, VR, n, work, lwork, rwork, info, 1, 1) else - ccall((@blasfunc($geev), liblapack), Cvoid, + ccall((@blasfunc($geev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1651,7 +1651,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesdd), liblapack), Cvoid, + ccall((@blasfunc($gesdd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1659,7 +1659,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in job, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, iwork, info, 1) else - ccall((@blasfunc($gesdd), liblapack), Cvoid, + ccall((@blasfunc($gesdd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1720,7 +1720,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesvd), liblapack), Cvoid, + ccall((@blasfunc($gesvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1728,7 +1728,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobu, jobvt, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, info, 1, 1) else - ccall((@blasfunc($gesvd), liblapack), Cvoid, + ccall((@blasfunc($gesvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1800,7 +1800,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() if cmplx - ccall((@blasfunc($ggsvd), liblapack), Cvoid, + ccall((@blasfunc($ggsvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1816,7 +1816,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in work, rwork, iwork, info, 1, 1, 1) else - ccall((@blasfunc($ggsvd), liblapack), Cvoid, + ccall((@blasfunc($ggsvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1924,7 +1924,7 @@ for (f, elty) in ((:dggsvd3_, :Float64), iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), liblapack), Cvoid, + ccall((@blasfunc($f), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1984,7 +1984,7 @@ for (f, elty, relty) in ((:zggsvd3_, :ComplexF64, :Float64), iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), liblapack), Cvoid, + ccall((@blasfunc($f), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2092,7 +2092,7 @@ for (geevx, ggev, elty) in iwork = Vector{BlasInt}(undef, iworksize) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), liblapack), Cvoid, + ccall((@blasfunc($geevx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2160,7 +2160,7 @@ for (geevx, ggev, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), liblapack), Cvoid, + ccall((@blasfunc($ggev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -2240,7 +2240,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), liblapack), Cvoid, + ccall((@blasfunc($geevx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2307,7 +2307,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(undef, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), liblapack), Cvoid, + ccall((@blasfunc($ggev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2381,7 +2381,7 @@ for (laic1, elty) in sestpr = Vector{$elty}(undef, 1) s = Vector{$elty}(undef, 1) c = Vector{$elty}(undef, 1) - ccall((@blasfunc($laic1), liblapack), Cvoid, + ccall((@blasfunc($laic1), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}), @@ -2415,7 +2415,7 @@ for (laic1, elty, relty) in sestpr = Vector{$relty}(undef, 1) s = Vector{$elty}(undef, 1) c = Vector{$elty}(undef, 1) - ccall((@blasfunc($laic1), liblapack), Cvoid, + ccall((@blasfunc($laic1), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$relty}, Ptr{$elty}, Ref{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}), @@ -2457,7 +2457,7 @@ for (gtsv, gttrf, gttrs, elty) in return B # Early exit if possible end info = Ref{BlasInt}() - ccall((@blasfunc($gtsv), liblapack), Cvoid, + ccall((@blasfunc($gtsv), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), dl, d, du, B, max(1,stride(B,2)), info) @@ -2484,7 +2484,7 @@ for (gtsv, gttrf, gttrs, elty) in du2 = similar(d, $elty, n-2) ipiv = similar(d, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gttrf), liblapack), Cvoid, + ccall((@blasfunc($gttrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), n, dl, d, du, du2, ipiv, info) @@ -2516,7 +2516,7 @@ for (gtsv, gttrf, gttrs, elty) in throw(DimensionMismatch("B has leading dimension $(size(B,1)), but should have $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($gttrs), liblapack), Cvoid, + ccall((@blasfunc($gttrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -2583,7 +2583,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orglq), liblapack), Cvoid, + ccall((@blasfunc($orglq), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -2617,7 +2617,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgqr), liblapack), Cvoid, + ccall((@blasfunc($orgqr), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2653,7 +2653,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgql), liblapack), Cvoid, + ccall((@blasfunc($orgql), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2691,7 +2691,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgrq), liblapack), Cvoid, + ccall((@blasfunc($orgrq), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2738,7 +2738,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormlq), liblapack), Cvoid, + ccall((@blasfunc($ormlq), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -2785,7 +2785,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormqr), liblapack), Cvoid, + ccall((@blasfunc($ormqr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2835,7 +2835,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormql), liblapack), Cvoid, + ccall((@blasfunc($ormql), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2885,7 +2885,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrq), liblapack), Cvoid, + ccall((@blasfunc($ormrq), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -2941,7 +2941,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in ldc = stride(C, 2) work = Vector{$elty}(undef, wss) info = Ref{BlasInt}() - ccall((@blasfunc($gemqrt), liblapack), Cvoid, + ccall((@blasfunc($gemqrt), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -3060,7 +3060,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in throw(DimensionMismatch("first dimension of B, $(size(B,1)), and size of A, ($n,$n), must match!")) end info = Ref{BlasInt}() - ccall((@blasfunc($posv), liblapack), Cvoid, + ccall((@blasfunc($posv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), B, max(1,stride(B,2)), info, 1) @@ -3085,7 +3085,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in return A, 0 end info = Ref{BlasInt}() - ccall((@blasfunc($potrf), liblapack), Cvoid, + ccall((@blasfunc($potrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, size(A,1), A, lda, info, 1) chkargsok(info[]) @@ -3106,7 +3106,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in chkstride1(A) chkuplo(uplo) info = Ref{BlasInt}() - ccall((@blasfunc($potri), liblapack), Cvoid, + ccall((@blasfunc($potri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, size(A,1), A, max(1,stride(A,2)), info, 1) chkargsok(info[]) @@ -3135,7 +3135,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in end ldb = max(1,stride(B,2)) info = Ref{BlasInt}() - ccall((@blasfunc($potrs), liblapack), Cvoid, + ccall((@blasfunc($potrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, nrhs, A, @@ -3160,7 +3160,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in rank = Vector{BlasInt}(undef, 1) work = Vector{$rtyp}(undef, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($pstrf), liblapack), Cvoid, + ccall((@blasfunc($pstrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ref{$rtyp}, Ptr{$rtyp}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), piv, rank, tol, work, info, 1) @@ -3249,7 +3249,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($ptsv), liblapack), Cvoid, + ccall((@blasfunc($ptsv), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3270,7 +3270,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("E has length $(length(E)), but needs $(n - 1)")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrf), liblapack), Cvoid, + ccall((@blasfunc($pttrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}), n, D, E, info) chklapackerror(info[]) @@ -3317,7 +3317,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), liblapack), Cvoid, + ccall((@blasfunc($pttrs), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3351,7 +3351,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), liblapack), Cvoid, + ccall((@blasfunc($pttrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), D, E, B, max(1,stride(B,2)), info, 1) @@ -3390,7 +3390,7 @@ for (trtri, trtrs, elty) in chkdiag(diag) lda = max(1,stride(A, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trtri), liblapack), Cvoid, + ccall((@blasfunc($trtri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), uplo, diag, n, A, lda, info, 1, 1) @@ -3416,7 +3416,7 @@ for (trtri, trtrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($trtrs), liblapack), Cvoid, + ccall((@blasfunc($trtrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3473,7 +3473,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), liblapack), Cvoid, + ccall((@blasfunc($trcon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3514,7 +3514,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), liblapack), Cvoid, + ccall((@blasfunc($trevc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, @@ -3571,7 +3571,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), liblapack), Cvoid, + ccall((@blasfunc($trrfs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3606,7 +3606,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), liblapack), Cvoid, + ccall((@blasfunc($trcon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3648,7 +3648,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), liblapack), Cvoid, + ccall((@blasfunc($trevc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, @@ -3705,7 +3705,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), liblapack), Cvoid, + ccall((@blasfunc($trrfs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3776,7 +3776,7 @@ for (stev, stebz, stegr, stein, elty) in Zmat = similar(dv, $elty, (n, job != 'N' ? n : 0)) work = Vector{$elty}(undef, max(1, 2n-2)) info = Ref{BlasInt}() - ccall((@blasfunc($stev), liblapack), Cvoid, + ccall((@blasfunc($stev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), job, n, dv, ev, Zmat, n, work, info, 1) @@ -3804,7 +3804,7 @@ for (stev, stebz, stegr, stein, elty) in work = Vector{$elty}(undef, 4*n) iwork = Vector{BlasInt}(undef, 3*n) info = Ref{BlasInt}() - ccall((@blasfunc($stebz), liblapack), Cvoid, + ccall((@blasfunc($stebz), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3845,7 +3845,7 @@ for (stev, stebz, stegr, stein, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($stegr), liblapack), Cvoid, + ccall((@blasfunc($stegr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3905,7 +3905,7 @@ for (stev, stebz, stegr, stein, elty) in iwork = Vector{BlasInt}(undef, n) ifail = Vector{BlasInt}(undef, m) info = Ref{BlasInt}() - ccall((@blasfunc($stein), liblapack), Cvoid, + ccall((@blasfunc($stein), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3993,7 +3993,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), liblapack), Cvoid, + ccall((@blasfunc($syconv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong, Clong), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info, 1, 1) @@ -4022,7 +4022,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4056,7 +4056,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, stride(A,2), ipiv, work, lwork, info, 1) @@ -4084,7 +4084,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), liblapack), Cvoid, +# ccall((@blasfunc($sytri), libblastrampoline), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4111,7 +4111,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4138,7 +4138,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4174,7 +4174,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4208,7 +4208,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, stride(A,2), ipiv, work, lwork, info, 1) @@ -4234,7 +4234,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4261,7 +4261,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4301,7 +4301,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), liblapack), Cvoid, + ccall((@blasfunc($syconvf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -4336,7 +4336,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), liblapack), Cvoid, + ccall((@blasfunc($syconv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong, Clong), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info, 1, 1) @@ -4365,7 +4365,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), liblapack), Cvoid, + ccall((@blasfunc($hesv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4396,7 +4396,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), liblapack), Cvoid, + ccall((@blasfunc($hetrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4425,7 +4425,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($hetri), liblapack), Cvoid, +# ccall((@blasfunc($hetri), libblastrampoline), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4453,7 +4453,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), liblapack), Cvoid, + ccall((@blasfunc($hetri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4478,7 +4478,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), liblapack), Cvoid, + ccall((@blasfunc($hetrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4513,7 +4513,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), liblapack), Cvoid, + ccall((@blasfunc($hesv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4544,7 +4544,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), liblapack), Cvoid, + ccall((@blasfunc($hetrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4571,7 +4571,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), liblapack), Cvoid, + ccall((@blasfunc($hetri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4596,7 +4596,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), liblapack), Cvoid, + ccall((@blasfunc($hetrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4632,7 +4632,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4667,7 +4667,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4696,7 +4696,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), liblapack), Cvoid, +# ccall((@blasfunc($sytri), libblastrampoline), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4723,7 +4723,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4749,7 +4749,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4785,7 +4785,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), liblapack), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4820,7 +4820,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), liblapack), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4847,7 +4847,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), liblapack), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4873,7 +4873,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), liblapack), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4915,7 +4915,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), liblapack), Cvoid, + ccall((@blasfunc($syconvf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -5048,7 +5048,7 @@ for (syev, syevr, sygvd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), liblapack), Cvoid, + ccall((@blasfunc($syev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), jobz, uplo, n, A, max(1,stride(A,2)), W, work, lwork, info, 1, 1) @@ -5099,7 +5099,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), liblapack), Cvoid, + ccall((@blasfunc($syevr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -5150,7 +5150,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), liblapack), Cvoid, + ccall((@blasfunc($sygvd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, @@ -5194,7 +5194,7 @@ for (syev, syevr, sygvd, elty, relty) in rwork = Vector{$relty}(undef, max(1, 3n-2)) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), liblapack), Cvoid, + ccall((@blasfunc($syev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong), @@ -5251,7 +5251,7 @@ for (syev, syevr, sygvd, elty, relty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), liblapack), Cvoid, + ccall((@blasfunc($syevr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -5308,7 +5308,7 @@ for (syev, syevr, sygvd, elty, relty) in lrwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), liblapack), Cvoid, + ccall((@blasfunc($sygvd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, @@ -5409,7 +5409,7 @@ for (bdsqr, relty, elty) in # Allocate work = Vector{$relty}(undef, 4n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsqr), liblapack), Cvoid, + ccall((@blasfunc($bdsqr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5480,7 +5480,7 @@ for (bdsdc, elty) in work = Vector{$elty}(undef, lwork) iwork = Vector{BlasInt}(undef, 8n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsdc), liblapack), Cvoid, + ccall((@blasfunc($bdsdc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -5532,7 +5532,7 @@ for (gecon, elty) in work = Vector{$elty}(undef, 4n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), liblapack), Cvoid, + ccall((@blasfunc($gecon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), @@ -5566,7 +5566,7 @@ for (gecon, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), liblapack), Cvoid, + ccall((@blasfunc($gecon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong), @@ -5609,7 +5609,7 @@ for (gehrd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gehrd), liblapack), Cvoid, + ccall((@blasfunc($gehrd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5660,7 +5660,7 @@ for (orghr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orghr), liblapack), Cvoid, + ccall((@blasfunc($orghr), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5717,7 +5717,7 @@ for (ormhr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormhr), liblapack), Cvoid, + ccall((@blasfunc($ormhr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5763,7 +5763,7 @@ for (hetrd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrd), liblapack), Cvoid, + ccall((@blasfunc($hetrd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -5813,7 +5813,7 @@ for (orgtr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgtr), liblapack), Cvoid, + ccall((@blasfunc($orgtr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -5871,7 +5871,7 @@ for (ormtr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormtr), liblapack), Cvoid, + ccall((@blasfunc($ormtr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5916,7 +5916,7 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), liblapack), Cvoid, + ccall((@blasfunc($gees), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5961,7 +5961,7 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), liblapack), Cvoid, + ccall((@blasfunc($gges), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6011,7 +6011,7 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), liblapack), Cvoid, + ccall((@blasfunc($gees), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -6057,7 +6057,7 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(undef, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), liblapack), Cvoid, + ccall((@blasfunc($gges), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6122,7 +6122,7 @@ for (trexc, trsen, tgsen, elty) in ldq = max(1, stride(Q, 2)) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), liblapack), Cvoid, + ccall((@blasfunc($trexc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -6164,7 +6164,7 @@ for (trexc, trsen, tgsen, elty) in s = Ref{$elty}(zero($elty)) sep = Ref{$elty}(zero($elty)) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($trsen), liblapack), Cvoid, + ccall((@blasfunc($trsen), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, @@ -6229,7 +6229,7 @@ for (trexc, trsen, tgsen, elty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), liblapack), Cvoid, + ccall((@blasfunc($tgsen), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, @@ -6273,7 +6273,7 @@ for (trexc, trsen, tgsen, elty, relty) in ldt = max(1, stride(T, 2)) ldq = max(1, stride(Q, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), liblapack), Cvoid, + ccall((@blasfunc($trexc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -6311,7 +6311,7 @@ for (trexc, trsen, tgsen, elty, relty) in s = Ref{$relty}(zero($relty)) sep = Ref{$relty}(zero($relty)) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($trsen), liblapack), Cvoid, + ccall((@blasfunc($trsen), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, @@ -6373,7 +6373,7 @@ for (trexc, trsen, tgsen, elty, relty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), liblapack), Cvoid, + ccall((@blasfunc($tgsen), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6459,7 +6459,7 @@ for (fn, elty, relty) in ((:dtrsyl_, :Float64, :Float64), ldc = max(1, stride(C, 2)) scale = Vector{$relty}(undef, 1) info = Ref{BlasInt}() - ccall((@blasfunc($fn), liblapack), Cvoid, + ccall((@blasfunc($fn), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong), diff --git a/stdlib/LinearAlgebra/src/lbt.jl b/stdlib/LinearAlgebra/src/lbt.jl new file mode 100644 index 0000000000000..4ed93188d1f61 --- /dev/null +++ b/stdlib/LinearAlgebra/src/lbt.jl @@ -0,0 +1,141 @@ +## This file contains libblastrampoline-specific APIs + +# Keep these in sync with `src/libblastrampoline_internal.h` +struct lbt_library_info_t + libname::Cstring + handle::Ptr{Cvoid} + suffix::Cstring + active_forwards::Ptr{UInt8} + interface::Int32 + f2c::Int32 +end +const LBT_INTERFACE_LP64 = 32 +const LBT_INTERFACE_ILP64 = 64 +const LBT_INTERFACE_UNKNOWN = -1 +const LBT_INTERFACE_MAP = Dict( + LBT_INTERFACE_LP64 => :lp64, + LBT_INTERFACE_ILP64 => :ilp64, + LBT_INTERFACE_UNKNOWN => :unknown, +) + +const LBT_F2C_PLAIN = 0 +const LBT_F2C_REQUIRED = 1 +const LBT_F2C_UNKNOWN = -1 +const LBT_F2C_MAP = Dict( + LBT_F2C_PLAIN => :plain, + LBT_F2C_REQUIRED => :required, + LBT_F2C_UNKNOWN => :unknown, +) + +struct LBTLibraryInfo + libname::String + handle::Ptr{Cvoid} + suffix::String + active_forwards::Vector{UInt8} + interface::Symbol + f2c::Symbol + + function LBTLibraryInfo(lib_info::lbt_library_info_t, num_exported_symbols::UInt32) + return new( + unsafe_string(lib_info.libname), + lib_info.handle, + unsafe_string(lib_info.suffix), + unsafe_wrap(Vector{UInt8}, lib_info.active_forwards, div(num_exported_symbols,8)+1), + LBT_INTERFACE_MAP[lib_info.interface], + LBT_F2C_MAP[lib_info.f2c], + ) + end +end + +struct lbt_config_t + loaded_libs::Ptr{Ptr{lbt_library_info_t}} + build_flags::UInt32 + exported_symbols::Ptr{Cstring} + num_exported_symbols::UInt32 +end +const LBT_BUILDFLAGS_DEEPBINDLESS = 0x01 +const LBT_BUILDFLAGS_F2C_CAPABLE = 0x02 +const LBT_BUILDFLAGS_MAP = Dict( + LBT_BUILDFLAGS_DEEPBINDLESS => :deepbindless, + LBT_BUILDFLAGS_F2C_CAPABLE => :f2c_capable, +) + +struct LBTConfig + loaded_libs::Vector{LBTLibraryInfo} + build_flags::Vector{Symbol} + exported_symbols::Vector{String} + + function LBTConfig(config::lbt_config_t) + # Decode OR'ed flags into a list of names + build_flag_names = Symbol[] + for (flag, name) in LBT_BUILDFLAGS_MAP + if config.build_flags & flag != 0x00 + push!(build_flag_names, name) + end + end + + # Load all exported symbol names + exported_symbols = String[] + for sym_idx in 1:config.num_exported_symbols + str_ptr = unsafe_load(config.exported_symbols, sym_idx) + if str_ptr != C_NULL + push!(exported_symbols, unsafe_string(str_ptr)) + else + @error("NULL string in lbt_config.exported_symbols[$(sym_idx)]") + end + end + + # Unpack library info structures + libs = LBTLibraryInfo[] + idx = 1 + lib_ptr = unsafe_load(config.loaded_libs, idx) + while lib_ptr != C_NULL + push!(libs, LBTLibraryInfo(unsafe_load(lib_ptr), config.num_exported_symbols)) + + idx += 1 + lib_ptr = unsafe_load(config.loaded_libs, idx) + end + return new( + libs, + build_flag_names, + exported_symbols, + ) + end +end + +function lbt_get_config() + config_ptr = ccall((:lbt_get_config, libblastrampoline), Ptr{lbt_config_t}, ()) + return LBTConfig(unsafe_load(config_ptr)) +end + +function lbt_get_num_threads() + return ccall((:lbt_get_num_threads, libblastrampoline), Int32, ()) +end + +function lbt_set_num_threads(nthreads) + return ccall((:lbt_set_num_threads, libblastrampoline), Cvoid, (Int32,), nthreads) +end + +function lbt_forward(path; clear::Bool = false, verbose::Bool = false) + ccall((:lbt_forward, libblastrampoline), Int32, (Cstring, Int32, Int32), path, clear ? 1 : 0, verbose ? 1 : 0) +end + +function lbt_set_default_func(addr) + return ccall((:lbt_set_default_func, libblastrampoline), Cvoid, (Ptr{Cvoid},), addr) +end + +function lbt_get_default_func() + return ccall((:lbt_get_default_func, libblastrampoline), Ptr{Cvoid}, ()) +end + +#= +Don't define footgun API (yet) + +function lbt_get_forward(symbol_name, interface, f2c = LBT_F2C_PLAIN) + return ccall((:lbt_get_forward, libblastrampoline), Ptr{Cvoid}, (Cstring, Int32, Int32), symbol_name, interface, f2c) +end + +function lbt_set_forward(symbol_name, addr, interface, f2c = LBT_F2C_PLAIN; verbose::Bool = false) + return ccall((:lbt_set_forward, libblastrampoline), Int32, (Cstring, Ptr{Cvoid}, Int32, Int32, Int32), symbol_name, addr, interface, f2c, verbose ? 1 : 0) +end +=# \ No newline at end of file diff --git a/stdlib/LinearAlgebra/test/blas.jl b/stdlib/LinearAlgebra/test/blas.jl index 61fd62b6be353..6c2b27f9a53a5 100644 --- a/stdlib/LinearAlgebra/test/blas.jl +++ b/stdlib/LinearAlgebra/test/blas.jl @@ -598,23 +598,6 @@ end @test BLAS.get_num_threads() === 1 BLAS.set_num_threads(default) @test BLAS.get_num_threads() === default - - @test_logs (:warn,) match_mode=:any BLAS._set_num_threads(1, _blas=:unknown) - if BLAS.guess_vendor() !== :osxblas - # test osxblas which is not covered by CI - withenv("VECLIB_MAXIMUM_THREADS" => nothing) do - @test @test_logs( - (:warn,), - (:warn,), - match_mode=:any, - BLAS._get_num_threads(_blas=:osxblas), - ) === nothing - @test_logs BLAS._set_num_threads(1, _blas=:osxblas) - @test @test_logs(BLAS._get_num_threads(_blas=:osxblas)) === 1 - @test_logs BLAS._set_num_threads(2, _blas=:osxblas) - @test @test_logs(BLAS._get_num_threads(_blas=:osxblas)) === 2 - end - end end end # module TestBLAS diff --git a/stdlib/Makefile b/stdlib/Makefile index aae674101f380..718c18842f086 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -16,8 +16,8 @@ $(build_datarootdir)/julia/stdlib/$(VERSDIR): mkdir -p $@ JLLS = DSFMT GMP CURL LIBGIT2 LLVM LIBSSH2 LIBUV MBEDTLS MPFR NGHTTP2 \ - OPENBLAS OPENLIBM P7ZIP PCRE SUITESPARSE ZLIB LLVMUNWIND CSL \ - UNWIND + BLASTRAMPOLINE OPENBLAS OPENLIBM P7ZIP PCRE SUITESPARSE ZLIB \ + LLVMUNWIND CSL UNWIND # Initialize this with JLLs that aren't in deps/Versions.make JLL_NAMES := MozillaCACerts_jll diff --git a/stdlib/OpenBLAS_jll/Project.toml b/stdlib/OpenBLAS_jll/Project.toml index 89be91c5367a7..e732272c12e09 100644 --- a/stdlib/OpenBLAS_jll/Project.toml +++ b/stdlib/OpenBLAS_jll/Project.toml @@ -8,4 +8,4 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [compat] -julia = "1.6" +julia = "1.7" diff --git a/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl b/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl index 89ff6c897072a..c69f3a262b298 100644 --- a/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl +++ b/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl @@ -17,7 +17,7 @@ artifact_dir = "" libopenblas_handle = C_NULL libopenblas_path = "" -if Sys.WORD_SIZE == 64 +if Base.USE_BLAS64 const libsuffix = "64_" else const libsuffix = "" diff --git a/stdlib/OpenBLAS_jll/test/runtests.jl b/stdlib/OpenBLAS_jll/test/runtests.jl index c97c4ef0054a5..1d944bab8cd67 100644 --- a/stdlib/OpenBLAS_jll/test/runtests.jl +++ b/stdlib/OpenBLAS_jll/test/runtests.jl @@ -2,7 +2,16 @@ using Test, Libdl, OpenBLAS_jll +if Base.USE_BLAS64 + macro blasfunc(x) + return Expr(:quote, Symbol(x, "64_")) + end +else + macro blasfunc(x) + return Expr(:quote, x) + end +end + @testset "OpenBLAS_jll" begin - @test dlsym(OpenBLAS_jll.libopenblas_handle, :openblas_set_num_threads; throw_error=false) !== nothing || - dlsym(OpenBLAS_jll.libopenblas_handle, :openblas_set_num_threads64_; throw_error=false) !== nothing + @test dlsym(OpenBLAS_jll.libopenblas_handle, @blasfunc(openblas_set_num_threads); throw_error=false) != nothing end diff --git a/stdlib/SuiteSparse/Project.toml b/stdlib/SuiteSparse/Project.toml index bacb81664bc3f..0312b1625f7e3 100644 --- a/stdlib/SuiteSparse/Project.toml +++ b/stdlib/SuiteSparse/Project.toml @@ -6,6 +6,7 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +SuiteSparse_jll = "bea87d4a-7f5b-5778-9afe-8cc45184846c" [extras] DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" diff --git a/stdlib/SuiteSparse_jll/Project.toml b/stdlib/SuiteSparse_jll/Project.toml index b6db8f1d0eacd..6b704c4bf1112 100644 --- a/stdlib/SuiteSparse_jll/Project.toml +++ b/stdlib/SuiteSparse_jll/Project.toml @@ -1,11 +1,12 @@ name = "SuiteSparse_jll" uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "5.4.1+3" +version = "5.8.1+0" [deps] -OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363" +libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [compat] -julia = "1.6" +julia = "1.7" diff --git a/stdlib/SuiteSparse_jll/src/SuiteSparse_jll.jl b/stdlib/SuiteSparse_jll/src/SuiteSparse_jll.jl index 3af14d9da2776..19cf398feec25 100644 --- a/stdlib/SuiteSparse_jll/src/SuiteSparse_jll.jl +++ b/stdlib/SuiteSparse_jll/src/SuiteSparse_jll.jl @@ -2,7 +2,7 @@ ## dummy stub for https://github.com/JuliaBinaryWrappers/SuiteSparse_jll.jl baremodule SuiteSparse_jll -using Base, Libdl, OpenBLAS_jll +using Base, Libdl, libblastrampoline_jll Base.Experimental.@compiler_options compile=min optimize=0 infer=false const PATH_list = String[] diff --git a/stdlib/SuiteSparse_jll/test/runtests.jl b/stdlib/SuiteSparse_jll/test/runtests.jl index e4ad58c74d285..60e5cf74d6534 100644 --- a/stdlib/SuiteSparse_jll/test/runtests.jl +++ b/stdlib/SuiteSparse_jll/test/runtests.jl @@ -3,5 +3,5 @@ using Test, SuiteSparse_jll @testset "SuiteSparse_jll" begin - @test ccall((:SuiteSparse_version, libsuitesparseconfig), Cint, (Ptr{Cint},), C_NULL) == 5004 + @test ccall((:SuiteSparse_version, libsuitesparseconfig), Cint, (Ptr{Cint},), C_NULL) == 5008 end diff --git a/stdlib/libblastrampoline_jll/Project.toml b/stdlib/libblastrampoline_jll/Project.toml new file mode 100644 index 0000000000000..131131e52c633 --- /dev/null +++ b/stdlib/libblastrampoline_jll/Project.toml @@ -0,0 +1,12 @@ +name = "libblastrampoline_jll" +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "3.0.0+0" + +[deps] +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363" + +[compat] +julia = "1.7" diff --git a/stdlib/libblastrampoline_jll/src/libblastrampoline_jll.jl b/stdlib/libblastrampoline_jll/src/libblastrampoline_jll.jl new file mode 100644 index 0000000000000..77882067ed633 --- /dev/null +++ b/stdlib/libblastrampoline_jll/src/libblastrampoline_jll.jl @@ -0,0 +1,46 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +## dummy stub for https://github.com/JuliaBinaryWrappers/libblastrampoline_jll.jl + +baremodule libblastrampoline_jll +using Base, Libdl +Base.Experimental.@compiler_options compile=min optimize=0 infer=false + +const PATH_list = String[] +const LIBPATH_list = String[] + +export libblastrampoline + +# These get calculated in __init__() +const PATH = Ref("") +const LIBPATH = Ref("") +artifact_dir = "" +libblastrampoline_handle = C_NULL +libblastrampoline_path = "" + +const libblastrampoline = if Sys.iswindows() + "libblastrampoline.dll" +elseif Sys.isapple() + "@rpath/libblastrampoline.dylib" +else + "libblastrampoline.so" +end + +function __init__() + global libblastrampoline_handle = dlopen(libblastrampoline) + global libblastrampoline_path = dlpath(libblastrampoline_handle) + global artifact_dir = dirname(Sys.BINDIR) + LIBPATH[] = dirname(libblastrampoline_path) + push!(LIBPATH_list, LIBPATH[]) +end + +# JLLWrappers API compatibility shims. Note that not all of these will really make sense. +# For instance, `find_artifact_dir()` won't actually be the artifact directory, because +# there isn't one. It instead returns the overall Julia prefix. +is_available() = true +find_artifact_dir() = artifact_dir +dev_jll() = error("stdlib JLLs cannot be dev'ed") +best_wrapper = nothing +get_libblastrampoline_path() = libblastrampoline_path + +end # module libblastrampoline_jll diff --git a/stdlib/libblastrampoline_jll/test/runtests.jl b/stdlib/libblastrampoline_jll/test/runtests.jl new file mode 100644 index 0000000000000..80095e70f0c76 --- /dev/null +++ b/stdlib/libblastrampoline_jll/test/runtests.jl @@ -0,0 +1,7 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +using Test, Libdl, libblastrampoline_jll + +@testset "libblastrampoline_jll" begin + @test isa(Libdl.dlsym(Libdl.dlopen(:libblastrampoline), :dgemm_64_), Ptr{Nothing}) +end