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

fails to compile on Debian/stretch #16

Closed
umlaeute opened this issue Oct 25, 2016 · 7 comments
Closed

fails to compile on Debian/stretch #16

umlaeute opened this issue Oct 25, 2016 · 7 comments

Comments

@umlaeute
Copy link
Contributor

for whatever reasons, Link fails to build from source on Debian stretch/sid amd64 as of today

$ mkdir build
$ cd build
$ cmake -DLINK_PLATFORM_LINUX=1  ..
$ cmake --build .
[...]
[ 53%] Building CXX object src/CMakeFiles/LinkCoreTest.dir/ableton/link/tst_LinearRegression.cpp.o
/tmp/zmoelnig/ableton-link/src/ableton/link/tst_LinearRegression.cpp: In function ‘void ableton::link::____C_A_T_C_H____T_E_S_T____39()’:
/tmp/zmoelnig/ableton-link/src/ableton/link/tst_LinearRegression.cpp:43:14: error: ambiguous overload for ‘operator=’ (operand types are ‘std::array<std::pair<double, double>, 1ul>::value_type {aka std::pair<double, double>}’ and ‘<brace-enclosed initializer list>’)
   data[0] = {};
              ^
In file included from /usr/include/c++/6/utility:70:0,
                 from /tmp/zmoelnig/ableton-link/include/ableton/link/LinearRegression.hpp:25,
                 from /tmp/zmoelnig/ableton-link/src/ableton/link/tst_LinearRegression.cpp:20:
/usr/include/c++/6/bits/stl_pair.h:359:7: note: candidate: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(typename std::conditional<std::__and_<std::is_copy_assignable<_Tp>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type) [with _T1 = double; _T2 = double; typename std::conditional<std::__and_<std::is_copy_assignable<_Tp>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type = const std::pair<double, double>&]
       operator=(typename conditional<
       ^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:370:7: note: candidate: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(typename std::conditional<std::__not_<std::__and_<std::is_copy_assignable<_Tp>, std::is_copy_assignable<_T2> > >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type) [with _T1 = double; _T2 = double; typename std::conditional<std::__not_<std::__and_<std::is_copy_assignable<_Tp>, std::is_copy_assignable<_T2> > >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type = const std::__nonesuch&] <deleted>
       operator=(typename conditional<
       ^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:376:7: note: candidate: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(typename std::conditional<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value, std::pair<_T1, _T2>&&, std::__nonesuch&&>::type) [with _T1 = double; _T2 = double; typename std::conditional<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value, std::pair<_T1, _T2>&&, std::__nonesuch&&>::type = std::pair<double, double>&&]
       operator=(typename conditional<
       ^~~~~~~~
src/CMakeFiles/LinkCoreTest.dir/build.make:182: recipe for target 'src/CMakeFiles/LinkCoreTest.dir/ableton/link/tst_LinearRegression.cpp.o' failed
make[2]: *** [src/CMakeFiles/LinkCoreTest.dir/ableton/link/tst_LinearRegression.cpp.o] Error 1
CMakeFiles/Makefile2:142: recipe for target 'src/CMakeFiles/LinkCoreTest.dir/all' failed
make[1]: *** [src/CMakeFiles/LinkCoreTest.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I tried with both stock compilers, but the result is the same:

$ g++ --version
g++ (Debian 6.2.0-7) 6.2.0 20161018
Copyright (C) 2016 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.

$ clang++ --version
clang version 3.8.1-12 (tags/RELEASE_381/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
@umlaeute
Copy link
Contributor Author

oh, and I tried both master/HEAD (aka d4fb22b) and Link-1.0.0 (aka c33d22b), with the same result.

@nre-ableton
Copy link
Contributor

Can you please show the output with clang? I suspect that the build with GCC on Linux might be legitimately broken, as we only test g++-5 on CI. However, clang-3.8 should definitely work.

Also, it is not necessary to manually define -DLINK_PLATFORM_LINUX=1 if you are building with CMake. That is only necessary when building with a build system other than CMake, but CMake should be able to tell that you are on Linux. That said, I don't think that this definition is causing the build error.

@umlaeute
Copy link
Contributor Author

$ rm -rf build
$ mkdir build
$ cd build
$ cmake -DCMAKE_CXX_COMPILER=clang++ ..
[...]
$ cmake --build . -- VERBOSE=1
[...]
[ 35%] Building CXX object src/CMakeFiles/LinkCoreTest.dir/ableton/link/tst_LinearRegression.cpp.o
cd /foo/bar/ableton-link/build/src && /usr/bin/clang++   -DLINK_PLATFORM_LINUX=1 -DLINK_PLATFORM_UNIX=1 -DLINK_WORD_SIZE=64 -isystem /foo/bar/ableton-link/modules/catch/single_include -isystem /foo/bar/ableton-link/include -isystem /foo/bar/ableton-link/cmake_include/../modules/asio-standalone/asio/include  -Werror -Wno-deprecated -Wno-global-constructors -Wno-over-aligned -m64   -m64 -std=gnu++11 -o CMakeFiles/LinkCoreTest.dir/ableton/link/tst_LinearRegression.cpp.o -c /foo/bar/ableton-link/src/ableton/link/tst_LinearRegression.cpp
/foo/bar/ableton-link/src/ableton/link/tst_LinearRegression.cpp:43:11: error: use of overloaded operator '=' is ambiguous (with operand types 'value_type' (aka 'std::pair<double, double>') and 'void')
  data[0] = {};
  ~~~~~~~ ^ ~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/bits/stl_pair.h:376:7: note: candidate function
      operator=(typename conditional<
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/bits/stl_pair.h:359:7: note: candidate function
      operator=(typename conditional<
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/bits/stl_pair.h:370:7: note: candidate function has been explicitly deleted
      operator=(typename conditional<
      ^
1 error generated.
src/CMakeFiles/LinkCoreTest.dir/build.make:182: recipe for target 'src/CMakeFiles/LinkCoreTest.dir/ableton/link/tst_LinearRegression.cpp.o' failed
make[2]: *** [src/CMakeFiles/LinkCoreTest.dir/ableton/link/tst_LinearRegression.cpp.o] Error 1
make[2]: Leaving directory '/foo/bar/ableton-link/build'
CMakeFiles/Makefile2:142: recipe for target 'src/CMakeFiles/LinkCoreTest.dir/all' failed
make[1]: *** [src/CMakeFiles/LinkCoreTest.dir/all] Error 2
make[1]: Leaving directory '/foo/bar/ableton-link/build'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
$

as you can see, even though clang++ is used, the header files are still somehow related to 6.2.0

however, explicitely setting both C-compiler and C++-compiler to the same generation, seems to work:

cmake -DCMAKE_CXX_COMPILER=g++-5 -DCMAKE_C_COMPILER=gcc-5 ..

resp.

cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..

@umlaeute
Copy link
Contributor Author

oops, that was too early.
while explicitely requestion gcc/g++-5 as compilers works

cmake -DCMAKE_CXX_COMPILER=g++-5 -DCMAKE_C_COMPILER=gcc-5 ..

the same is not true for the clang case. thus the following fails with the originally reported error:

cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..

obviously, clang++ picks up the headers installed by g++-6.

@umlaeute
Copy link
Contributor Author

also note, that i'm currently trying to package ableton-link for inclusion with Debian proper, and the soone to be frozen Debian/stretch, and as such it is strongly suggested that it compiles with the default compiler, which currently is g++-6

@nettoyeurny
Copy link

FWIW, I ran into the same problem on Ubuntu Studio 12.10 and worked around it by simply removing the offending test case. (The Link library itself and the LinkHut sample app build just fine.)

@fgo-ableton
Copy link
Collaborator

I pushed a fix. Should work with both compilers now.

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

No branches or pull requests

4 participants