Skip to content

Commit

Permalink
fix JuliaLang#5574, maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Jun 22, 2014
1 parent e8bb5b8 commit 0d98451
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ end
function check_blas()
blas = blas_vendor()
if blas == :openblas
@windows_only ccall((:gotoblas_init, Base.libblas_name), Void, ())
openblas_config = openblas_get_config()
openblas64 = ismatch(r".*USE64BITINT.*", openblas_config)
if Base.USE_BLAS64 != openblas64
Expand Down
1 change: 1 addition & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ endif
ifneq ($(OPENBLAS_VER),develop)
patch openblas-$(OPENBLAS_VER)/exports/Makefile < openblas-exports-makefile.patch
endif
cd openblas-$(OPENBLAS_VER) && patch -p1 < ../openblas-dllinit-safe.patch
echo 1 > $@
$(OPENBLAS_OBJ_SOURCE): openblas-$(OPENBLAS_VER)/config.status
$(MAKE) -C openblas-$(OPENBLAS_VER) $(OPENBLAS_BUILD_OPTS) || (echo "*** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild with 'make OPENBLAS_USE_THREAD=0 if OpenBLAS had trouble linking libpthread.so, and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were errors building SandyBridge support. Both these options can also be used simultaneously. ***" && false)
Expand Down
36 changes: 36 additions & 0 deletions deps/openblas-dllinit-safe.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--- xianyi-OpenBLAS-347dded/exports/gensymbol 2014-06-10 09:55:47.000000000 -0400
+++ openblas-v0.2.9/exports/gensymbol 2014-06-21 19:27:06.368557354 -0400
@@ -81,6 +81,8 @@
@misc_no_underscore_objs = (
goto_set_num_threads,
openblas_get_config,
+ gotoblas_init,
+ gotoblas_quit,
);

@misc_underscore_objs = (
--- xianyi-OpenBLAS-347dded/exports/dllinit.c 2014-06-10 09:55:47.000000000 -0400
+++ openblas-v0.2.9/exports/dllinit.c 2014-06-21 19:26:44.416558346 -0400
@@ -44,7 +44,7 @@
BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {

if (reason == DLL_PROCESS_ATTACH) {
- gotoblas_init();
+ //gotoblas_init();
}

if (reason == DLL_PROCESS_DETACH) {
--- xianyi-OpenBLAS-347dded/driver/others/memory.c 2014-06-10 09:55:47.000000000 -0400
+++ openblas-v0.2.9/driver/others/memory.c 2014-06-21 23:12:11.851946992 -0400
@@ -136,7 +136,11 @@

#define BITMASK(a, b, c) ((((a) >> (b)) & (c)))

+#ifdef OS_WINDOWS
+#define CONSTRUCTOR
+#else
#define CONSTRUCTOR __attribute__ ((constructor))
+#endif
#define DESTRUCTOR __attribute__ ((destructor))

#ifdef DYNAMIC_ARCH

0 comments on commit 0d98451

Please sign in to comment.