Skip to content

Commit

Permalink
Add tests for alternative OS/compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Jun 5, 2019
1 parent 3e60c14 commit 93a3ce5
Show file tree
Hide file tree
Showing 9 changed files with 304 additions and 19 deletions.
242 changes: 242 additions & 0 deletions .CI/Jenkinsfile.more-compilers
@@ -0,0 +1,242 @@
def common
pipeline {
agent none
options {
newContainerPerStage()
}
environment {
LC_ALL = 'C.UTF-8'
}
// stages are ordered according to execution time; highest time first
// nodes are selected based on a priority (in Jenkins config)
stages {
stage('Environment') {
agent {
label 'linux'
}
steps {
script {
if (changeRequest()) {
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
}
common = load("${env.workspace}/.CI/common.groovy")
}
}
}
stage('builds') {
parallel {
stage('clang-32bit') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache-32'
label 'linux'
args "--mount type=volume,source=runtest-clang-32-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary " +
"--privileged"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
steps {
script {
common.buildOMC('clang', 'clang++', '--without-hwloc')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
// gcc-4.9 jessie
stage('gcc-4.9 (Debian Jessie)') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache-jessie'
label 'linux'
args "--mount type=volume,source=runtest-gcc-4.9-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
HOME = "/cache/runtest"
}
steps {
script {
// Otherwise old git fails to clone...
sh 'git config --global user.name OpenModelica'
sh 'git config --global user.email openmodelica@ida.liu.se'
common.buildOMC('gcc-4.9', 'g++-4.9', '--without-hwloc')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
stage('clang-3.5 (Debian Jessie)') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache-jessie'
label 'linux'
args "--mount type=volume,source=runtest-clang-3.5-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
HOME = "/cache/runtest"
}
steps {
script {
// Otherwise old git fails to clone...
sh 'git config --global user.name OpenModelica'
sh 'git config --global user.email openmodelica@ida.liu.se'
common.buildOMC('clang-3.5', 'clang++-3.5', '--without-hwloc')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
// gcc-5 Ubuntu Xenial
stage('gcc-5') {
steps {
print "Ubuntu Xenial GCC 5 tested on every pull request"
}
}
stage('clang-3.8 (Ubuntu Xenial)') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache-xenial'
label 'linux'
args "--mount type=volume,source=runtest-clang-3.8-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
steps {
script {
common.buildOMC('clang-3.8', 'clang++-3.8', '--without-hwloc')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
// gcc-6 Debian stretch
stage('gcc-6 (Debian Stretch)') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache-stretch'
label 'linux'
args "--mount type=volume,source=runtest-gcc-6-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
steps {
script {
common.buildOMC('gcc-6', 'g++-6', '--without-hwloc')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
// clang 3.8 also in Debian stretch...
// gcc-7 Ubuntu Bionic
stage('gcc-7 (Ubuntu Bionic)') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache'
label 'linux'
args "--mount type=volume,source=runtest-gcc-7-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
steps {
script {
common.buildOMC('gcc-7', 'g++-7', '--without-hwloc')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
stage('clang-6.0') {
steps {
print "Ubuntu Bionic clang 6.0 tested on every pull request"
}
}
// gcc-8 in Ubuntu Disco
stage('gcc-8 (Ubuntu Disco)') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache-disco'
label 'linux'
args "--mount type=volume,source=runtest-gcc-8-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
steps {
script {
common.buildOMC('gcc-8', 'g++-8', '')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
stage('clang-8 (Ubuntu Disco)') {
agent {
dockerfile {
additionalBuildArgs '--pull'
dir '.CI/cache-disco'
label 'linux'
args "--mount type=volume,source=runtest-clang-8-cache,target=/cache/runtest " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
steps {
script {
common.buildOMC('clang-8', 'clang++-8', '')
common.makeLibsAndCache()
common.buildGUI('')
common.partest()
}
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions .CI/cache-32/Dockerfile
@@ -0,0 +1,6 @@
# Cannot be parametrized in Jenkins...
FROM docker.openmodelica.org/build-deps:v1.13-i386

# We don't know the uid of the user who will build, so make the /cache directories world writable

RUN mkdir -p /cache/runtest/ /cache/omlibrary/ && chmod ugo+rwx /cache/runtest/ /cache/omlibrary/
6 changes: 6 additions & 0 deletions .CI/cache-disco/Dockerfile
@@ -0,0 +1,6 @@
# Cannot be parametrized in Jenkins...
FROM docker.openmodelica.org/build-deps:v1.13-disco

# We don't know the uid of the user who will build, so make the /cache directories world writable

RUN mkdir -p /cache/runtest/ /cache/omlibrary/ && chmod ugo+rwx /cache/runtest/ /cache/omlibrary/
6 changes: 6 additions & 0 deletions .CI/cache-jessie/Dockerfile
@@ -0,0 +1,6 @@
# Cannot be parametrized in Jenkins...
FROM docker.openmodelica.org/build-deps:v1.13-jessie

# We don't know the uid of the user who will build, so make the /cache directories world writable

RUN mkdir -p /cache/runtest/ /cache/omlibrary/ && chmod ugo+rwx /cache/runtest/ /cache/omlibrary/
6 changes: 6 additions & 0 deletions .CI/cache-stretch/Dockerfile
@@ -0,0 +1,6 @@
# Cannot be parametrized in Jenkins...
FROM docker.openmodelica.org/build-deps:v1.13-stretch

# We don't know the uid of the user who will build, so make the /cache directories world writable

RUN mkdir -p /cache/runtest/ /cache/omlibrary/ && chmod ugo+rwx /cache/runtest/ /cache/omlibrary/
18 changes: 14 additions & 4 deletions .CI/common.groovy
Expand Up @@ -5,36 +5,46 @@ void standardSetup() {
}

def numPhysicalCPU() {
if (env.JENKINS_NUM_PHYSICAL_CPU) {
return env.JENKINS_NUM_PHYSICAL_CPU
}
def uname = sh script: 'uname', returnStdout: true
if (uname.startsWith("Darwin")) {
return sh (
env.JENKINS_NUM_PHYSICAL_CPU = sh (
script: 'sysctl hw.physicalcpu_max | cut -d" " -f2',
returnStdout: true
).trim().toInteger() ?: 1
} else {
return sh (
env.JENKINS_NUM_PHYSICAL_CPU = sh (
script: 'lscpu -p | egrep -v "^#" | sort -u -t, -k 2,4 | wc -l',
returnStdout: true
).trim().toInteger() ?: 1
}
return env.JENKINS_NUM_PHYSICAL_CPU
}

def numLogicalCPU() {
if (env.JENKINS_NUM_LOGICAL_CPU) {
return env.JENKINS_NUM_LOGICAL_CPU
}
def uname = sh script: 'uname', returnStdout: true
if (uname.startsWith("Darwin")) {
return sh (
env.JENKINS_NUM_LOGICAL_CPU = sh (
script: 'sysctl hw.logicalcpu_max | cut -d" " -f2',
returnStdout: true
).trim().toInteger() ?: 1
} else {
return sh (
env.JENKINS_NUM_LOGICAL_CPU = sh (
script: 'lscpu -p | egrep -v "^#" | wc -l',
returnStdout: true
).trim().toInteger() ?: 1
}
return env.JENKINS_NUM_LOGICAL_CPU
}

void partest(cache=true, extraArgs='') {
sh "rm -f omc-diff.skip && make -C testsuite/difftool clean && make --output-sync -C testsuite/difftool"
sh 'build/bin/omc-diff -v1.4'
sh ("""#!/bin/bash -x
ulimit -t 1500
ulimit -v 6291456 # Max 6GB per process
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/boot/Makefile.common
Expand Up @@ -26,7 +26,7 @@ ifeq ($(BOOTSTRAP_STAGE_1),1)
OMCRUNTIMEAR=$(OMCRUNTIMEAR1)
OMPARSEAR=../../Parser/libomparse-boot.a
LOMPARSE=$(OMPARSEAR)
LCOMPILERRUNTIME=$(TOP_DIR)/Compiler/runtime/libomcgraphstream.a $(TOP_DIR)/Compiler/runtime/libomcbackendruntime.a $(abspath $(OMCRUNTIMEAR))
LCOMPILERRUNTIME=$(TOP_DIR)/Compiler/runtime/libomcgraphstream.a $(TOP_DIR)/Compiler/runtime/libomcbackendruntime.a $(abspath $(OMCRUNTIMEAR)) $(RPATH_BOOT_STAGE_1)
FMILIB_OR_BOOT=
else
OMCRUNTIMEAR=$(OMCRUNTIMEAR2)
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/runtime/Makefile.common
Expand Up @@ -85,7 +85,7 @@ libomcruntime-boot.dylib : $(OMC_OBJ_BOOT)

libomcruntime.so : $(OMC_OBJ)
rm -f $@
$(CXX) -shared $(RPATH) -o $@ $(OMC_OBJ) $(LDFLAGS)
$(CXX) -shared $(RPATH) $(RPATH_BOOT_STAGE_1) -o $@ $(OMC_OBJ) $(LDFLAGS)

libomcruntime-boot.so : $(OMC_OBJ_BOOT)
rm -f $@
Expand Down

0 comments on commit 93a3ce5

Please sign in to comment.