diff options
author | Cristian Di Pietrantonio <cristiandipietrantonio@gmail.com> | 2023-08-09 14:32:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 08:32:58 +0200 |
commit | 7165e701867cb7c361db3f2777fd55a1fba20dcd (patch) | |
tree | 289a297a90ee97f89e4eed1e141045629c1e680a | |
parent | 97d632a1613947008e84ee2c68ac57d9fbe282de (diff) | |
download | spack-7165e701867cb7c361db3f2777fd55a1fba20dcd.tar.gz spack-7165e701867cb7c361db3f2777fd55a1fba20dcd.tar.bz2 spack-7165e701867cb7c361db3f2777fd55a1fba20dcd.tar.xz spack-7165e701867cb7c361db3f2777fd55a1fba20dcd.zip |
chgcentre: fix compilation error by using explicit casting (#39315)
Co-authored-by: Cristian Di Pietrantonio <cdipietrantonio@pawsey.org.au>
-rw-r--r-- | var/spack/repos/builtin/packages/chgcentre/main.patch | 11 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/chgcentre/package.py | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/chgcentre/main.patch b/var/spack/repos/builtin/packages/chgcentre/main.patch new file mode 100644 index 0000000000..fbc7cd064e --- /dev/null +++ b/var/spack/repos/builtin/packages/chgcentre/main.patch @@ -0,0 +1,11 @@ +--- a/main.cpp 2022-05-02 15:00:00 +0800 ++++ b/main.cpp 2022-05-02 15:01:00 +0800 +@@ -415,7 +415,7 @@ + MDirection::Ref(MDirection::J2000))(); + std::vector<Muvw> uvws(antennas.size()); + MEpoch time(MVEpoch(-1.0)); +- for(unsigned row=0; row!=std::min(set.nrow(),50u); ++row) ++ for(unsigned row=0; row!=std::min(static_cast<unsigned int>(set.nrow()),50u); ++row) + { + if(fieldIdCol(row) == fieldIndex) + { diff --git a/var/spack/repos/builtin/packages/chgcentre/package.py b/var/spack/repos/builtin/packages/chgcentre/package.py index ebd8242bea..78d8ceaea7 100644 --- a/var/spack/repos/builtin/packages/chgcentre/package.py +++ b/var/spack/repos/builtin/packages/chgcentre/package.py @@ -18,3 +18,9 @@ class Chgcentre(CMakePackage): depends_on("casacore") depends_on("gsl") + + # this patch is required to fix a programming error that is not acceptable by + # latest compilers. In particular, the `std::min` function was given `int` and + # `unsigned int` arguments. The `int` argument is explicitly casted to `unsigned int`. + # This patch was created by the staff at the Pawsey Supercomputing Research Centre. + patch("main.patch") |