Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chameleon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
Chameleon
Commits
6beb880f
Commit
6beb880f
authored
7 years ago
by
PRUVOST Florent
Browse files
Options
Downloads
Patches
Plain Diff
use a script to filter the sources, use file-list option of cppcheck
parent
dab8b8e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/analysis.sh
+7
-14
7 additions, 14 deletions
tools/analysis.sh
tools/find_sources.sh
+29
-0
29 additions, 0 deletions
tools/find_sources.sh
with
36 additions
and
14 deletions
tools/analysis.sh
+
7
−
14
View file @
6beb880f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
mkdir
-p
build
mkdir
-p
build
cd
build
cd
build
rm
*
-rf
rm
*
-rf
cmake ..
-DCHAMELEON_USE_MPI
=
ON
-DCMAKE_INSTALL_PREFIX
=
$PWD
/install
-DCMAKE_C_FLAGS
=
"
$CFLAGS
"
-DCMAKE_EXE_LINKER_FLAGS
=
"
$LDFLAGS
"
-DCMAKE_VERBOSE_MAKEFILE
=
ON
-DMORSE_ENABLE_WARNING
=
ON
-DMORSE_ENABLE_COVERAGE
=
ON
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
make
-j5
|
tee
../chameleon-build.log
# run tests
# run tests
...
@@ -23,22 +23,14 @@ lcov_cobertura.py chameleon.lcov --output chameleon-coverage.xml
...
@@ -23,22 +23,14 @@ lcov_cobertura.py chameleon.lcov --output chameleon-coverage.xml
# - consider generated files in build
# - consider generated files in build
# - exclude base *z* files to avoid duplication
# - 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
# - exclude cblas.h and lapacke-.h because not really part of chameleon and make cppcheck analysis too long
export
SOURCES_TO_ANALYZE
=
`
bash
-c
'find ./build -type d -name CMakeFiles -prune -o -type d -name Testing -prune -o -type f -regex ".*\.c\|.*\.h" -print && \
./tools/find_sources.sh
find . -path ./build -prune -o -type f -regex "^[^z]*\.c" -print && \
find . -path ./build -prune -o -type f -regex "^[^z]*\.h" ! -name '
lapacke
*
.h
' ! -name '
cblas
*
.h
' -print | xargs'
`
# actually we need to remove cblas/lapacke headers (cppcheck analysis too long)
# we will get them back after cppcheck
rm
coreblas/include/cblas.h coreblas/include/lapacke.h coreblas/include/lapacke_config.h coreblas/include/lapacke_mangling.h
# Undefine this because not relevant in our configuration
# Undefine this because not relevant in our configuration
export
UNDEFINITIONS
=
"
-UCHAMELEON_USE_CUBLAS_V2
-UCHAMELEON_USE_OPENCL -UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus"
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
# run cppcheck analysis
cppcheck
-v
-f
--language
=
c
--platform
=
unix64
--enable
=
all
--xml
--xml-version
=
2
--suppress
=
missingIncludeSystem
${
UNDEFINITIONS
}
${
SOURCES_TO_ANALYZE
}
2> chameleon-cppcheck.xml
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
# run rats analysis
rats
-w
3
--xml
${
SOURCES_TO_ANALYZE
}
>
chameleon-rats.xml
rats
-w
3
--xml
`
cat
filelist.txt
`
>
chameleon-rats.xml
# get back cblas/lapacke headers after static analysis
git checkout coreblas/include/cblas.h coreblas/include/lapacke.h coreblas/include/lapacke_config.h coreblas/include/lapacke_mangling.h
# create the sonarqube config file
# create the sonarqube config file
cat
>
sonar-project.properties
<<
EOF
cat
>
sonar-project.properties
<<
EOF
...
@@ -51,7 +43,8 @@ sonar.projectName=Chameleon
...
@@ -51,7 +43,8 @@ sonar.projectName=Chameleon
sonar.projectDescription=Dense linear algebra subroutines for heterogeneous and distributed architectures
sonar.projectDescription=Dense linear algebra subroutines for heterogeneous and distributed architectures
sonar.projectVersion=master
sonar.projectVersion=master
sonar.language=c++
sonar.language=c++
sonar.sources=`bash -c 'echo
$SOURCES_TO_ANALYZE
| sed -e "s/ /, /g"'`
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.sourceEncoding=UTF-8
sonar.cxx.compiler.charset=UTF-8
sonar.cxx.compiler.charset=UTF-8
sonar.cxx.compiler.regex=^(.*):([0-9]+):[0-9]+: warning: (.*)
\[
(.*)
\]
$
sonar.cxx.compiler.regex=^(.*):([0-9]+):[0-9]+: warning: (.*)
\[
(.*)
\]
$
...
...
This diff is collapsed.
Click to expand it.
tools/find_sources.sh
0 → 100755
+
29
−
0
View file @
6beb880f
#!/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/cblas.h coreblas/include/lapacke.h coreblas/include/lapacke_config.h coreblas/include/lapacke_mangling.h
do
sed
-i
"
\:
^
$file
.*:d"
filelist.txt
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment