Skip to content

Commit 561f9d4

Browse files
committed
Merge branch 'v2.10'
2 parents b59f239 + be3fc24 commit 561f9d4

File tree

4 files changed

+60
-30
lines changed

4 files changed

+60
-30
lines changed

.ci/install.cppcheck

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@ set -x
55

66
cd "$(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"
1413
else
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)"
1722
fi
1823

24+
#cloning ONLY the code we need
25+
git clone "$repo" --branch "$version" --depth 1
26+
cd cppcheck
1927
# pick native architecture
2028
native="$($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
2532
make -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"
2633
cd ../
2734

2835
cppcheck --version
29-

.ci/install.doxygen

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@ set -x
55

66
cd "$(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"
1513
else
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)"
1822
fi
1923

20-
git checkout $version
24+
#cloning ONLY the code we need
25+
git clone "$repo" --branch "$version" --depth 1
26+
cd doxygen
2127

2228
mkdir build
2329
cd build
@@ -26,4 +32,3 @@ make -j 4
2632
make install
2733

2834
cd ../
29-

.ci/install.lcov

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@ set -x
55

66
cd "$(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"
1513
else
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)"
1823
fi
1924

20-
git checkout $version
25+
#cloning ONLY the code we need
26+
git clone "$repo" --branch "$version" --depth 1
27+
cd lcov
2128

2229
make install PREFIX="$HOME/opt"
23-

src/tools/LatticeReduction.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "Exception.h"
2424
#include <cstdio>
2525
#include <cmath>
26+
#include <iomanip>
2627

2728
namespace 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

4760
void LatticeReduction::reduce(Vector&a,Vector&b) {

0 commit comments

Comments
 (0)