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

Install issue - optional and variadic templates #22

Open
seryrzu opened this issue Jul 7, 2022 · 3 comments · May be fixed by #27
Open

Install issue - optional and variadic templates #22

seryrzu opened this issue Jul 7, 2022 · 3 comments · May be fixed by #27

Comments

@seryrzu
Copy link
Collaborator

seryrzu commented Jul 7, 2022

Reported in #1 (comment) by @yangxiaofeill

Copied below

[85%] Building CXX object src/projects/veritymap/CMakeFiles/veritymap.dir/veritymap.cpp.o
In file included from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/veritymap.hpp:12,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/veritymap.cpp:5:
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sequences/seqio.hpp:48:33: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
   48 | class SeqIterator : public std::iterator<std::forward_iterator_tag, Sequence, size_t, Sequence *, Sequence &> {
      |                                 ^~~~~~~~
In file included from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_construct.h:61,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/char_traits.h:46,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/string:40,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/stdexcept:39,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/system_error:41,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/std_mutex.h:39,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/atomic_wait.h:49,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/atomic_base.h:41,
                 from /data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/atomic:41,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/tools/common/parallel.h:5,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/veritymap.hpp:7:
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
In file included from /data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/sketch/common.h:58,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/sketch/update.h:3,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/sketch/ccm.h:6,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/kmer_index/kmer_filter.hpp:9,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/kmer_index/approx_kmer_indexer.hpp:12,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/kmer_index/target_indexer.hpp:12,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/veritymap.hpp:19:
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/sketch/./div.h:150:54: error: expected ')' before '&&' token
  150 |     template<typename...Args>Schismatic<int32_t>(Args &&...args):
      |                                                 ~    ^~~
      |                                                      )
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/sketch/./div.h:154:54: error: expected ')' before '&&' token
  154 |     template<typename...Args>Schismatic<int64_t>(Args &&...args):
      |                                                 ~    ^~~
      |                                                      )
In file included from /data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_vector.hpp:8,
                 from /data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/sketch/ccm.h:8:
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:336:25: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  336 |   typedef typename std::iterator<std::random_access_iterator_tag, IDX>::difference_type difference_type;
      |                         ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp: In member function 'void compact::iterator_imp::common<Derived, IDX, BITS, W, UB>::set_bits(W, unsigned int)':
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:510:25: warning: expected 'template' keyword before dependent template name [-Wmissing-template-keyword]
  510 |     gs<W, BITS, W, UB>::set<TS>(x, self.ptr, bits, self.offset);
      |                         ^~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp: At global scope:
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:676:17: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  676 |     public std::iterator<std::random_access_iterator_tag, IDX>,
      |                 ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:688:16: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  688 |   typedef std::iterator<std::random_access_iterator_tag, IDX> super;
      |                ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:723:15: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  723 |   public std::iterator<std::random_access_iterator_tag, const IDX>,
      |               ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:735:16: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  735 |   typedef std::iterator<std::random_access_iterator_tag, IDX> super;
      |                ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:762:17: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  762 |     public std::iterator<std::random_access_iterator_tag, IDX>,
      |                 ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:773:16: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  773 |   typedef std::iterator<std::random_access_iterator_tag, IDX> super;
      |                ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:810:15: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  810 |   public std::iterator<std::random_access_iterator_tag, const IDX>,
      |               ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/tools/sketch/./include/compact_vector/compact_iterator.hpp:821:16: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  821 |   typedef std::iterator<std::random_access_iterator_tag, IDX> super;
      |                ^~~~~~~~
/data/home/xfyang/software/miniconda3/envs/gcc-9/x86_64-conda-linux-gnu/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
In file included from /data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/veritymap.hpp:20:
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp:33:22: error: 'optional' in namespace 'std' does not name a template type
   33 |   [[nodiscard]] std::optional<chaining::Chain> MapSingleQuery(const Contig &query,
      |                      ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp:1:1: note: 'std::optional' is defined in header '<optional>'; did you forget to '#include <optional>'?
  +++ |+#include <optional>
    1 | //
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp: In lambda function:
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp:103:12: error: 'optional' is not a member of 'std'
  103 |       std::optional<chaining::Chain> chain = MapSingleQuery(query, indexed_targets);
      |            ^~~~~~~~
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp:103:12: note: 'std::optional' is defined in header '<optional>'; did you forget to '#include <optional>'?
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp:103:36: error: expected primary-expression before '>' token
  103 |       std::optional<chaining::Chain> chain = MapSingleQuery(query, indexed_targets);
      |                                    ^
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp:103:38: error: 'chain' was not declared in this scope; did you mean 'chainer'?
  103 |       std::optional<chaining::Chain> chain = MapSingleQuery(query, indexed_targets);
      |                                      ^~~~~
      |                                      chainer
/data/home/xfyang/software/VerityMap/veritymap/src/projects/veritymap/mapper.hpp:103:46: error: 'MapSingleQuery' was not declared in this scope; did you mean 'MapSingleQueryStrand'?
  103 |       std::optional<chaining::Chain> chain = MapSingleQuery(query, indexed_targets);
      |                                              ^~~~~~~~~~~~~~
      |                                              MapSingleQueryStrand
make[3]: *** [src/projects/veritymap/CMakeFiles/veritymap.dir/veritymap.cpp.o] Error 1
make[3]: Leaving directory `/data/home/xfyang/software/VerityMap/veritymap/build'
make[2]: *** [src/projects/veritymap/CMakeFiles/veritymap.dir/all] Error 2
make[2]: Leaving directory `/data/home/xfyang/software/VerityMap/veritymap/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/data/home/xfyang/software/VerityMap/veritymap/build'
make: *** [veritymap] Error 2
@seryrzu seryrzu changed the title Install issue Install issue - optional and variadic templates Jul 7, 2022
@seryrzu seryrzu mentioned this issue Jul 7, 2022
@seryrzu
Copy link
Collaborator Author

seryrzu commented Jul 7, 2022

I committed a change that should be fixing the issue with optional in this branch: https://github.com/ablab/VerityMap/commits/install_bugfix

Not sure what is going on with variadic templates part inside the sketch library. Let me think a bit more about it.

@seryrzu
Copy link
Collaborator Author

seryrzu commented Jul 7, 2022

Which exact version of compiler do you use @yangxiaofeill? I see that it seems to be generally g++-9 which suprises me because we have a github action that checks that the tool compiles and it runs on 9.4.0:

See
https://github.com/ablab/VerityMap/runs/7239623448?check_suite_focus=true

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0

@IceFreez3r
Copy link

Hey, I ran across almost the same error while building. Your fix branch reduced the error to this

[ 85%] Building CXX object src/projects/veritymap/CMakeFiles/veritymap.dir/veritymap.cpp.o
In file included from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/tools/sketch/./include/sketch/common.h:58,
                 from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/tools/sketch/./include/sketch/update.h:3,
                 from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/tools/sketch/./include/sketch/ccm.h:6,
                 from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/projects/veritymap/kmer_index/kmer_filter.hpp:9,
                 from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/projects/veritymap/kmer_index/approx_kmer_indexer.hpp:12,
                 from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/projects/veritymap/kmer_index/target_indexer.hpp:12,
                 from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/projects/veritymap/veritymap.hpp:19,
                 from /mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/projects/veritymap/veritymap.cpp:5:
/mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/tools/sketch/./include/sketch/./div.h:150:54: error: expected ')' before '&&' token
  150 |     template<typename...Args>Schismatic<int32_t>(Args &&...args):
      |                                                 ~    ^~~
      |                                                      )
/mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/src/tools/sketch/./include/sketch/./div.h:154:54: error: expected ')' before '&&' token
  154 |     template<typename...Args>Schismatic<int64_t>(Args &&...args):
      |                                                 ~    ^~~
      |                                                      )
make[3]: *** [src/projects/veritymap/CMakeFiles/veritymap.dir/build.make:76: src/projects/veritymap/CMakeFiles/veritymap.dir/veritymap.cpp.o] Error 1
make[3]: Leaving directory '/mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/build'
make[2]: *** [CMakeFiles/Makefile2:269: src/projects/veritymap/CMakeFiles/veritymap.dir/all] Error 2
make[2]: Leaving directory '/mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/build'
make[1]: *** [Makefile:91: all] Error 2
make[1]: Leaving directory '/mnt/data/Studium/Forschungspraktikum/code/VerityMap/veritymap/build'
make: *** [Makefile:12: veritymap] Error 2

as 'predicted' by you.
I tested it with both gcc/g++ v9.4 and v11.2 using conda. Same error for both versions.

@jeizenga jeizenga linked a pull request Jun 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants