Skip to content

Issue building libpressio 1.0.4 (and master) on macOS with Apple Clang #42

@mathomp4

Description

@mathomp4

I recently learned about libpressio and saw it was in spack and thought, hey, why not? I first tried building the latest version in spack (0.99.4) and it failed. So updated the package with 1.0.4 and it failed. So then, okay, master and still a failure.

My build is using apple-clang 17 and gfortran 15 (not sure if libpressio has a fortran requirement)

The current failures I'm seeing are:

     149    In file included from /var/folders/4t/b2c40c4149dfm599b9pc_7mr0000gp/T/mathomp4/spack-stage/spack-stage-libpressio-master-hjcbzg4ud2dskehssdmlweecwf4bqrmy/spack-src/src/plug
            ins/compressors/mask_interpolation.cc:1:
  >> 150    /Users/mathomp4/spack-mathomp4/opt/spack/darwin-m2/libstdcompat-0.0.21-ycshq72256etr7yjtsyowy42qcgztwti/include/std_compat/cmath.h:24:30: error: no member named 'declval' in
             namespace 'std'
     151       24 |   typedef decltype(test(std::declval<Tp>())) type;

and:

  >> 166    /var/folders/4t/b2c40c4149dfm599b9pc_7mr0000gp/T/mathomp4/spack-stage/spack-stage-libpressio-master-hjcbzg4ud2dskehssdmlweecwf4bqrmy/spack-src/src/plugins/compressors/mask_i
            nterpolation.cc:130:34: error: call to 'lerp' is ambiguous
     167      130 |                           return compat::lerp(left, right, static_cast<double>(left_pos)/static_cast<double>(left_pos+right_pos));
     168          |                                  ^~~~~~~~~~~~

Now the first one, per internet, seems to be that declval is now in utility (https://en.cppreference.com/w/cpp/utility/declval.html) so there is a need for:

#include <utility> 

somewhere. (I am a Fortran programmer, not C++, so ... I can't be too helpful 🙂 )

The second one seems to happen a LOT. Internet seems to think it might be a conflict with C++20? I see here: https://en.cppreference.com/w/cpp/numeric/lerp.html that a double lerp came in with C++20 so perhaps there is now a "double" declaration?

NOTE: I know there is #32 but my errors seem to not correspond with changes there...I think. (Again, not C++ coder)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions