Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{compiler}[AOMP/11.12-0] Add AOMP compiler module #12018

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions easybuild/easyconfigs/a/AOMP/AOMP-11.12-0-GCCcore-9.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
easyblock = 'Binary'

name = 'AOMP'
version = '11.12-0'

homepage = 'https://github.com/ROCm-Developer-Tools/aomp'
description = "AMD fork of LLVM, setup for OpenMP offloading to Accelerators"

toolchain = {'name': 'GCCcore', 'version': '9.3.0'}

source_urls = ['https://github.com/ROCm-Developer-Tools/aomp/releases/download/rel_%(version)s/']
sources = ['aomp-%(version)s.tar.gz']
patches = ['build_aomp-%(version)s.patch']
checksums = [
'b01bbed55c4851cfebc69d5be42bafdfb8b43b82e0b6715fe5e1e86db47272e2', # aomp-11.12-0.tar.gz
'c5ccdd00e270731a353461a8f158cdec556689742d501163c8059e739d0588b7', # build_aomp-11.12-0.patch
]

builddependencies = [
('CMake', '3.16.4'),
('Perl', '5.30.2'),
('Python', '3.8.2'),
('pkg-config', '0.29.2'),
]

dependencies = [
('binutils', '2.34'),
('libffi', '3.3'),
('numactl', '2.0.13'),
]

extract_sources = True
dontcreateinstalldir = True

preinstallopts = 'AOMP=%(installdir)s '
preinstallopts += 'AOMP_REPOS="%(builddir)s/aomp%(version_major)s" '
preinstallopts += 'AOMP_CHECK_GIT_BRANCH=0 '
preinstallopts += 'AOMP_APPLY_ROCM_PATCHES=0 '
preinstallopts += 'AOMP_STANDALONE_BUILD=1 '
preinstallopts += 'NUM_THREADS=%(parallel)s '
preinstallopts += 'AOMP_BUILD_CUDA=0'

# Core components that must be built for the compiler to work
local_comps = ['roct', 'rocr', 'project', 'libdevice', 'extras', 'openmp',
'pgmath', 'flang', 'flang_runtime', 'comgr', 'rocminfo']
# Debug components, (optional)
# The debugging compoentes require additonal build dependences:
# texinfo, bison, flex, ncurses, expat, xz, libbabeltrace
# local_comps += ['rocdbgapi', 'rocgdb']
# Profiling components, (optional)
# local_comps += ['roctracer', 'rocprofiler']
install_cmd = "./aomp/bin/build_aomp.sh select %s" % ' '.join(local_comps)

sanity_check_paths = {
'files': ['bin/clang', 'bin/ld.lld', 'include/omp.h'],
'dirs': ['amdgcn', 'bin', 'include', 'lib'],
}

moduleclass = 'compiler'
63 changes: 63 additions & 0 deletions easybuild/easyconfigs/a/AOMP/AOMP-11.12-0-gcccuda-2019b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
easyblock = 'Binary'

name = 'AOMP'
version = '11.12-0'

homepage = 'https://github.com/ROCm-Developer-Tools/aomp'
description = "AMD fork of LLVM, setup for OpenMP offloading to Accelerators"

toolchain = {'name': 'gcccuda', 'version': '2019b'}

source_urls = ['https://github.com/ROCm-Developer-Tools/aomp/releases/download/rel_%(version)s/']
sources = ['aomp-%(version)s.tar.gz']
patches = ['build_aomp-%(version)s.patch']
checksums = [
'b01bbed55c4851cfebc69d5be42bafdfb8b43b82e0b6715fe5e1e86db47272e2', # aomp-11.12-0.tar.gz
'c5ccdd00e270731a353461a8f158cdec556689742d501163c8059e739d0588b7', # build_aomp-11.12-0.patch
]

builddependencies = [
('CMake', '3.15.3'),
('Perl', '5.30.0'),
('Python', '3.7.4'),
('pkg-config', '0.29.2'),
]

dependencies = [
('binutils', '2.32'),
('libffi', '3.2.1'),
('numactl', '2.0.12'),
]

extract_sources = True
dontcreateinstalldir = True

preinstallopts = 'AOMP=%(installdir)s '
preinstallopts += 'AOMP_REPOS="%(builddir)s/aomp%(version_major)s" '
preinstallopts += 'AOMP_CHECK_GIT_BRANCH=0 '
preinstallopts += 'AOMP_APPLY_ROCM_PATCHES=0 '
preinstallopts += 'AOMP_STANDALONE_BUILD=1 '
preinstallopts += 'NUM_THREADS=%(parallel)s'
# 'NVPTXGPUS' should be set to the NVPTX architecture you would like to
# support, e.g. '50,75'.
preinstallopts += ' AOMP_BUILD_CUDA=1 '
preinstallopts += 'CUDA="$CUDA_ROOT" '
preinstallopts += 'NVPTXGPUS="70"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be configurable. Does it support 7.0 or sm_70 format? Then you can use the templates cuda_compute_capabilities etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the pre-configured targets, I assumed one had to use whole numbers only.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, then I'd say an EasyBlock is better here. I'm afraid short of patching the EC (e.g. via hooks) this would limit the GPU usability unusually, especially after we introduced the --cuda-compute-capabilities option
This has the additional benefit that those hard-coded, repeated preinstallopts can be unified and handled better (e.g. detecting presence of CUDA)


# Core components that must be built for the compiler to work
local_comps = ['roct', 'rocr', 'project', 'libdevice', 'extras', 'openmp',
'pgmath', 'flang', 'flang_runtime', 'comgr', 'rocminfo']
# Debug components, (optional)
# The debugging compoentes require additonal build dependences:
# texinfo, bison, flex, ncurses, expat, xz, libbabeltrace
# local_comps += ['rocdbgapi', 'rocgdb']
# Profiling components, (optional)
# local_comps += ['roctracer', 'rocprofiler']
install_cmd = "./aomp/bin/build_aomp.sh select %s" % ' '.join(local_comps)

sanity_check_paths = {
'files': ['bin/clang', 'bin/ld.lld', 'include/omp.h'],
'dirs': ['amdgcn', 'bin', 'include', 'lib'],
}

moduleclass = 'compiler'
68 changes: 68 additions & 0 deletions easybuild/easyconfigs/a/AOMP/build_aomp-11.12-0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Patch to support EB number of threads, remove hard coded path for GCC and
support EB version of GCC
--- a/aomp/bin/aomp_common_vars
+++ b/aomp/bin/aomp_common_vars
@@ -128,16 +128,16 @@ GFXLIST=${GFXLIST:-"gfx700 gfx701 gfx801 gfx803 gfx900 gfx902 gfx906 gfx908"}
export GFXLIST

# Calculate the number of threads to use for make
-NUM_THREADS=
if [ ! -z `which "getconf"` ]; then
- NUM_THREADS=$(`which "getconf"` _NPROCESSORS_ONLN)
+ _THREADS=$(`which "getconf"` _NPROCESSORS_ONLN)
if [ "$AOMP_PROC" == "ppc64le" ] ; then
- NUM_THREADS=8
+ _THREADS=8
fi
if [ "$AOMP_PROC" == "aarch64" ] ; then
- NUM_THREADS=$(( NUM_THREADS / 4))
+ _THREADS=$(( _THREADS / 4))
fi
fi
+NUM_THREADS=${NUM_THREADS:-$_THREADS}

# These are the web sites where the AOMP git repos are pulled from
GITROC="https://github.com/radeonopencompute"

--- a/aomp/bin/build_aomp.sh
+++ b/aomp/bin/build_aomp.sh
@@ -28,19 +28,6 @@ thisdir=$(getdname $0)
# --- end standard header ----

function build_aomp_component() {
- osversion=$(cat /etc/os-release | grep -e ^VERSION_ID)
-
- if [[ $osversion =~ '"7.' ]]; then
- echo "OS version 7 found `cat /etc/os-release`"
- [ -f /opt/rh/devtoolset-7/enable ] && . /opt/rh/devtoolset-7/enable
- elif [[ $osversion =~ '"8' ]]; then
- echo "OS version 8 found `cat /etc/os-release`"
- echo
- echo "Get updated gcc 8: export PATH=/usr/bin:\$PATH"
- export PATH=/usr/bin:$PATH
- gcc --version
- fi
-
$AOMP_REPOS/$AOMP_REPO_NAME/bin/build_$COMPONENT.sh "$@"
rc=$?
if [ $rc != 0 ] ; then

--- a/aomp/bin/build_openmp.sh
+++ b/aomp/bin/build_openmp.sh
@@ -88,14 +88,14 @@ function getgcc9orless(){
_loc=`which gcc`
[ "$_loc" == "" ] && return
gccver=`$_loc --version | grep gcc | cut -d")" -f2 | cut -d"." -f1`
- [ $gccver -gt $GCCMIN ] && _loc=`which gcc-$GCCMIN`
+ [ $gccver -gt $GCCMIN ]
echo $_loc
}
function getgxx9orless(){
_loc=`which g++`
[ "$_loc" == "" ] && return
gxxver=`$_loc --version | grep g++ | cut -d")" -f2 | cut -d"." -f1`
- [ $gxxver -gt $GCCMIN ] && _loc=`which g++-$GCCMIN`
+ [ $gxxver -gt $GCCMIN ]
echo $_loc
}