From d8da1eb2ce16606436d57dfd290b4038fa1b4fce Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Wed, 13 Jan 2016 04:58:05 +0100 Subject: [PATCH 1/4] Need the -frecursive flag. --- openblas.spec | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/openblas.spec b/openblas.spec index ad43275..c935a97 100644 --- a/openblas.spec +++ b/openblas.spec @@ -331,19 +331,21 @@ TARGET="TARGET=ARMV7 DYNAMIC_ARCH=0" TARGET="TARGET=POWER8 DYNAMIC_ARCH=0" %endif -make -C serial $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblas" $AVX $LAPACKE INTERFACE64=0 -make -C threaded $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblasp" $AVX $LAPACKE INTERFACE64=0 +# Declare some necessary build flags +FLAGS="FC=gfortran CC=gcc COMMON_OPT=\"%{optflags}\" FCOMMON_OPT=\"-frecursive\"" +make -C serial $TARGET USE_THREAD=0 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblas" $AVX $LAPACKE INTERFACE64=0 +make -C threaded $TARGET USE_THREAD=1 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblasp" $AVX $LAPACKE INTERFACE64=0 # USE_THREAD determines use of SMP, not of pthreads -make -C openmp $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblaso" $AVX $LAPACKE INTERFACE64=0 +make -C openmp $TARGET USE_THREAD=1 USE_OPENMP=1 $FLAGS $NMAX LIBPREFIX="libopenblaso" $AVX $LAPACKE INTERFACE64=0 %if %build64 -make -C serial64 $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblas64" $AVX $LAPACKE INTERFACE64=1 -make -C threaded64 $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblasp64" $AVX $LAPACKE INTERFACE64=1 -make -C openmp64 $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblaso64" $AVX $LAPACKE INTERFACE64=1 +make -C serial64 $TARGET USE_THREAD=0 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblas64" $AVX $LAPACKE INTERFACE64=1 +make -C threaded64 $TARGET USE_THREAD=1 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblasp64" $AVX $LAPACKE INTERFACE64=1 +make -C openmp64 $TARGET USE_THREAD=1 USE_OPENMP=1 $FLAGS $NMAX LIBPREFIX="libopenblaso64" $AVX $LAPACKE INTERFACE64=1 -make -C serial64_ $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblas64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ -make -C threaded64_ $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblasp64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ -make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" $NMAX LIBPREFIX="libopenblaso64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C serial64_ $TARGET USE_THREAD=0 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblas64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C threaded64_ $TARGET USE_THREAD=1 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblasp64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 $FLAGS $NMAX LIBPREFIX="libopenblaso64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ %endif %install @@ -587,6 +589,9 @@ rm -rf %{buildroot} %endif %changelog +* Tue Jan 12 2016 Susi Lehtola - 0.2.15-5 +- Need to use -frecursive to make LAPACK thread safe. + * Tue Jan 12 2016 Susi Lehtola - 0.2.15-4 - Add version to bundled lapack provide. From 83523aa38eba7f222a2bffd2ac53844e5f00b8f3 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Wed, 13 Jan 2016 05:14:11 +0100 Subject: [PATCH 2/4] Need the -frecursive flag. --- openblas.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openblas.spec b/openblas.spec index c935a97..71716fe 100644 --- a/openblas.spec +++ b/openblas.spec @@ -4,7 +4,7 @@ Name: openblas Version: 0.2.15 -Release: 4%{?dist} +Release: 5%{?dist} Summary: An optimized BLAS library based on GotoBLAS2 Group: Development/Libraries License: BSD From 02ddbf251b423e91ec1d6b3730700cc2f4e29d38 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Wed, 13 Jan 2016 05:33:13 +0100 Subject: [PATCH 3/4] I guess I do need to expand this --- openblas.spec | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/openblas.spec b/openblas.spec index 71716fe..4353740 100644 --- a/openblas.spec +++ b/openblas.spec @@ -332,20 +332,19 @@ TARGET="TARGET=POWER8 DYNAMIC_ARCH=0" %endif # Declare some necessary build flags -FLAGS="FC=gfortran CC=gcc COMMON_OPT=\"%{optflags}\" FCOMMON_OPT=\"-frecursive\"" -make -C serial $TARGET USE_THREAD=0 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblas" $AVX $LAPACKE INTERFACE64=0 -make -C threaded $TARGET USE_THREAD=1 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblasp" $AVX $LAPACKE INTERFACE64=0 +make -C serial $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas" $AVX $LAPACKE INTERFACE64=0 +make -C threaded $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp" $AVX $LAPACKE INTERFACE64=0 # USE_THREAD determines use of SMP, not of pthreads -make -C openmp $TARGET USE_THREAD=1 USE_OPENMP=1 $FLAGS $NMAX LIBPREFIX="libopenblaso" $AVX $LAPACKE INTERFACE64=0 +make -C openmp $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso" $AVX $LAPACKE INTERFACE64=0 %if %build64 -make -C serial64 $TARGET USE_THREAD=0 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblas64" $AVX $LAPACKE INTERFACE64=1 -make -C threaded64 $TARGET USE_THREAD=1 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblasp64" $AVX $LAPACKE INTERFACE64=1 -make -C openmp64 $TARGET USE_THREAD=1 USE_OPENMP=1 $FLAGS $NMAX LIBPREFIX="libopenblaso64" $AVX $LAPACKE INTERFACE64=1 +make -C serial64 $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas64" $AVX $LAPACKE INTERFACE64=1 +make -C threaded64 $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp64" $AVX $LAPACKE INTERFACE64=1 +make -C openmp64 $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso64" $AVX $LAPACKE INTERFACE64=1 -make -C serial64_ $TARGET USE_THREAD=0 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblas64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ -make -C threaded64_ $TARGET USE_THREAD=1 USE_OPENMP=0 $FLAGS $NMAX LIBPREFIX="libopenblasp64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ -make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 $FLAGS $NMAX LIBPREFIX="libopenblaso64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C serial64_ $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C threaded64_ $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ %endif %install From bd39a7baf44ed35ae7664f58c541a4a9ce17af12 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Wed, 13 Jan 2016 05:46:17 +0100 Subject: [PATCH 4/4] Need -fPIC too. --- openblas.spec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openblas.spec b/openblas.spec index 4353740..40236a6 100644 --- a/openblas.spec +++ b/openblas.spec @@ -332,19 +332,19 @@ TARGET="TARGET=POWER8 DYNAMIC_ARCH=0" %endif # Declare some necessary build flags -make -C serial $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas" $AVX $LAPACKE INTERFACE64=0 -make -C threaded $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp" $AVX $LAPACKE INTERFACE64=0 +make -C serial $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas" $AVX $LAPACKE INTERFACE64=0 +make -C threaded $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp" $AVX $LAPACKE INTERFACE64=0 # USE_THREAD determines use of SMP, not of pthreads -make -C openmp $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso" $AVX $LAPACKE INTERFACE64=0 +make -C openmp $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso" $AVX $LAPACKE INTERFACE64=0 %if %build64 -make -C serial64 $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas64" $AVX $LAPACKE INTERFACE64=1 -make -C threaded64 $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp64" $AVX $LAPACKE INTERFACE64=1 -make -C openmp64 $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso64" $AVX $LAPACKE INTERFACE64=1 +make -C serial64 $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas64" $AVX $LAPACKE INTERFACE64=1 +make -C threaded64 $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp64" $AVX $LAPACKE INTERFACE64=1 +make -C openmp64 $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso64" $AVX $LAPACKE INTERFACE64=1 -make -C serial64_ $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ -make -C threaded64_ $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ -make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags}" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C serial64_ $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblas64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C threaded64_ $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblasp64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ +make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="%{optflags} -fPIC" FCOMMON_OPT="-frecursive" $NMAX LIBPREFIX="libopenblaso64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_ %endif %install