Compare commits

...

4 Commits

Author SHA1 Message Date
d39fad0fbe Updated requirements requests and compiling steps for environment set-up
#TODO add specific requirements and versions of the modules and the conanfile.txt setup
2021-07-02 15:32:13 +02:00
c0d0dce683 centos8 conan stdc++11 2021-06-02 12:13:59 +02:00
0535f2e353 link scc-utils 2021-06-02 11:35:34 +02:00
c72b02f99f create Jenkins pipeline 2021-06-02 11:13:19 +02:00
5 changed files with 137 additions and 2 deletions

106
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,106 @@
void checkout_project() {
checkout([
$class: 'GitSCM',
branches: [
[name: '*/master']
],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'CleanBeforeCheckout'],
[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false]
],
submoduleCfg: [],
userRemoteConfigs: [
[credentialsId: 'gitea-jenkins', url: 'https://git.minres.com/SystemC/SystemC-Components-Test.git']
]
])
}
void setup_conan_stdc() {
sh"""
conan profile new default --detect --force
conan profile update settings.compiler.libcxx=libstdc++ default
"""
}
void setup_conan_stdc11() {
sh"""
conan profile new default --detect --force
conan profile update settings.compiler.libcxx=libstdc++11 default
"""
}
void build_project() {
sh"""
mkdir build; cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j10 VERBOSE=1
"""
}
void test_project() {
sh 'cd build; ctest -C Debug -V -j10 '
}
pipeline {
agent none
options {
// using the Timestamper plugin we can add timestamps to the console log
timestamps()
skipStagesAfterUnstable()
}
stages {
stage('SCC test pipeline') {
parallel {
stage('U18.04') {
agent {docker { image 'ubuntu-18.04' } }
stages {
stage('Ubuntu18.04: checkout') { steps { checkout_project() }}
stage('Ubuntu18.04: Conan') { steps { setup_conan_stdc11() }}
stage('Ubuntu18.04: Build') { steps { build_project() }}
stage('Ubuntu18.04: Test') { steps { test_project() }}
}
}
stage('U20.04') {
agent {docker { image 'ubuntu-20.04' } }
stages {
stage('Ubuntu20.04: checkout') { steps { checkout_project() }}
stage('Ubuntu20.04: Conan') { steps { setup_conan_stdc11() }}
stage('Ubuntu20.04: Build') { steps { build_project() }}
stage('Ubuntu20.04: Test') { steps { test_project() }}
}
}
stage('COS7') {
agent {docker { image 'centos7' } }
stages {
stage('CentOS7: checkout') { steps { checkout_project() }}
stage('CentOS7: conan') { steps { setup_conan_stdc() }}
stage('CentOS7: build') { steps { build_project() }}
stage('CentOS7: test') { steps { test_project() }}
}
}
stage('COS8') {
agent {docker { image 'centos8' } }
stages {
stage('CentOS8: checkout') { steps { checkout_project() }}
stage('CentOS8: conan') { steps { setup_conan_stdc11() }}
stage('CentOS8: build') { steps { build_project() }}
stage('CentOS8: test') { steps { test_project() }}
}
}
}
}
}
post {
success {
echo 'SCC tests PASSED!'
}
failure {
mail to: 'stas@minres.com',
subject: "SCC Test Pipeline Failed: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
}
}
}

View File

@ -7,7 +7,7 @@ proc ModulesHelp { } {
puts stderr "\tThis module loads PATHs and variables for SCC tests."
}
set distro [exec /bin/lsb_release -i -s]
set distro [exec /usr/bin/lsb_release -i -s]
if { $distro == "CentOS" && ![info exists ::env(PROJECT)] && ![info exists ::env(PCP_DIR)] } {
puts stderr "Don't forget to execute 'scl enable devtoolset-7 llvm-toolset-7 bash'"
}

View File

@ -1,2 +1,29 @@
# SystemC-Components-Test
Examples and tests for the SystemC-Components
In Console:
-Check for needed modules in ~/.bashrc #TODO add the specific requirements and versions of the modules
they should be available directly in the linux installation if not, install it and add it to $PATH with:
export PATH="needed-path:$PATH"
-Edit bashrc and add:
./opt/shared/modules/4.4.1/init/bash
module use /opt/shared/modules/modulefiles
at end of file.
-Install conan and run this comands:
module load ./Modulefile
conan profile new default --detect --force
conan profile update settings.compiler.libcxx=libstdc++11 default
-Add conan to $PATH
In SystemC Project:
-Check conanfile.txt for anomalies and requirements. #TODO add specific requirements.

View File

@ -11,3 +11,5 @@
[options]
fmt:header_only=True
systemc:shared=True
systemc-cci:shared=True

View File

@ -2,6 +2,6 @@ cmake_minimum_required(VERSION 3.12)
add_executable (io_redirector
main.cpp
)
target_link_libraries (io_redirector LINK_PUBLIC scc)
target_link_libraries (io_redirector LINK_PUBLIC scc-util)
add_test(NAME io_redirector_test COMMAND io_redirector)