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

Cannot build graph on v1.11 #51

Open
hanslovsky opened this issue Feb 11, 2019 · 2 comments
Open

Cannot build graph on v1.11 #51

hanslovsky opened this issue Feb 11, 2019 · 2 comments

Comments

@hanslovsky
Copy link

Error:

[  3%] Built target solve-lmp-grid-graph
[  7%] Built target solve-mp-grid-graph
[ 11%] Built target solve-mp-complete-graph
[ 14%] Built target solve-mp
[ 16%] Building CXX object CMakeFiles/lift-mp-grid-graph.dir/src/command-line-tools/lift-mp-grid-graph.cxx.o
In file included from /home/hanslovskyp/git/graph/src/command-line-tools/lift-mp-grid-graph.cxx:13:
/home/hanslovskyp/git/graph/include/andres/graph/lifting.hxx: In instantiation of ‘void andres::graph::lift(const andres::graph::GridGraph<2, INPUT_GRAPH_VISITOR>&, OUTPUT_GRAPH&, std::size_t, std::size_t, andres::graph::LiftingMetric) [with INPUT_GRAPH_VISITOR = andres::graph::IdleGraphVisitor<long unsigned int>; OUTPUT_GRAPH = andres::graph::Graph<>; std::size_t = long unsigned int]’:
/home/hanslovskyp/git/graph/src/command-line-tools/lift-mp-grid-graph.cxx:124:119:   required from here
/home/hanslovskyp/git/graph/include/andres/graph/lifting.hxx:206:62: error: call of overloaded ‘abs(std::size_t)’ is ambiguous
                         const std::size_t distance = std::abs(x - cv[0]) + std::abs(y - cv[1]);
                                                      ~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/8.2.1/cstdlib:77,
                 from /usr/include/c++/8.2.1/ext/string_conversions.h:41,
                 from /usr/include/c++/8.2.1/bits/basic_string.h:6400,
                 from /usr/include/c++/8.2.1/string:52,
                 from /usr/include/c++/8.2.1/stdexcept:39,
                 from /home/hanslovskyp/git/graph/src/command-line-tools/lift-mp-grid-graph.cxx:1:
/usr/include/c++/8.2.1/bits/std_abs.h:56:3: note: candidate: ‘long int std::abs(long int)’
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:61:3: note: candidate: ‘long long int std::abs(long long int)’
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:70:3: note: candidate: ‘constexpr double std::abs(double)’
   abs(double __x)
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:74:3: note: candidate: ‘constexpr float std::abs(float)’
   abs(float __x)
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:78:3: note: candidate: ‘constexpr long double std::abs(long double)’
   abs(long double __x)
   ^~~
In file included from /usr/include/c++/8.2.1/cstdlib:75,
                 from /usr/include/c++/8.2.1/ext/string_conversions.h:41,
                 from /usr/include/c++/8.2.1/bits/basic_string.h:6400,
                 from /usr/include/c++/8.2.1/string:52,
                 from /usr/include/c++/8.2.1/stdexcept:39,
                 from /home/hanslovskyp/git/graph/src/command-line-tools/lift-mp-grid-graph.cxx:1:
/usr/include/stdlib.h:837:12: note: candidate: ‘int abs(int)’
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /home/hanslovskyp/git/graph/src/command-line-tools/lift-mp-grid-graph.cxx:13:
/home/hanslovskyp/git/graph/include/andres/graph/lifting.hxx:206:84: error: call of overloaded ‘abs(std::size_t)’ is ambiguous
                         const std::size_t distance = std::abs(x - cv[0]) + std::abs(y - cv[1]);
                                                                            ~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/8.2.1/cstdlib:77,
                 from /usr/include/c++/8.2.1/ext/string_conversions.h:41,
                 from /usr/include/c++/8.2.1/bits/basic_string.h:6400,
                 from /usr/include/c++/8.2.1/string:52,
                 from /usr/include/c++/8.2.1/stdexcept:39,
                 from /home/hanslovskyp/git/graph/src/command-line-tools/lift-mp-grid-graph.cxx:1:
/usr/include/c++/8.2.1/bits/std_abs.h:56:3: note: candidate: ‘long int std::abs(long int)’
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:61:3: note: candidate: ‘long long int std::abs(long long int)’
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:70:3: note: candidate: ‘constexpr double std::abs(double)’
   abs(double __x)
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:74:3: note: candidate: ‘constexpr float std::abs(float)’
   abs(float __x)
   ^~~
/usr/include/c++/8.2.1/bits/std_abs.h:78:3: note: candidate: ‘constexpr long double std::abs(long double)’
   abs(long double __x)
   ^~~
In file included from /usr/include/c++/8.2.1/cstdlib:75,
                 from /usr/include/c++/8.2.1/ext/string_conversions.h:41,
                 from /usr/include/c++/8.2.1/bits/basic_string.h:6400,
                 from /usr/include/c++/8.2.1/string:52,
                 from /usr/include/c++/8.2.1/stdexcept:39,
                 from /home/hanslovskyp/git/graph/src/command-line-tools/lift-mp-grid-graph.cxx:1:
/usr/include/stdlib.h:837:12: note: candidate: ‘int abs(int)’
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
make[2]: *** [CMakeFiles/lift-mp-grid-graph.dir/build.make:63: CMakeFiles/lift-mp-grid-graph.dir/src/command-line-tools/lift-mp-grid-graph.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:221: CMakeFiles/lift-mp-grid-graph.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
gcc --version
gcc (GCC) 8.2.1 20181127
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Steps to reproduce:

git clone [email protected]:bjoern-andres/graph
cd graph
mkdir build-1.11
cd build-1.11
git checkout v1.11
cmake .. -DCMAKE_INSTALL_PREFIX=$LOCAL
make
@Ali2500
Copy link

Ali2500 commented Sep 24, 2019

This seems to be related to the gcc/g++ version. I used gcc/g++ v5.5.0 and it build fine.

@xiedidan
Copy link

xiedidan commented Apr 6, 2021

const std::size_t distance = std::abs(int(x - cv[0])) + std::abs(int(y - cv[1])); should be ok

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

No branches or pull requests

3 participants