diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d3e0472511783773cb19180721f6c3dc05107f15..7add539a4c63216793b2af5f20d88a5ee6404669 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,10 +34,34 @@ quark: - ctest -V -R test_shm_s doc: + artifacts: + name: chameleon_doc + expire_in: 1 week + paths: + - build/doc/doxygen + - build/doc/orgmode script: - source .gitlab-ci-env.sh - git submodule update --init --recursive - mkdir -p build - cd build - - cmake .. -DCHAMELEON_ENABLE_DOC=ON -DCHAMELEON_ENABLE_EXAMPLES=OFF -DCHAMELEON_ENABLE_TESTING=OFF -DCHAMELEON_ENABLE_TIMING=OFF - - make + - cmake .. -DCHAMELEON_ENABLE_DOC=ON -DCHAMELEON_ENABLE_EXAMPLE=OFF -DCHAMELEON_ENABLE_TESTING=OFF -DCHAMELEON_ENABLE_TIMING=OFF + - make doc + +analysis: + artifacts: + name: chameleon_analysis + expire_in: 1 week + paths: + - chameleon-build.log + - coverage/ + - chameleon-coverage.xml + - chameleon-cppcheck.xml + - chameleon-rats.xml + - sonar.log + script: + - source .gitlab-ci-env.sh + - git submodule update --init --recursive + - ./tools/analysis.sh + only: + - master diff --git a/cmake_modules/morse_cmake b/cmake_modules/morse_cmake index b356d3a5b5a417e49a60aa3b6127221717fe0f1d..6acb22e9e8d3ebe89bfe25e1102f77a339fbed06 160000 --- a/cmake_modules/morse_cmake +++ b/cmake_modules/morse_cmake @@ -1 +1 @@ -Subproject commit b356d3a5b5a417e49a60aa3b6127221717fe0f1d +Subproject commit 6acb22e9e8d3ebe89bfe25e1102f77a339fbed06 diff --git a/tools/analysis.sh b/tools/analysis.sh new file mode 100755 index 0000000000000000000000000000000000000000..4c7a3f417a59e5d3ad297eca72ad8d4d3de54dec --- /dev/null +++ b/tools/analysis.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Performs an analysis of Chameleon source code +# We consider to be in Chameleon's source code root + +# build with proper options +mkdir -p build +cd build +rm * -rf +cmake .. -DCHAMELEON_USE_MPI=ON -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_VERBOSE_MAKEFILE=ON -DMORSE_ENABLE_WARNING=ON -DMORSE_ENABLE_COVERAGE=ON +make -j5 | tee ../chameleon-build.log + +# run tests +STARPU_SILENT=1 ctest --no-compress-output || /usr/bin/true + +# capture coverage +lcov --directory . --capture --output-file ../chameleon.lcov +cd .. +genhtml -o coverage chameleon.lcov +lcov_cobertura.py chameleon.lcov --output chameleon-coverage.xml + +# filter sources: +# - consider generated files in build +# - exclude base *z* files to avoid duplication +# - exclude cblas.h and lapacke-.h because not really part of chameleon and make cppcheck analysis too long +./tools/find_sources.sh + +# Undefine this because not relevant in our configuration +export UNDEFINITIONS="-UCHAMELEON_USE_OPENCL -UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus" +# run cppcheck analysis +cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem ${UNDEFINITIONS} --file-list=./filelist.txt 2> chameleon-cppcheck.xml +# run rats analysis +rats -w 3 --xml `cat filelist.txt` > chameleon-rats.xml + +# create the sonarqube config file +cat > sonar-project.properties << EOF +sonar.host.url=https://hpclib-sed.bordeaux.inria.fr/sonarqube-dev +sonar.links.homepage=https://gitlab.inria.fr/solverstack/chameleon +sonar.links.ci=https://gitlab.inria.fr/solverstack/chameleon/pipelines +sonar.links.scm=https://gitlab.inria.fr/solverstack/chameleon/ +sonar.projectKey=chameleon +sonar.projectName=Chameleon +sonar.projectDescription=Dense linear algebra subroutines for heterogeneous and distributed architectures +sonar.projectVersion=master +sonar.language=c++ +sonar.sources=build, compute, control, coreblas, example, include, runtime, testing, timing +sonar.inclusions=`cat filelist.txt | xargs echo | sed 's/ /, /g'` +sonar.sourceEncoding=UTF-8 +sonar.cxx.compiler.charset=UTF-8 +sonar.cxx.compiler.parser=GCC +sonar.cxx.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$ +sonar.cxx.compiler.reportPath=chameleon-build.log +sonar.cxx.coverage.reportPath=chameleon-coverage.xml +sonar.cxx.cppcheck.reportPath=chameleon-cppcheck.xml +sonar.cxx.rats.reportPath=chameleon-rats.xml +EOF + +# run sonar analysis + publish on sonarqube-dev +sonar-scanner -X -Dsonar.login=077ef775a8b4fe9ba722497ef0511ca6dcfb3fcd > sonar.log diff --git a/tools/find_sources.sh b/tools/find_sources.sh new file mode 100755 index 0000000000000000000000000000000000000000..21471b1a27c4d572f26ba41b3b238643b69446f5 --- /dev/null +++ b/tools/find_sources.sh @@ -0,0 +1,29 @@ +#!/bin/sh +set -x + +SRCDIR_TO_ANALYZE="build compute control coreblas example include runtime testing timing" + +echo $PWD +rm -f filelist.txt +for dir in ${SRCDIR_TO_ANALYZE} +do + find $dir -name '*\.[ch]' >> filelist.txt +done + +# Remove all CMakeFiles generated file +sed -i '/CMakeFiles/d' filelist.txt + +# Remove installed files +sed -i '/build\/install.*/d' filelist.txt + +# Remove original files used for precision generation +for file in `git grep "@precisions" | awk -F ":" '{ print $1 }'` +do + sed -i "\:^$file.*:d" filelist.txt +done + +# Remove external header files +for file in coreblas/include/coreblas/cblas.h coreblas/include/coreblas/lapacke.h coreblas/include/coreblas/lapacke_config.h coreblas/include/coreblas/lapacke_mangling.h +do + sed -i "\:^$file.*:d" filelist.txt +done