elixir-sippet icon indicating copy to clipboard operation
elixir-sippet copied to clipboard

fix c src include

Open BrendanBall opened this issue 4 years ago • 5 comments

Currently it doesn't compile on Linux because of a missing include.

BrendanBall avatar Sep 30 '21 07:09 BrendanBall

Was not compiling on arch Linux, your fork fixed the issue, thanks

Flameaxio avatar Nov 09 '21 15:11 Flameaxio

Hey @Flameaxio, which fork you mean? Also do you mind posting the compile error you got?

balena avatar Jan 19 '22 09:01 balena

The fork that is pending in this pull request. Here is the log of compilation: https://textdoc.co/E1J3nTVLcehGwuSW

I'm not an Elixir dev btw, but we use this in Elixir subproject

Flameaxio avatar Jan 19 '22 10:01 Flameaxio

@balena here is the error dump

Generated elixir_make app
==> sippet
g++ -O3 -std=c++11 -Wall -fPIC -I /usr/local/lib/erlang/erts-12.3.2.2/include -I /usr/local/lib/erlang/usr/include  -c -o /builds/qliqdev/[MASKED]/deps/sippet/c_src/parser.o /builds/qliqdev/[MASKED]/deps/sippet/c_src/parser.cc
g++ -O3 -std=c++11 -Wall -fPIC -I /usr/local/lib/erlang/erts-12.3.2.2/include -I /usr/local/lib/erlang/usr/include  -c -o /builds/qliqdev/[MASKED]/deps/sippet/c_src/prtime.o /builds/qliqdev/[MASKED]/deps/sippet/c_src/prtime.cc
g++ -O3 -std=c++11 -Wall -fPIC -I /usr/local/lib/erlang/erts-12.3.2.2/include -I /usr/local/lib/erlang/usr/include  -c -o /builds/qliqdev/[MASKED]/deps/sippet/c_src/string_piece.o /builds/qliqdev/[MASKED]/deps/sippet/c_src/string_piece.cc
g++ -O3 -std=c++11 -Wall -fPIC -I /usr/local/lib/erlang/erts-12.3.2.2/include -I /usr/local/lib/erlang/usr/include  -c -o /builds/qliqdev/[MASKED]/deps/sippet/c_src/tokenizer.o /builds/qliqdev/[MASKED]/deps/sippet/c_src/tokenizer.cc
g++ -O3 -std=c++11 -Wall -fPIC -I /usr/local/lib/erlang/erts-12.3.2.2/include -I /usr/local/lib/erlang/usr/include  -c -o /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.o /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc: In static member function 'static bool {anonymous}::IteratorRangeToNumber<IteratorRangeToNumberTraits>::Invoke({anonymous}::IteratorRangeToNumber<IteratorRangeToNumberTraits>::const_iterator, {anonymous}::IteratorRangeToNumber<IteratorRangeToNumberTraits>::const_iterator, {anonymous}::IteratorRangeToNumber<IteratorRangeToNumberTraits>::value_type*)':
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:99:17: error: 'numeric_limits' is not a member of 'std'
   99 |       if (!std::numeric_limits<value_type>::is_signed) {
      |                 ^~~~~~~~~~~~~~
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:99:42: error: expected primary-expression before '>' token
   99 |       if (!std::numeric_limits<value_type>::is_signed) {
      |                                          ^
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:99:31: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
   99 |       if (!std::numeric_limits<value_type>::is_signed) {
      |                               ^
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:99:45: error: '::is_signed' has not been declared; did you mean 'std::is_signed'?
   99 |       if (!std::numeric_limits<value_type>::is_signed) {
      |                                             ^~~~~~~~~
      |                                             std::is_signed
In file included from /usr/include/c++/11.2.1/bits/move.h:57,
                 from /usr/include/c++/11.2.1/bits/stl_pair.h:59,
                 from /usr/include/c++/11.2.1/bits/stl_algobase.h:64,
                 from /usr/include/c++/11.2.1/bits/char_traits.h:39,
                 from /usr/include/c++/11.2.1/string:40,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.h:14,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:10:
/usr/include/c++/11.2.1/type_traits:795:12: note: 'std::is_signed' declared here
  795 |     struct is_signed
      |            ^~~~~~~~~
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc: In static member function 'static {anonymous}::BaseIteratorRangeToNumberTraits<ITERATOR, VALUE, BASE>::value_type {anonymous}::BaseIteratorRangeToNumberTraits<ITERATOR, VALUE, BASE>::min()':
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:200:17: error: 'numeric_limits' is not a member of 'std'
  200 |     return std::numeric_limits<value_type>::min();
      |                 ^~~~~~~~~~~~~~
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:200:42: error: expected primary-expression before '>' token
  200 |     return std::numeric_limits<value_type>::min();
      |                                          ^
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:200:45: error: '::min' has not been declared; did you mean 'std::min'?
  200 |     return std::numeric_limits<value_type>::min();
      |                                             ^~~
      |                                             std::min
In file included from /usr/include/c++/11.2.1/algorithm:62,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/string_tokenizer.h:8,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.h:16,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:10:
/usr/include/c++/11.2.1/bits/stl_algo.h:3455:5: note: 'std::min' declared here
 3455 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc: In static member function 'static {anonymous}::BaseIteratorRangeToNumberTraits<ITERATOR, VALUE, BASE>::value_type {anonymous}::BaseIteratorRangeToNumberTraits<ITERATOR, VALUE, BASE>::max()':
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:203:17: error: 'numeric_limits' is not a member of 'std'
  203 |     return std::numeric_limits<value_type>::max();
      |                 ^~~~~~~~~~~~~~
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:203:42: error: expected primary-expression before '>' token
  203 |     return std::numeric_limits<value_type>::max();
      |                                          ^
/builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:203:45: error: '::max' has not been declared; did you mean 'std::max'?
  203 |     return std::numeric_limits<value_type>::max();
      |                                             ^~~
      |                                             std::max
In file included from /usr/include/c++/11.2.1/algorithm:62,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/string_tokenizer.h:8,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.h:16,
                 from /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.cc:10:
/usr/include/c++/11.2.1/bits/stl_algo.h:3[467](https://gitlab.com/qliqdev/qliqweb-elixir/-/jobs/2629179754#L467):5: note: 'std::max' declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make: *** [Makefile:67: /builds/qliqdev/[MASKED]/deps/sippet/c_src/utils.o] Error 1
could not compile dependency :sippet, "mix compile" failed. You can recompile this dependency with "mix deps.compile sippet", update it with "mix deps.update sippet" or clean it with "mix deps.clean sippet"

Fix of @BrendanBall solves this issue I'd like this to be merged in master

sergey-lukianov avatar Jun 24 '22 05:06 sergey-lukianov

Same error here and fixed with the very same patch.

I'm on Fedora 35, erlang 24.3.4.3 (from distro) and g++ 11.3.1

xadhoom avatar Sep 05 '22 13:09 xadhoom