File tree Expand file tree Collapse file tree 4 files changed +60
-30
lines changed
Expand file tree Collapse file tree 4 files changed +60
-30
lines changed Original file line number Diff line number Diff line change 55
66cd " $( mktemp -dt plumed.XXXXXX) "
77
8- git clone https://github.com/danmar/cppcheck.git
9- cd cppcheck
8+ repo=https://github.com/danmar/cppcheck.git
109
11- if [ -n " $1 " ] ; then
12- echo " installing cppcheck $version "
10+ if [ -n " $1 " ]; then
1311 version=$1
12+ echo " installing cppcheck $version "
1413else
15- echo " installing latest doxygen"
16- version=$( git tag | tail -n 1)
14+ # getting the latest version without downloading the repo
15+ version=$(
16+ git -c ' versionsort.suffix=-' \
17+ ls-remote --exit-code --refs --sort=' version:refname' --tags " $repo " ' *.*.*' \
18+ | tail --lines=1 \
19+ | cut --delimiter=' /' --fields=3
20+ )
21+ echo " installing latest cppcheck ($version )"
1722fi
1823
24+ # cloning ONLY the code we need
25+ git clone " $repo " --branch " $version " --depth 1
26+ cd cppcheck
1927# pick native architecture
2028native=" $( $CC -march=native -Q --help=target | grep " ^ *\-march" | awk ' {print $2}' | head -n 1) "
2129# this is required so that when running the job on a different architecture ccache understand
2230# the object file should not be recycled
2331
24- git checkout $version
2532make -j 4 install MATCHCOMPILER=yes FILESDIR=" $HOME /opt/share/cppcheck" HAVE_RULES=yes CXXFLAGS=" -DNDEBUG -O2 -march=$native -mtune=$native -Wall -Wno-sign-compare -Wno-unused-function" PREFIX=" $HOME /opt"
2633cd ../
2734
2835cppcheck --version
29-
Original file line number Diff line number Diff line change 55
66cd " $( mktemp -dt plumed.XXXXXX) "
77
8- git clone https://github.com/doxygen/doxygen.git
8+ repo= " https://github.com/doxygen/doxygen.git"
99
10- cd doxygen
11-
12- if [ -n " $1 " ] ; then
13- echo " installing doxygen $version "
10+ if [ -n " $1 " ]; then
1411 version=$1
12+ echo " installing doxigen $version "
1513else
16- echo " installing latest doxygen"
17- version=$( git tag | tail -n 1)
14+ # getting the latest version without downloading the repo
15+ version=$(
16+ git -c ' versionsort.suffix=-' \
17+ ls-remote --exit-code --refs --sort=' version:refname' --tags " $repo " ' Release_*_*_*' \
18+ | tail --lines=1 \
19+ | cut --delimiter=' /' --fields=3
20+ )
21+ echo " installing latest doxigen ($version )"
1822fi
1923
20- git checkout $version
24+ # cloning ONLY the code we need
25+ git clone " $repo " --branch " $version " --depth 1
26+ cd doxygen
2127
2228mkdir build
2329cd build
@@ -26,4 +32,3 @@ make -j 4
2632make install
2733
2834cd ../
29-
Original file line number Diff line number Diff line change 55
66cd " $( mktemp -dt plumed.XXXXXX) "
77
8- git clone https://github.com/linux-test-project/lcov.git
8+ repo= https://github.com/linux-test-project/lcov.git
99
10- cd lcov
11-
12- if [ -n " $1 " ] ; then
13- echo " installing lcov $version "
10+ if [ -n " $1 " ]; then
1411 version=$1
12+ echo " installing lcov $version "
1513else
16- echo " installing latest lcov"
17- version=$( git tag | tail -n 1)
14+ # getting the latest version without downloading the repo
15+ version=$(
16+ git -c ' versionsort.suffix=-' \
17+ ls-remote --exit-code --refs --sort=' version:refname' --tags " $repo " ' v*.*.*' \
18+ | tail --lines=1 \
19+ | cut --delimiter=' /' --fields=3
20+ )
21+ echo " installing latest cppcheck ($version )"
22+ echo " installing latest lcov ($version )"
1823fi
1924
20- git checkout $version
25+ # cloning ONLY the code we need
26+ git clone " $repo " --branch " $version " --depth 1
27+ cd lcov
2128
2229make install PREFIX=" $HOME /opt"
23-
Original file line number Diff line number Diff line change 2323#include " Exception.h"
2424#include < cstdio>
2525#include < cmath>
26+ #include < iomanip>
2627
2728namespace PLMD {
2829
@@ -34,14 +35,26 @@ void LatticeReduction::sort(Vector v[3]) {
3435 m[0 ]=modulo2 (v[0 ]);
3536 m[1 ]=modulo2 (v[1 ]);
3637 m[2 ]=modulo2 (v[2 ]);
37- for (int i=0 ; i<3 ; i++)
38- for (int j=i+1 ; j<3 ; j++)
38+ for (int i=0 ; i<3 ; i++) {
39+ for (int j=i+1 ; j<3 ; j++) {
3940 if (m[i]>m[j]) {
4041 std::swap (v[i],v[j]);
4142 std::swap (m[i],m[j]);
4243 }
43- plumed_assert (m[0 ]<=m[1 ]*onePlusEpsilon);
44- plumed_assert (m[1 ]<=m[2 ]*onePlusEpsilon);
44+ }
45+ }
46+ if (m[0 ]>m[1 ]*onePlusEpsilon) {
47+ plumed_error () << std::scientific << std::setprecision (17 )
48+ << " v[0] " << v[0 ] << " " << " m[0] " << m[0 ] <<" \n "
49+ << " v[1] " << v[1 ] << " " << " m[1] " << m[1 ] <<" \n "
50+ << " v[2] " << v[2 ] << " " << " m[2] " << m[2 ] <<" \n " ;
51+ }
52+ if (m[1 ]>m[2 ]*onePlusEpsilon) {
53+ plumed_error () << std::scientific << std::setprecision (17 )
54+ << " v[0] " << v[0 ] << " " << " m[0] " << m[0 ] <<" \n "
55+ << " v[1] " << v[1 ] << " " << " m[1] " << m[1 ] <<" \n "
56+ << " v[2] " << v[2 ] << " " << " m[2] " << m[2 ] <<" \n " ;
57+ }
4558}
4659
4760void LatticeReduction::reduce (Vector&a,Vector&b) {
You can’t perform that action at this time.
0 commit comments