[llvm-commits] [zorg] r153337 - /zorg/trunk/zorg/buildbot/builders/PollyBuilder.py

Tobias Grosser grosser at fim.uni-passau.de
Fri Mar 23 06:28:53 PDT 2012


Author: grosser
Date: Fri Mar 23 08:28:53 2012
New Revision: 153337

URL: http://llvm.org/viewvc/llvm-project?rev=153337&view=rev
Log:
Add PollyLNTBuilder

Modified:
    zorg/trunk/zorg/buildbot/builders/PollyBuilder.py

Modified: zorg/trunk/zorg/buildbot/builders/PollyBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/PollyBuilder.py?rev=153337&r1=153336&r2=153337&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/PollyBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/PollyBuilder.py Fri Mar 23 08:28:53 2012
@@ -6,6 +6,9 @@
 from buildbot.steps.shell import Configure, ShellCommand
 from buildbot.process.properties import WithProperties
 
+from zorg.buildbot.builders import LNTBuilder
+from zorg.buildbot.builders import ClangBuilder
+
 def installRequiredLibs(f, polly_src):
 
     cloog_installdir = "cloog.install"
@@ -91,3 +94,103 @@
                                description=["test polly"],
                                workdir=llvm_objdir))
     return f
+
+def AddExternalPollyBuildFactory(f, llvm_installdir):
+    cloog_installdir = 'cloog.install'
+
+    polly_srcdir = 'polly.src'
+    polly_objdir = 'polly.obj'
+    polly_installdir = 'polly.install'
+    build_type = 'Release'
+
+    # Determine the build directory.
+    f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir",
+                                               command=["pwd"],
+                                               property="builddir",
+                                               description="set build dir",
+                                               workdir="."))
+    f.addStep(SVN(name='svn-polly',
+                  mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/polly/',
+                  defaultBranch='trunk',
+                  workdir=polly_srcdir))
+
+    # Install Prerequisites
+    installRequiredLibs(f, polly_srcdir)
+
+    # Create configuration files with cmake
+    f.addStep(ShellCommand(name="create-build-dir",
+                               command=["mkdir", "-p", polly_objdir],
+                               haltOnFailure=False,
+                               description=["create build dir"],
+                               workdir="."))
+    cmakeCommand = ["cmake", "../%s" % polly_srcdir]
+
+    cmakeCommand.append(WithProperties("-DCMAKE_PREFIX_PATH=%%(builddir)s/%s"
+                        % cloog_installdir))
+    cmakeCommand.append('-DLLVM_INSTALL_ROOT=../' + llvm_installdir)
+    cmakeCommand.append('-DCMAKE_BUILD_TYPE=../' + build_type)
+    cmakeCommand.append('-DCMAKE_INSTALL_PREFIX=../' + polly_installdir)
+    cmakeCommand.append('-DCMAKE_COLOR_MAKEFILE=OFF')
+
+    f.addStep(ShellCommand(name="cmake-configure",
+                               command=cmakeCommand,
+                               haltOnFailure=False,
+                               description=["cmake configure"],
+                               workdir=polly_objdir))
+    # Build Polly
+    f.addStep(ShellCommand(name="build-polly",
+                               command=["make"],
+                               haltOnFailure=True,
+                               description=["build polly"],
+                               workdir=polly_objdir))
+    f.addStep(ShellCommand(name="remove-polly-install",
+                           command=["rm", "-rf", polly_installdir],
+                           haltOnFailure=True,
+                           description=["remove polly install"],
+                           workdir="."))
+    f.addStep(ShellCommand(name="install-polly",
+                           command=["make", "install"],
+                           haltOnFailure=True,
+                           description=["install polly"],
+                           workdir=polly_objdir))
+
+def getPollyLNTFactory(triple, nt_flags, xfails=[], clean=True, test=False,
+                  **kwargs):
+    lnt_args = {}
+    lnt_arg_names = ['submitURL', 'package_cache']
+
+    for argname in lnt_arg_names:
+        if argname in kwargs:
+            lnt_args[argname] = kwargs.pop(argname)
+
+    llvm_install_dir = 'llvm.install.1'
+
+    f = ClangBuilder.getClangBuildFactory(
+        triple, outOfDir=True, clean=clean, test=test,
+        always_install=False, stage1_config='Release+Asserts', **kwargs)
+
+    f.addStep(ShellCommand(name="install-llvm-and-clang",
+                           command=["make", "install"],
+                           haltOnFailure=True,
+                           description=["install llvm and clang"],
+                           workdir="llvm.obj"))
+
+    AddExternalPollyBuildFactory(f, llvm_install_dir)
+
+    nt_flags.append('--cflag=' + '-Xclang')
+    nt_flags.append('--cflag=' + '-load')
+    nt_flags.append('--cflag=' + '-Xclang')
+    nt_flags.append(WithProperties("--cflag=%s/polly.install/lib/LLVMPolly.so",
+                                   'builddir'))
+
+    lnt_args['env'] = {'LD_LIBRARY_PATH': WithProperties("%s/cloog.install/lib",
+                                   'builddir')}
+
+    # Add an LNT test runner.
+    LNTBuilder.AddLNTTestsToFactory(f, nt_flags,
+                                    cc_path=(llvm_install_dir+'/bin/clang'),
+                                    cxx_path=(llvm_install_dir+'/bin/clang++'),
+                                    **lnt_args);
+
+    return f





More information about the llvm-commits mailing list