Skip to content
Snippets Groups Projects
Commit 6bf7e8bf authored by Soeren Peters's avatar Soeren Peters
Browse files

Merge pull request 'feature/sonarqube' (#59) from...

Merge pull request 'feature/sonarqube' (#59) from peters/VirtualFluids_dev:feature/sonarqube into develop

Reviewed-on: https://git.irmb.bau.tu-bs.de/VirtualFluids/VirtualFluids_dev/pulls/59
parents c061604e 82185437
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ gcc_9:
- mkdir -p build_gcc9
- cd build_gcc9
- cmake .. -DBUILD_VF_CPU=ON -DBUILD_VF_GPU=ON
- cmake . -LAH
- make -j4
clang_10:
......@@ -95,8 +96,8 @@ clang_10:
script:
- cd $CI_PROJECT_DIR
- mkdir -p build_gcc9
- cd build_gcc9
- mkdir -p build_clang10
- cd build_clang10
- cmake .. -DBUILD_VF_CPU=ON -DBUILD_VF_GPU=ON
- make -j4
......@@ -154,6 +155,39 @@ build_singularity_image:
- singularity build Containers/VirtualFluidsOpenMPI.sif Containers/VirtualFluidsOpenMPI.def
- ls -sh Containers/VirtualFluidsOpenMPI.sif
gcc_9_rebuild:
stage: build
#only: ["schedules"]
tags:
- gpu
- linux
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get install -y libboost-serialization-dev
- cd /tmp
- apt-get install unzip
- wget https://github.com/NVIDIA/cuda-samples/archive/10.1.2.zip
- unzip 10.1.2.zip
- export NVCUDASAMPLES_ROOT=$(pwd)/cuda-samples-10.1.2
script:
- cd $CI_PROJECT_DIR
- mkdir -p build_gcc_rebuild
- cd build_gcc_rebuild
- rm -r -f ./*
- cmake -E env CXXFLAGS="-fdiagnostics-show-option" cmake .. -DBUILD_VF_CPU=ON -DBUILD_VF_GPU=ON
- make -j4 >&1 | tee gcc_warnings.txt
artifacts:
paths:
- build_gcc_rebuild/gcc_warnings.txt
###############################################################################
## Tests ##
###############################################################################
......@@ -228,8 +262,8 @@ clang_build_analyzer_clang_10:
script:
- mkdir -p $CI_PROJECT_DIR/build
- rm -r ./*
- cd $CI_PROJECT_DIR/build
- rm -r -f ./*
- cmake .. -DBUILD_VF_CPU=ON -DUSE_OPENMP=OFF -DCMAKE_CXX_FLAGS=-ftime-trace
- ClangBuildAnalyzer --start .
- make
......@@ -254,11 +288,12 @@ include_what_you_use_gcc_9:
- cmake . -DCMAKE_PREFIX_PATH=/usr/lib/llvm-10
- make
- export PATH+=:$(pwd)/bin
- echo $PATH
script:
- mkdir -p $CI_PROJECT_DIR/build
- rm -r ./*
- cd $CI_PROJECT_DIR/build
- rm -r -f ./*
- cmake .. -DBUILD_VF_CPU=ON -DUSE_OPENMP=OFF -DBUILD_VF_INCLUDE_WHAT_YOU_USE=ON
- make
......@@ -276,12 +311,13 @@ cppcheck:
script:
- cd $CI_PROJECT_DIR
- cppcheck --version
- cppcheck src --enable=all --xml 2> report.xml
- cppcheck-htmlreport --file=report.xml --report-dir=html_report --source-dir=.
- cppcheck src --enable=all --xml 2> cppcheck.xml
- cppcheck-htmlreport --file=cppcheck.xml --report-dir=html_report --source-dir=.
artifacts:
paths:
- html_report/
- cppcheck.xml
# lizard - Cyclomatic Complexity Analyzer
# Ignore warnings is manually set to 191. This job will fail when new warnings are added.
......@@ -347,12 +383,14 @@ gcov_gcc_9:
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG-gcov"
paths:
- gcov_build/
- gcov_build
# this job also produces a compile commands json file.
clang-tidy:
stage: analyze
needs: []
before_script:
- run-clang-tidy -h
......@@ -362,11 +400,12 @@ clang-tidy:
- cd build_clang_tidy
- cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_VF_CPU=ON -DBUILD_VF_GPU=OFF
- python3 ../utilities/filterCompileCommands.py compile_commands.json
- run-clang-tidy -quiet > clang-tidy-results.txt
- run-clang-tidy -quiet > clangtidy.txt
artifacts:
paths:
- build_clang_tidy/clang-tidy-results.txt
- build_clang_tidy/clangtidy.txt
- build_clang_tidy/compile_commands.json
###############################################################################
## Deploy ##
......@@ -433,6 +472,32 @@ gcov_to_elladan:
script:
- ansible-playbook -i ansible/hosts.cfg -u public_pages ansible/playbook_gcov.yml
# sonar-scanner runs sonar-project.properties
# the reports ins this file needs to match the artifacts.
sonar-scanner:
stage: deploy
variables:
SONAR_HOST_URL: "http://finrod.irmb.bau.tu-bs.de/sonarqube"
needs: ["cppcheck","clang-tidy","gcov_gcc_9"]
before_script:
- cd /tmp
- apt-get install unzip
- wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip
- unzip sonar-scanner-cli-4.0.0.1744-linux.zip
- cd sonar-scanner-4.0.0.1744-linux/
- echo 'sonar.host.url=http://finrod.irmb.bau.tu-bs.de/sonarqube' >> conf/sonar-scanner.properties
- echo 'sonar.sourceEncoding=UTF-8' >> conf/sonar-scanner.properties
- cat conf/sonar-scanner.properties
- export PATH+=:$(pwd)/bin
- echo $PATH
- sonar-scanner -v
script:
- cd $CI_PROJECT_DIR
- sonar-scanner
###############################################################################
## Release ##
......
# must be unique in a given SonarQube instance
sonar.projectKey=my:project
# --- optional properties ---
# defaults to project key
sonar.projectName=VirtualFluids
# defaults to 'not provided'
#sonar.projectVersion=1.0
sonar.language=cxx
sonar.cxx.suffixes.sources=cpp,c,cxx,cu
sonar.cxx.suffixes.headers=h,hpp,hxx,cuh
# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=./src
sonar.cxx.includeDirectories=./src
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.cxx.coverage.reportPath=coverage/coverage.xml
sonar.cxx.cppcheck.reportPath=cppcheck.xml
sonar.cxx.clangtidy.reportPath=build_clang_tidy/clangtidy.txt
sonar.cxx.jsonCompilationDatabase=build_clang_tidy/compile_commands.json
sonar.cxx.gcc.reportPath=build_gcc_rebuild/gcc_warnings.txt
#sonar.cxx.valgrind.reportPath
sonar.cxx.funccomplexity.threshold=10
sonar.cxx.funcsize.threshold=20
\ No newline at end of file
......@@ -39,19 +39,19 @@
/*
Durch Verwendung eines CbVectors in Verbindung mit einem CbVectorAllocatorPool
wird der Datenvector nicht direkt im CbVector gehalten, sondern ist ein Teil
des Datenvectors des bergabe-CbVectorPools.
des Datenvectors des Uebergabe-CbVectorPools.
Die Methoden der von CbVectors funktionieren fehlerfrei
Es mss einem jedoch bewut sein, dass die "resize"-Methoden l�nger ben�tigen, da
Es mss einem jedoch bewusst sein, dass die "resize"-Methoden l�nger ben�tigen, da
u.U. viele Elemente im Speicher verschoeben werden muessen.
Der Poolvector enthaelt KEINE gaps, so dass er z.B. gut zur �bertragung via MPI
geeignet ist...
Verhaltensweise bei Zerstren des Pools:
Verhaltensweise bei Zerstoeren des Pools:
wird der Pool zerst�rt bevor man die CbVectoren zerst�rt, so wird beim n�chsten
Datenzugriffsversuch eine entsprechende Exception geworfen, denn alle DatenElemente
des CbVEctors werden restet und der Pool dort zu NULL gesetzt.
Verhaltensweise bei Zerstren eines CbVectors:
Verhaltensweise bei Zerstoeren eines CbVectors:
hier ganz normal der Datenspeicher wieder freigegen und der Poolvektor verk�rzt
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment