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

C++11 / Ubuntu 12.04 #65

Closed
OrpheeGT opened this issue Jul 1, 2014 · 4 comments
Closed

C++11 / Ubuntu 12.04 #65

OrpheeGT opened this issue Jul 1, 2014 · 4 comments

Comments

@OrpheeGT
Copy link

OrpheeGT commented Jul 1, 2014

Hello,

I'm currently using Ubuntu 12.04 with GCC 4.6.4.

If I'm right, there is no support of C++11 with GCC 4.6.4

There is no GCC 4.8 on Ubuntu 12.04, only a PPA 4.8.1 with the following bug : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

So I tried to compile GCC 4.8.3 directly from sources... (I probably did something wrong...)

Default GCC :

/svn/git/libtorrent$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.4-1ubuntu1
12.04' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.4 (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04)

Default G++ :

/svn/git/libtorrent$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.4-1ubuntu1
12.04' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.4 (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04)

I built 4.8.3 and installed it, and updated alternatives :

GCC 4.8.3 :
~/svn/git/libtorrent$ gcc -v
Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8.3/lto-wrapper
Target: x86_64-linux-gnu
Configuré avec: ../configure -v --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8.3 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8.3 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-gmp=/usr/local/lib --with-mpc=/usr/lib --with-mpfr=/usr/lib --disable-checking
Modèle de thread: posix
gcc version 4.8.3 (GCC)

G++ 4.8.3 :

:~/svn/git/libtorrent$ g++ -v
Utilisation des specs internes.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8.3/lto-wrapper
Target: x86_64-linux-gnu
Configuré avec: ../configure -v --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8.3 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8.3 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-gmp=/usr/local/lib --with-mpc=/usr/lib --with-mpfr=/usr/lib --disable-checking
Modèle de thread: posix
gcc version 4.8.3 (GCC)

But when I try to build libtorrent/rtorrent I always have the following error :
checking C++11 support... configure: error: No support for C++11 found.

I found on google how to check C++11 :

g++ -E -dM -std=c++11 -x c++ /dev/null >b

with GCC 4.6.4 :
$ g++ -E -dM -std=c++11 -x c++ /dev/null >b
cc1plus: error: unrecognized command line option ‘-std=c++11’

With GCC 4.8.3 :
$ g++ -E -dM -std=c++11 -x c++ /dev/null >b
$
(no error)

Could you help me ?

Thank you

@rakshasa
Copy link
Owner

rakshasa commented Jul 1, 2014

Not with gcc compiler errors.

However the language/library features I intend to use for master branch in late C++0x found in GCC an CLang releases the past few years.

So 4.6 should be ok, and I'll add an option to enable c++0x and add tests as needed.

@OrpheeGT
Copy link
Author

OrpheeGT commented Jul 1, 2014

Ok thank you, I'll follow the commits :)

@rakshasa
Copy link
Owner

rakshasa commented Jul 2, 2014

The "--enable-c++0x" option has been committed.

@OrpheeGT
Copy link
Author

OrpheeGT commented Jul 3, 2014

Thank you, tried it and it works great.

I had to update 3 parameters in my rtorrent.rc

use_udp_trackers
peer_exchange
system.method.set_key

(found the new params in .sed file)

Thank you for all :)

@rakshasa rakshasa closed this as completed Jul 3, 2014
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

2 participants