1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

gildas: use internal LAPACK instead of OpenBLAS

Gildas' uv_fit task segfaults when it uses OpenBLAS. Use internal
LAPACK version instead.
This commit is contained in:
Sebastien Maret 2018-06-26 17:15:51 +02:00
parent ba2f45c182
commit 7b01e2b7d6
2 changed files with 4 additions and 100 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, gtk2-x11 , pkgconfig , python27 , gfortran , lesstif
, cfitsio , getopt , perl , groff , which , openblas
, cfitsio , getopt , perl , groff , which
}:
let
@ -20,14 +20,14 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig groff perl getopt gfortran which ];
buildInputs = [ gtk2-x11 lesstif cfitsio python27Env openblas ];
buildInputs = [ gtk2-x11 lesstif cfitsio python27Env ];
patches = [ ./wrapper.patch ./return-error-code.patch ./openblas.patch ./clang.patch ];
patches = [ ./wrapper.patch ./return-error-code.patch ./clang.patch ];
configurePhase=''
substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out
substituteInPlace admin/wrapper.sh --replace '%%PYTHONHOME%%' ${python27Env}
source admin/gildas-env.sh -c gfortran -o openmp -s ${openblas}/lib
source admin/gildas-env.sh -c gfortran -o openmp
echo "gag_doc: $out/share/doc/" >> kernel/etc/gag.dico.lcl
'';

View file

@ -1,96 +0,0 @@
diff -ruN gildas-src-may18a.orig/admin/gildas-env.sh gildas-src-may18a/admin/gildas-env.sh
--- gildas-src-may18a.orig/admin/gildas-env.sh 2018-04-24 18:20:08.000000000 +0200
+++ gildas-src-may18a/admin/gildas-env.sh 2018-05-04 16:39:18.982253471 +0200
@@ -430,7 +430,7 @@
# dot (e.g. so.3 is not counted), because e.g. /usr/lib64/liblapack.so.3
# is useless and can not be found by the linker on command lines like
# "-L/usr/lib -llapack"
- occurences=`\ls ${2}/${1}* 2> /dev/null | \grep -v "${2}/${1}.*\." | \wc -l`
+ occurences=`\ls -l ${2}/${1}{so,a,h} 2> /dev/null | \wc -l`
if [ ${occurences} -ge 1 ]; then
\return 0
else
@@ -458,11 +458,9 @@
SDM_MISSING=
#
for DIR in $GAGENV_SEARCH_PATH; do
- if file_present "liblapack." "${DIR}"; then
+ if file_present "libopenblas." "${DIR}"; then
LAPACK_PRESENT=yes
LAPACK_LIB_DIR=$DIR
- fi
- if file_present "libblas." "${DIR}"; then
BLAS_PRESENT=yes
BLAS_LIB_DIR=$DIR
fi
@@ -493,7 +491,7 @@
X11_LIB=no
#
for DIR in $INC_PATH; do
- if file_present "X.h" "${DIR}/X11"; then
+ if file_present "X." "${DIR}/X11"; then
X11_INC=yes
X11_INC_DIR=$DIR
fi
diff -ruN gildas-src-may18a.orig/admin/Makefile.build gildas-src-may18a/admin/Makefile.build
--- gildas-src-may18a.orig/admin/Makefile.build 2018-03-19 17:48:07.000000000 +0100
+++ gildas-src-may18a/admin/Makefile.build 2018-05-04 16:39:18.982253471 +0200
@@ -398,9 +398,7 @@
# only the shared libraries are installed (i.e. the corresponding archive
# libraries are missing).
--lblas:
-
--llapack:
+-lopenblas:
-lslatec:
diff -ruN gildas-src-may18a.orig/admin/Makefile.def gildas-src-may18a/admin/Makefile.def
--- gildas-src-may18a.orig/admin/Makefile.def 2018-03-21 17:53:34.000000000 +0100
+++ gildas-src-may18a/admin/Makefile.def 2018-05-04 16:41:59.233518207 +0200
@@ -206,7 +206,7 @@
###########################################################################
# Other defaults
-LINEAR = lapack
+LINEAR = openblas
GLOBAL_DIRTY = $(builddir) *~ TAGS ChangeLog* Makefile.bak
###########################################################################
@@ -515,7 +515,7 @@
###########################################################################
# Kernel libraries
-LEGACY_LIBS = -lslatec -llapack -lblas
+LEGACY_LIBS = -lslatec -lopenblas
_GAG_LIBS = -lggui -lgcore -lgio -lgfits -lgwcs -lgmath -lgsys -lginc
ifndef GAG_WIN32
GAG_LIBS = $(_GAG_LIBS)
diff -ruN gildas-src-may18a.orig/legacy/slatec/Makefile gildas-src-may18a/legacy/slatec/Makefile
--- gildas-src-may18a.orig/legacy/slatec/Makefile 2014-12-09 11:31:56.000000000 +0100
+++ gildas-src-may18a/legacy/slatec/Makefile 2018-05-04 16:39:18.982253471 +0200
@@ -24,7 +24,7 @@
U-all.o V-all.o W-all.o X-all.o Y-all.o Z-all.o d1mach.o i1mach.o pimach.o \
r1mach.o dummy.o P-all.o P-value.o Dp-1vlu.o
-LIB_DEPENDS = -llapack -lblas
+LIB_DEPENDS = -lopenblas
ifeq ($(GAG_COMPILER_FKIND),ifc)
OPTION_FFLAGS =
diff -ruN gildas-src-may18a.orig/packages/clic/lib/Makefile gildas-src-may18a/packages/clic/lib/Makefile
--- gildas-src-may18a.orig/packages/clic/lib/Makefile 2018-01-16 11:53:15.000000000 +0100
+++ gildas-src-may18a/packages/clic/lib/Makefile 2018-05-04 16:39:18.982253471 +0200
@@ -56,9 +56,9 @@
sg_line_table.o table_passband.o clic_index.o clic_blank.o
# Mathematical library dependency
-ifeq ($(LINEAR),lapack)
+ifeq ($(LINEAR),openblas)
LINEAR_LIB_OBJECTS = singular.o mth_lapack.o
- LINEAR_LIB_DEPENDS = -llapack -lblas
+ LINEAR_LIB_DEPENDS = -lopenblas
else
ifeq ($(LINEAR),nag)
LINEAR_LIB_OBJECTS = mth_nag.o