Skip to content

Commit

Permalink
fix race condition when building OpenBLAS
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed May 12, 2023
1 parent 657b86c commit 4a94993
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
19 changes: 19 additions & 0 deletions EESSI-pilot-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,25 @@ fi

echo_green "All set, let's start installing some software in ${EASYBUILD_INSTALLPATH}..."

# we try to use a modified ec file for OpenBLAS shipped with this PR
if [[ $GENERIC -eq 1 ]]; then
echo ">> Installing modified OpenBLAS..."
ok_msg="Done with OpenBLAS (GENERIC architecture)!"
fail_msg="Installation of OpenBLAS (GENERIC architecture) failed!"
echo_yellow ">> Using https://github.com/easybuilders/easybuild-easyblocks/pull/1946 to build generic OpenBLAS."
#$EB --include-easyblocks-from-pr 1946 OpenBLAS-0.3.15-GCC-10.3.0.eb --robot
$EB --include-easyblocks easyblocks/o/openblas-pr1946-cc74e45.py ./OpenBLAS-0.3.15-GCC-10.3.0.eb --robot
check_exit_code $? "${ok_msg}" "${fail_msg}"
else
echo ">> Installing modified OpenBLAS..."
ok_msg="Done with OpenBLAS (NON-GENERIC architecture)!"
fail_msg="Installation of OpenBLAS (NON-GENERIC architecture) failed!"
echo_yellow ">> Using https://github.com/easybuilders/easybuild-easyblocks/pull/1946 to build generic OpenBLAS."
#$EB --include-easyblocks-from-pr 1946 OpenBLAS-0.3.15-GCC-10.3.0.eb --robot
$EB ./OpenBLAS-0.3.15-GCC-10.3.0.eb --robot
check_exit_code $? "${ok_msg}" "${fail_msg}"
fi

# add OpenBLAS: requires special handling for GENERIC CPU targets
# If we're building OpenBLAS for GENERIC, we need https://github.com/easybuilders/easybuild-easyblocks/pull/1946
if [[ $GENERIC -eq 1 ]]; then
Expand Down
38 changes: 38 additions & 0 deletions OpenBLAS-0.3.15-GCC-10.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name = 'OpenBLAS'
version = '0.3.15'

homepage = 'https://xianyi.github.com/OpenBLAS/'
description = "OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version."

toolchain = {'name': 'GCC', 'version': '10.3.0'}

source_urls = [
# order matters, trying to download the large.tgz/timing.tgz LAPACK tarballs from GitHub causes trouble
'https://www.netlib.org/lapack/timing/',
'https://github.com/xianyi/OpenBLAS/archive/',
]
sources = ['v%(version)s.tar.gz']
patches = [
('large.tgz', '.'),
('timing.tgz', '.'),
'OpenBLAS-%(version)s_icelake-detection.patch',
'OpenBLAS-%(version)s_fix-aarch64.patch',
'OpenBLAS-%(version)s_workaround-gcc-miscompilation.patch',
'patches/OpenBLAS-%(version)s_fix-race-build-targets.patch',

]
checksums = [
'30a99dec977594b387a17f49904523e6bc8dd88bd247266e83485803759e4bbe', # v0.3.15.tar.gz
'f328d88b7fa97722f271d7d0cfea1c220e0f8e5ed5ff01d8ef1eb51d6f4243a1', # large.tgz
'999c65f8ea8bd4eac7f1c7f3463d4946917afd20a997807300fe35d70122f3af', # timing.tgz
'aa96e1c3b1532dbafe4b6e8591688ef200e99304a902851f342cb9d467219762', # OpenBLAS-0.3.15_icelake-detection.patch
'ba7bd45af9fe0516f8c9b1cf047eec7b833996e481bc925d4fb2563865d3db38', # OpenBLAS-0.3.15_fix-aarch64.patch
# OpenBLAS-0.3.15_workaround-gcc-miscompilation.patch
'e6b326fb8c4a8a6fd07741d9983c37a72c55c9ff9a4f74a80e1352ce5f975971',
'7478ea187620591c0485bcc713a31d9667c19b0a90a7b2391e8cbffc5281d250', # OpenBLAS-0.3.15_fix-race-build-targets.patch
]

# extensive testing can be enabled by uncommenting the line below
# runtest = 'PATH=.:$PATH lapack-timing'

moduleclass = 'numlib'
14 changes: 14 additions & 0 deletions patches/fix-race-build-targets.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/Makefile b/Makefile
index 555d1c46..d90c2d37 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,9 @@ SUBDIRS_ALL = $(SUBDIRS) test ctest utest exports benchmark ../laswp ../bench cp
.PHONY : all libs netlib $(RELA) test ctest shared install
.NOTPARALLEL : all libs $(RELA) prof lapack-test install blas-test

+shared: libs netlib $(RELA)
+tests: libs netlib $(RELA) shared
+
all :: libs netlib $(RELA) tests shared
@echo
@echo " OpenBLAS build complete. ($(LIB_COMPONENTS))"

0 comments on commit 4a94993

Please sign in to comment.