Skip to content

Commit

Permalink
Update link order (#1826)
Browse files Browse the repository at this point in the history
`-lopenblas` should precede `-libgsl -lgslcblas` to avoid that COSMA loads a not optimized gemm routine for libgsl.
  • Loading branch information
mkrack committed Mar 23, 2022
1 parent ae9f668 commit 32b7924
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions arch/Linux-gnu-aarch64.psmp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,18 @@ ifneq ($(USE_SCALAPACK),)
endif
endif

ifneq ($(USE_OPENBLAS),)
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
CFLAGS += -I$(OPENBLAS_INC)
ifeq ($(SHARED), yes)
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
else
LIBS += $(OPENBLAS_LIB)/libopenblas.a
endif
endif

ifneq ($(USE_GSL),)
USE_GSL := $(strip $(USE_GSL))
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
Expand All @@ -336,18 +348,6 @@ ifneq ($(USE_GSL),)
endif
endif

ifneq ($(USE_OPENBLAS),)
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
CFLAGS += -I$(OPENBLAS_INC)
ifeq ($(SHARED), yes)
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
else
LIBS += $(OPENBLAS_LIB)/libopenblas.a
endif
endif

CFLAGS += $(DFLAGS)

FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
Expand Down
24 changes: 12 additions & 12 deletions arch/Linux-gnu-x86_64.psmp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ ifneq ($(USE_SCALAPACK),)
endif
endif

ifneq ($(USE_OPENBLAS),)
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
CFLAGS += -I$(OPENBLAS_INC)
ifeq ($(SHARED), yes)
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
else
LIBS += $(OPENBLAS_LIB)/libopenblas.a
endif
endif

ifneq ($(USE_GSL),)
USE_GSL := $(strip $(USE_GSL))
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
Expand All @@ -346,18 +358,6 @@ ifneq ($(USE_GSL),)
endif
endif

ifneq ($(USE_OPENBLAS),)
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
CFLAGS += -I$(OPENBLAS_INC)
ifeq ($(SHARED), yes)
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
else
LIBS += $(OPENBLAS_LIB)/libopenblas.a
endif
endif

CFLAGS += $(DFLAGS)

FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
Expand Down

0 comments on commit 32b7924

Please sign in to comment.