diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -1261,6 +1261,58 @@ 'CC': 'ccache clang', 'CXX': 'ccache clang++', 'CCACHE_CPP2': 'yes', })}, + {'name' : "openmp-offload-cuda-project", + 'tags' : ["openmp"], + 'workernames' : ["minipc-1050ti-linux"], + 'builddir': "openmp-offload-cuda-project", + 'factory' : OpenMPBuilder.getOpenMPCMakeBuildFactory( + clean=False, + enable_runtimes=[], + extraCmakeArgs=[ + "-DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda", + "-DLIBOMPTARGET_BUILD_NVPTX_BCLIB=ON", + "-DCLANG_ENABLE_STATIC_ANALYZER=OFF", + "-DCLANG_ENABLE_ARCMT=OFF", + "-DCLANG_ENABLE_OBJC_REWRITER=OFF", + "-DLLVM_TARGETS_TO_BUILD=X86;NVPTX", + "-DLLVM_ENABLE_LLD=ON", + '-DLLVM_PARALLEL_LINK_JOBS=2', + ], + install=True, + testsuite=True, + testsuite_sollvevv=True, + extraTestsuiteCmakeArgs=[ + "-DTEST_SUITE_SOLLVEVV_OFFLOADING_CFLAGS=-fopenmp-targets=nvptx64-nvidia-cuda;--cuda-path=/opt/cuda", + "-DTEST_SUITE_SOLLVEVV_OFFLOADING_LDFLAGS=-fopenmp-targets=nvptx64-nvidia-cuda;--cuda-path=/opt/cuda", + ], + )}, + + {'name' : "openmp-offload-cuda-runtime", + 'tags' : ["openmp"], + 'workernames' : ["minipc-1050ti-linux"], + 'builddir': "openmp-offload-cuda-runtime", + 'factory' : OpenMPBuilder.getOpenMPCMakeBuildFactory( + clean=False, + enable_runtimes=['openmp'], + extraCmakeArgs=[ + "-DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda", + "-DLIBOMPTARGET_BUILD_NVPTX_BCLIB=ON", + "-DCLANG_ENABLE_STATIC_ANALYZER=OFF", + "-DCLANG_ENABLE_ARCMT=OFF", + "-DCLANG_ENABLE_OBJC_REWRITER=OFF", + "-DLLVM_TARGETS_TO_BUILD=X86;NVPTX", + "-DLLVM_ENABLE_LLD=ON", + '-DLLVM_PARALLEL_LINK_JOBS=2', + ], + install=True, + testsuite=True, + testsuite_sollvevv=True, + extraTestsuiteCmakeArgs=[ + "-DTEST_SUITE_SOLLVEVV_OFFLOADING_CFLAGS=-fopenmp-targets=nvptx64-nvidia-cuda;--cuda-path=/opt/cuda", + "-DTEST_SUITE_SOLLVEVV_OFFLOADING_LDFLAGS=-fopenmp-targets=nvptx64-nvidia-cuda;--cuda-path=/opt/cuda", + ], + )}, + # Libc++ builders. {'name': 'libcxx-libcxxabi-x86_64-linux-debian', diff --git a/buildbot/osuosl/master/config/workers.py b/buildbot/osuosl/master/config/workers.py --- a/buildbot/osuosl/master/config/workers.py +++ b/buildbot/osuosl/master/config/workers.py @@ -228,6 +228,9 @@ # Ubuntu 18.04.LTS x86_64, Intel(R) Xeon(R) CPU X3460 @ 2.80GHz, 32 GiB RAM create_worker("polly-x86_64-fdcserver", properties={'jobs': 8, 'loadaverage': 8}, max_builds=1), + # Ubuntu 20.04.LTS x86_64, Intel(R) Core(TM) i5-9400F CPU @ 2.90Ghz, 16 GiB RAM, NVIDIA GeForce GTX 1050 Ti (Pascal, sm_61, 4GiB) + create_worker("minipc-1050ti-linux", properties={'jobs': 6}, max_builds=1), + create_worker("nersc-flang"), create_worker("alcf-theta-flang", properties={'jobs': 12}, max_builds=1), diff --git a/zorg/buildbot/builders/OpenMPBuilder.py b/zorg/buildbot/builders/OpenMPBuilder.py --- a/zorg/buildbot/builders/OpenMPBuilder.py +++ b/zorg/buildbot/builders/OpenMPBuilder.py @@ -1,5 +1,6 @@ from buildbot.steps.shell import ShellCommand from buildbot.process.properties import WithProperties +from buildbot.plugins import steps from zorg.buildbot.commands.LitTestCommand import LitTestCommand from zorg.buildbot.commands.CmakeCommand import CmakeCommand @@ -14,6 +15,12 @@ ompt = False, # Whether to enable the OpenMP Tools Interface. test = True, # Test the built libraries. depends_on_projects = None, + enable_runtimes = None, + extraCmakeArgs = [], + install = False, + testsuite = False, + testsuite_sollvevv = False, + extraTestsuiteCmakeArgs = [], **kwargs): # Prepare environmental variables. Set here all env we want everywhere. @@ -26,15 +33,21 @@ llvm_srcdir = 'llvm.src' llvm_builddir = 'llvm.build' + llvm_instdir = 'llvm.inst' + testsuite_srcdir = "test-suite.src" + testsuite_builddir = "test-suite.build" + sollvevv_srcdir = "sollvevv.src" cleanBuildRequested = lambda step: clean or step.build.getProperty("clean", default=step.build.getProperty("clean_obj")) if depends_on_projects is None: # Monorepo configuration requires llvm and clang to get cmake work. depends_on_projects = ['llvm', 'clang', 'openmp'] + depends_on_projects += [p for p in runtime_projects if p not in depends_on_projects] f = UnifiedTreeBuilder.getLLVMBuildFactoryAndSourcecodeSteps( depends_on_projects=depends_on_projects, + enable_runtimes=enable_runtimes, llvm_srcdir=llvm_srcdir, obj_dir=llvm_builddir, cleanBuildRequested=cleanBuildRequested, @@ -58,10 +71,19 @@ if test: lit_args = '-vv --show-unsupported --show-xfail -j %s' % jobs cmake_args += [WithProperties('-DLLVM_LIT_ARGS=%s' % lit_args)] + if install: + cmake_args += [WithProperties('-DCMAKE_INSTALL_PREFIX=%(builddir)s/' + llvm_instdir)] + cmake_args += extraCmakeArgs - CmakeCommand.applyRequiredOptions(cmake_args, [ - ('-DLLVM_ENABLE_PROJECTS=', ";".join(f.depends_on_projects)), - ]) + if f.enable_projects: + CmakeCommand.applyDefaultOptions(cmake_args, [ + ('-DLLVM_ENABLE_PROJECTS=', ";".join(f.enable_projects)), + ]) + + if f.enable_runtimes: + CmakeCommand.applyDefaultOptions(cmake_args, [ + ('-DLLVM_ENABLE_RUNTIMES=', ";".join(f.enable_runtimes)), + ]) # Add llvm-lit and clang (if built) to PATH merged_env.update({ @@ -103,6 +125,121 @@ description = 'test openmp', workdir = f.obj_dir, env = merged_env, - haltOnFailure=True)) + haltOnFailure=False, + flunkOnFailure=True)) + + clangexe = "%(builddir)s/" + llvm_builddir + "/bin/clang" + clangxxexe = "%(builddir)s/" + llvm_builddir + "/bin/clang++" + litexe = "%(builddir)s/" + llvm_builddir + "/bin/llvm-lit" + libdir = "%(builddir)s/" + llvm_builddir + "/lib" + if install: + f.addStep(steps.RemoveDirectory(name="LLVM: Clean Install Dir", + dir=llvm_instdir, + haltOnFailure=False)) + + f.addStep(NinjaCommand(name="LLVM: Install", + description="installing", + descriptionDone="install", + descriptionSuffix="LLVM", + workdir=f.obj_dir, + targets=['install'], + env=merged_env, + haltOnFailure=True)) + # If installing, use the installed version of clang. + clangexe = "%(builddir)s/" + llvm_instdir + "/bin/clang" + clangxxexe = "%(builddir)s/" + llvm_instdir + "/bin/clang++" + libdir = "%(builddir)s/" + llvm_instdir + "/lib" + + + if testsuite: + f.addStep(steps.RemoveDirectory(name="Test-Suite: Clean Source", + dir=testsuite_srcdir, + haltOnFailure=False, + warnOnFailure=True, + doStepIf=cleanBuildRequested)) + + f.addGetSourcecodeForProject(name="Test-Suite: Checkout", + description="fetching", + descriptionDone="fetch", + descriptionSuffix="Test-Suite", + project='test-suite', + src_dir=testsuite_srcdir, + alwaysUseLatest=True) + + if testsuite_sollvevv: + f.addStep(steps.RemoveDirectory(name="SOLLVE V&V: Clean Source", + dir=sollvevv_srcdir, + haltOnFailure=False, + warnOnFailure=True, + doStepIf=cleanBuildRequested)) + + f.addStep(steps.Git(name="SOLLVE V&V: Checkout", + description="fetching", + descriptionDone="fetch", + descriptionSuffix="SOLLVE V&V", + repourl='https://github.com/SOLLVE/sollve_vv.git', + workdir=sollvevv_srcdir, + alwaysUseLatest=True)) + + f.addStep(steps.RemoveDirectory(name="Test-Suite: Clean Build", + dir=testsuite_builddir, + haltOnFailure=False, + warnOnFailure=True)) + + testsuite_options = [ + "-DCMAKE_BUILD_TYPE=Release", + "-DTEST_SUITE_LIT_FLAGS=-vv;-s;-j6;-o;report.json", + "-DTEST_SUITE_EXTRA_C_FLAGS=-gline-tables-only", + "-DTEST_SUITE_EXTRA_CXX_FLAGS=-gline-tables-only", + WithProperties("-DCMAKE_C_COMPILER=" + clangexe), + WithProperties("-DCMAKE_CXX_COMPILER=" + clangxxexe), + WithProperties("-DTEST_SUITE_LIT=" + litexe), + ] + if testsuite_sollvevv: + testsuite_options += [ + "-DTEST_SUITE_SUBDIRS=External/sollve_vv", + "-DTEST_SUITE_SOLLVEVV_ROOT=../" + sollvevv_srcdir, + ] + testsuite_options += extraTestsuiteCmakeArgs + f.addStep(CmakeCommand(name="Test-Suite: Configure", + description="configuring", + descriptionDone="configure", + descriptionSuffix="Test-Suite", + generator='Ninja', + path='../' + testsuite_srcdir, + workdir=testsuite_builddir, + options=testsuite_options, + haltOnFailure=True, + logfiles={ + 'CMakeCache.txt' : 'CMakeCache.txt', + })) + + f.addStep(NinjaCommand(name="Test-Suite: Compile", + description="compiling", + descriptionDone="compile", + descriptionSuffix="Test-Suite", + options=['-k0'], # Continue building; programs that don't compile will fail with NOEXE. + haltOnFailure=False, + flunkOnFailure=False, # SOLLVE V&V contains tests that clang have not been implemented yet. + warnOnFailure=True, + workdir=testsuite_builddir)) + + merged_env.update({ + 'LD_LIBRARY_PATH': WithProperties(libdir + ':${LD_LIBRARY_PATH}') + }) + f.addStep(LitTestCommand(name="Test-Suite: Run", + description="running", + descriptionDone="run", + descriptionSuffix="Test-Suite", + command=[WithProperties(litexe), '-vv', '-s', '-j6', '-o','report.json', '.'], + haltOnFailure=False, + flunkOnFailure=False, # SOLLVE V&V contains tests that clang have not been implemented yet. + warnOnFailure=True, + workdir=testsuite_builddir, + env=merged_env, + logfiles={ + 'test.log' : 'test.log', + 'report.json': 'report.json' + })) return f