Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comparison operator should be const #133

Closed
wants to merge 0 commits into from

Conversation

raghavendrak
Copy link
Collaborator

Some versions of the compiler flag this as error:
error: static assertion failed: comparison object must be invocable as const #131

@raghavendrak raghavendrak changed the base branch from master to v1.1.1 December 12, 2021 03:30
@raghavendrak raghavendrak changed the base branch from v1.1.1 to master December 12, 2021 03:31
@jeffhammond
Copy link
Collaborator

I don't understand it yet but when I compile with -std=c++20 and not 17 or 14, I get the following error. Given that C++20 is becoming the default language level in recent compilers, it might be worth figuring out this issue.

make[3]: Entering directory '/home/jhammond/AQUARIUS/ctf/src/interface'
/usr/bin/mpicxx.mpich -w -std=c++20 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1 -DUSE_LAPACK   -c ring.cxx -o /home/jhammond/AQUARIUS/ctf/obj/ring.o
In file included from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.h:26:34: error: expected ‘)’ before ‘const’
   26 |       Vector<dtype>(Vector<dtype> const & A);
      |                    ~             ^~~~~~
      |                                  )
../../include/../src/interface/vector.h:32:35: error: invalid declarator before ‘const’
   32 |       Vector<dtype>(Tensor<dtype> const & A);
      |                                   ^~~~~
../../include/../src/interface/vector.h:32:34: error: expected ‘)’ before ‘const’
   32 |       Vector<dtype>(Tensor<dtype> const & A);
      |                    ~             ^~~~~~
      |                                  )
In file included from ../../include/../src/interface/vector.h:136,
                 from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.cxx:50:3: error: no declaration matches ‘CTF::Vector<dtype>::Vector(const CTF::Vector<dtype>&)’
   50 |   Vector<dtype>::Vector(Vector<dtype> const & A)
      |   ^~~~~~~~~~~~~
In file included from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.h:102:7: note: candidates are: ‘CTF::Vector<dtype>::Vector(int64_t, char, const CTF::Idx_Partition&, const CTF::Idx_Partition&, int, CTF::World&, const CTF_int::algstrct&, const char*, int)’
  102 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:80:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, int, CTF::World&, const char*, int, const CTF_int::algstrct&)’
   80 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:65:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, int, CTF::World&, const CTF_int::algstrct&)’
   65 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:52:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, CTF::World&, const char*, int, const CTF_int::algstrct&)’
   52 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:40:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, CTF::World&, const CTF_int::algstrct&)’
   40 |       Vector(int64_t                   len,
      |       ^~~~~~
In file included from ../../include/../src/interface/vector.h:136,
                 from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.cxx:47:3: note:                 ‘CTF::Vector<dtype>::Vector()’
   47 |   Vector<dtype>::Vector() : Tensor<dtype>() { }
      |   ^~~~~~~~~~~~~
In file included from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.h:14:9: note: ‘class CTF::Vector<dtype>’ defined here
   14 |   class Vector : public Tensor<dtype> {
      |         ^~~~~~
In file included from ../../include/../src/interface/vector.h:136,
                 from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.cxx:56:3: error: no declaration matches ‘CTF::Vector<dtype>::Vector(const CTF::Tensor<dtype>&)’
   56 |   Vector<dtype>::Vector(Tensor<dtype> const & A)
      |   ^~~~~~~~~~~~~
In file included from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.h:102:7: note: candidates are: ‘CTF::Vector<dtype>::Vector(int64_t, char, const CTF::Idx_Partition&, const CTF::Idx_Partition&, int, CTF::World&, const CTF_int::algstrct&, const char*, int)’
  102 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:80:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, int, CTF::World&, const char*, int, const CTF_int::algstrct&)’
   80 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:65:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, int, CTF::World&, const CTF_int::algstrct&)’
   65 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:52:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, CTF::World&, const char*, int, const CTF_int::algstrct&)’
   52 |       Vector(int64_t                   len,
      |       ^~~~~~
../../include/../src/interface/vector.h:40:7: note:                 ‘CTF::Vector<dtype>::Vector(int64_t, CTF::World&, const CTF_int::algstrct&)’
   40 |       Vector(int64_t                   len,
      |       ^~~~~~
In file included from ../../include/../src/interface/vector.h:136,
                 from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.cxx:47:3: note:                 ‘CTF::Vector<dtype>::Vector()’
   47 |   Vector<dtype>::Vector() : Tensor<dtype>() { }
      |   ^~~~~~~~~~~~~
In file included from ../../include/../src/interface/tensor.h:1284,
                 from ../../include/ctf.hpp:17,
                 from ring.cxx:1:
../../include/../src/interface/vector.h:14:9: note: ‘class CTF::Vector<dtype>’ defined here
   14 |   class Vector : public Tensor<dtype> {
      |         ^~~~~~
make[3]: *** [Makefile:12: /home/jhammond/AQUARIUS/ctf/obj/ring.o] Error 1
make[3]: Leaving directory '/home/jhammond/AQUARIUS/ctf/src/interface'
make[2]: *** [Makefile:10: interface] Error 2
make[2]: Leaving directory '/home/jhammond/AQUARIUS/ctf/src'
make[1]: *** [Makefile:93: ctf_objs] Error 2
make[1]: Leaving directory '/home/jhammond/AQUARIUS/ctf'
make: *** [Makefile:238: /home/jhammond/AQUARIUS/ctf/lib/libctf.a] Error 2

@raghavendrak
Copy link
Collaborator Author

@jeffhammond maybe we should have this opened as a separate issue?

@susilehtola
Copy link

@raghavendrak the patch you get from
https://patch-diff.githubusercontent.com/raw/cyclops-community/ctf/pull/133.patch

appears to be broken since you've merged the master branch instead of rebasing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants