C++11 and boost::any

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

C++11 and boost::any

Post by ian.rees »

With the -std=c++11 enabled in master, we found a bug in the Boost 1.54 version of boost::any (detail), which is used in the FreeCAD Property system. Boost 1.54 is the default Boost installed in Ubuntu 14.04 (forum thread).

I can see three viable options going forward:

1) Bump minimum Boost version to 1.55 . Shouldn't be much headache for Ubuntu 14.04 users as it's a simple "apt-get install" to upgrade to 1.55, but Ubuntu 12.04 doesn't seem to offer that new of a Boost. We could make the Boost minimum version conditional on the version of gcc used; the older version of gcc in Ubuntu 12.04 doesn't seem to support the part of C++11 that triggers the bug.

2) Use something other than boost::any (which could be a newer version of boost::any packaged with FreeCAD).

3) Forget about this C++11 thing.

Any thoughts? -Ian-
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: C++11 and boost::any

Post by ickby »

we cannot forget about c++11 anymore, the whole new part design branch uses it extensivly!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: C++11 and boost::any

Post by triplus »

I guess one alternative to explore could be adding it to PPA (Ubuntu 12.04) or use this PPA:

https://launchpad.net/~boost-latest/+ar ... er=precise
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: C++11 and boost::any

Post by yorik »

I vote for 1). IMHO we'll need to go C++11 one day or another, so we'd better start adapting to it, but we cannot abandon ubuntu 12.04 (it will be supported until april 2017)... For now maybe add some conditions in cmake, so it compiles without C++11 flag on 12.04 and similar (not sure how to detect that, maybe indeed the gcc version). And well... 12.04 users won't be able to use PartDesignNext... Not much we can do about that...
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: C++11 and boost::any

Post by rockn »

I just upgrade to v1.55 libboost and FreeCAD run compil and run fine.
OS: Ubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6382 (Git)
Build type: Unknown
Branch: master
Hash: 35cc2879e5c71edda9ee48aa618d89efd1ba3918
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Formations - Assistance - Développement : https://freecad-france.com
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: C++11 and boost::any

Post by jmaustpc »

yorik wrote:I vote for 1). IMHO we'll need to go C++11 one day or another, so we'd better start adapting to it, but we cannot abandon ubuntu 12.04 (it will be supported until april 2017)... For now maybe add some conditions in cmake, so it compiles without C++11 flag on 12.04 and similar (not sure how to detect that, maybe indeed the gcc version). And well... 12.04 users won't be able to use PartDesignNext... Not much we can do about that...
As far as 12.04 goes, I have found a PPA for libboost1.55 and another for GCC4.8 (it also has more recent 4.9 and 5) I did find one site that claimed that the is a incompatibility in the format for GDB version in 12.04 but since it was only one reference and it was a while ago it may or may not be a problem and if it is they had a work around. But I will just try to get FreeCAD to compile with C++11 on 12.04 even if GDB does turn out not to work easily, it would still be progress.

I am doing this now and will come back when done.....

regarding 14.04
rockn wrote:I just upgrade to v1.55 libboost and FreeCAD run compil and run fine.
OS: Ubuntu 14.04.3 LTS
How did you do that? With a PPA or the official 1.55 packages? I tried install the libboost1.55-all-dev package as this is a convenient way to get all boost packages but it came up with an error saying it could not find a dependency which was the equivalent none dev package.
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: C++11 and boost::any

Post by wmayer »

I would also go for option 1). Btw, the PartDesignNexi is this the adjusted PartDesign module or is this a complete new implementation offered as a separate module?
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: C++11 and boost::any

Post by jmaustpc »

wmayer wrote:I would also go for option 1). Btw, the PartDesignNexi is this the adjusted PartDesign module or is this a complete new implementation offered as a separate module?
its the adjusted PartDesign module, so you loose the old PartDesign
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: C++11 and boost::any

Post by rockn »

jmaustpc wrote:How did you do that? With a PPA or the official 1.55 packages? I tried install the libboost1.55-all-dev package as this is a convenient way to get all boost packages but it came up with an error saying it could not find a dependency which was the equivalent none dev package.
Yep, it was not very easy, in synaptic I show only libboost package, then I select all package with 1.54 and dev and mark it to uninstall.
Then I select all package with 1.55-dev and mark it to install. It automatically add 1.55 non dev package to install.
There is only one 1.54 non dev package that will be uninstalled : libboost-mpi-python1.54.0

In this message,
translate " sera désinstallé ainsi que ses fichiers de configuration" by "will be uninstalled with config file"
and "sera installé" by "will be installed"

Code: Select all

libboost-all-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-atomic-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-atomic1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-chrono-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-chrono1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-context-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-context1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-coroutine-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-coroutine1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-date-time-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-date-time1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-exception-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-exception1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-filesystem-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-filesystem1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-graph-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-graph-parallel-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-graph-parallel1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-graph1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-iostreams-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-iostreams1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-locale-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-locale1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-log-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-log1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-math-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-math1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-mpi-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-mpi-python-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-mpi-python1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-mpi1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-program-options-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-program-options1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-python-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-python1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-random-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-random1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-regex-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-regex1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-serialization-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-serialization1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-signals-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-signals1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-system-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-system1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-test-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-test1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-thread-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-thread1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-timer-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-timer1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-tools-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-wave-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-wave1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost1.54-dev sera désinstallé ainsi que ses fichiers de configuration
libboost1.54-tools-dev sera désinstallé ainsi que ses fichiers de configuration
libboost-mpi-python1.54.0 sera désinstallé
gccxml (version 0.9.0+git20130511-1ubuntu2) sera installé
libboost-atomic1.55-dev (version 1.55.0-1) sera installé
libboost-atomic1.55.0 (version 1.55.0-1) sera installé
libboost-chrono1.55-dev (version 1.55.0-1) sera installé
libboost-chrono1.55.0 (version 1.55.0-1) sera installé
libboost-context1.55-dev (version 1.55.0-1) sera installé
libboost-context1.55.0 (version 1.55.0-1) sera installé
libboost-coroutine1.55-dev (version 1.55.0-1) sera installé
libboost-date-time1.55-dev (version 1.55.0-1) sera installé
libboost-date-time1.55.0 (version 1.55.0-1) sera installé
libboost-exception1.55-dev (version 1.55.0-1) sera installé
libboost-filesystem1.55-dev (version 1.55.0-1) sera installé
libboost-filesystem1.55.0 (version 1.55.0-1) sera installé
libboost-graph-parallel1.55-dev (version 1.55.0-1) sera installé
libboost-graph-parallel1.55.0 (version 1.55.0-1) sera installé
libboost-graph1.55-dev (version 1.55.0-1) sera installé
libboost-graph1.55.0 (version 1.55.0-1) sera installé
libboost-iostreams1.55-dev (version 1.55.0-1) sera installé
libboost-iostreams1.55.0 (version 1.55.0-1) sera installé
libboost-locale1.55-dev (version 1.55.0-1) sera installé
libboost-locale1.55.0 (version 1.55.0-1) sera installé
libboost-log1.55-dev (version 1.55.0-1) sera installé
libboost-log1.55.0 (version 1.55.0-1) sera installé
libboost-math1.55-dev (version 1.55.0-1) sera installé
libboost-math1.55.0 (version 1.55.0-1) sera installé
libboost-mpi-python1.55-dev (version 1.55.0-1) sera installé
libboost-mpi-python1.55.0 (version 1.55.0-1) sera installé
libboost-mpi1.55-dev (version 1.55.0-1) sera installé
libboost-mpi1.55.0 (version 1.55.0-1) sera installé
libboost-program-options1.55-dev (version 1.55.0-1) sera installé
libboost-program-options1.55.0 (version 1.55.0-1) sera installé
libboost-python1.55-dev (version 1.55.0-1) sera installé
libboost-python1.55.0 (version 1.55.0-1) sera installé
libboost-random1.55-dev (version 1.55.0-1) sera installé
libboost-random1.55.0 (version 1.55.0-1) sera installé
libboost-regex1.55-dev (version 1.55.0-1) sera installé
libboost-regex1.55.0 (version 1.55.0-1) sera installé
libboost-serialization1.55-dev (version 1.55.0-1) sera installé
libboost-serialization1.55.0 (version 1.55.0-1) sera installé
libboost-signals1.55-dev (version 1.55.0-1) sera installé
libboost-signals1.55.0 (version 1.55.0-1) sera installé
libboost-system1.55-dev (version 1.55.0-1) sera installé
libboost-system1.55.0 (version 1.55.0-1) sera installé
libboost-test1.55-dev (version 1.55.0-1) sera installé
libboost-test1.55.0 (version 1.55.0-1) sera installé
libboost-thread1.55-dev (version 1.55.0-1) sera installé
libboost-thread1.55.0 (version 1.55.0-1) sera installé
libboost-timer1.55-dev (version 1.55.0-1) sera installé
libboost-timer1.55.0 (version 1.55.0-1) sera installé
libboost-wave1.55-dev (version 1.55.0-1) sera installé
libboost-wave1.55.0 (version 1.55.0-1) sera installé
libboost1.55-all-dev (version 1.55.0-1) sera installé
libboost1.55-dev (version 1.55.0-1) sera installé
libboost1.55-tools-dev (version 1.55.0-1) sera installé
Hope it help !
Formations - Assistance - Développement : https://freecad-france.com
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: C++11 and boost::any

Post by jmaustpc »

this is the PPA to add Boost 1.55 to 12.04,

https://launchpad.net/~boost-latest/+archive/ubuntu/ppa


this is a link to instructions on how to add the PPA for GCC4.8 and importantly how to then configure the system to use 4.8 rather than the default previously installed GCC.

http://ubuntuhandbook.org/index.php/201 ... -04-13-04/

I have not yet looked into how to update Cmake ...if that is also needed...I don't know if it needs to be updated or not yet...does anyone else know?

I have nearly finished the above, I will pull master shortly and do an incremental build .... but I would think I may need to do a full build...anyway back in a bit...
Post Reply