A word about C++11 (my humble opinion)

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

A word about C++11 (my humble opinion)

jbect
Hello everyone,

Just wanted to share my disappointment: I just realized that, because of
the introduction of C++11 features, the "parallel" package cannot be
installed on Ubuntu 12.04 LTS.

(DISCLAIMER : I don't personally use Ubuntu 12.04 LTS, the problem
happened for a colleague that has to use it.)

The reason is that Ubuntu 12.04 LTS has gcc 4.6.3, which only has a
limited support for C++11 features (and apparently not the ones needed
by the parallel package, I have bypassed the configure check and can
confirm than compilation indeed fails).

I wouldn't call Ubuntu 12.04 LTS a *very* old release.  It is certainly
old in some sense, but Ubuntu 12.04 LTS was release only four years ago,
Ubuntu 12.04.5 two years ago, and this distribution hasn't reached its
"end of life" date...

I haven't tested, but the same can be said of Debian Wheezy (7.0), which
was released in 2013 and will reach its LTS end of life in May 2018.  
Wheezy has gcc 4.7, with a better but still incomplete support of C++11...

I have seen messages in the mailing list suggesting that more and more
C++11 feature are starting to be used in Octave itself...

Does anyone know what is currently the oldest version of gcc that can
compile octave stable ? default ?

Wouldn't it be a reasonable policy to refrain from using C++11 features
that are unsupported in versions of gcc that are still "in production" ?

Just my two cents.

@++
Julien


PS@Olaf: please don't take it personally, the parallel package is just
the one that triggered theses thoughts this morning ;-)



Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

tmacchant
----- Original Message -----

> From: Julien Bect 
> To: octave-maintainers
> Cc:
> Date: 2016/6/22, Wed 18:26
> Subject: A word about C++11 (my humble opinion)
>
> Hello everyone,
>
> Just wanted to share my disappointment: I just realized that, because of the
> introduction of C++11 features, the "parallel" package cannot be
> installed on Ubuntu 12.04 LTS.
>
> (DISCLAIMER : I don't personally use Ubuntu 12.04 LTS, the problem happened
> for a colleague that has to use it.)
>
> The reason is that Ubuntu 12.04 LTS has gcc 4.6.3, which only has a limited
> support for C++11 features (and apparently not the ones needed by the parallel
> package, I have bypassed the configure check and can confirm than compilation
> indeed fails).
>
> I wouldn't call Ubuntu 12.04 LTS a *very* old release.  It is certainly old
> in some sense, but Ubuntu 12.04 LTS was release only four years ago, Ubuntu
> 12.04.5 two years ago, and this distribution hasn't reached its "end of
> life" date...
>
> I haven't tested, but the same can be said of Debian Wheezy (7.0), which was
> released in 2013 and will reach its LTS end of life in May 2018.  Wheezy has gcc
> 4.7, with a better but still incomplete support of C++11...
>
> I have seen messages in the mailing list suggesting that more and more C++11
> feature are starting to be used in Octave itself...
>
> Does anyone know what is currently the oldest version of gcc that can compile
> octave stable ? default ?
>
> Wouldn't it be a reasonable policy to refrain from using C++11 features that
> are unsupported in versions of gcc that are still "in production" ?
>
> Just my two cents.
>
> @++
> Julien
>
>
> PS@Olaf: please don't take it personally, the parallel package is just the
> one that triggered theses thoughts this morning ;-)


I previously used lubuntu 12.04 and now that PC is not used now.
At that time I have installed gcc-4.8 for Ubuntu 12.04 and used octave build.
(The osmesa was built from source [2].)
I forgotten reason why I decided to use gcc-4.8 instead of gcc-4.6.


At the configure
cd build

CC='gcc-4.8' \
CXX='g++-4.8' \
F77='gfortran-4.8' \
../configure (proper options)

I was anxious that libraries on repo. were built gcc 4.6 but octave were built gcc 4.8.
However, I had not met troubles as far as I had used.

Tatsuro


[1] http://ubuntuhandbook.org/index.php/2013/08/install-gcc-4-8-via-ppa-in-ubuntu-12-04-13-04/
(Unlike the above instruction I kept gcc 4.6 as default compilier. )

[2] http://wiki.octave.org/OSMesa
(options were slightly arranged for success build)


Tatsuro

Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

Mike Miller-4
In reply to this post by jbect
On Wed, Jun 22, 2016 at 11:26:48 +0200, Julien Bect wrote:
> Just wanted to share my disappointment: I just realized that, because of the
> introduction of C++11 features, the "parallel" package cannot be installed
> on Ubuntu 12.04 LTS.

I can't speak for Olaf's decision on the parallel package, only for
Octave itself.

> The reason is that Ubuntu 12.04 LTS has gcc 4.6.3, which only has a limited
> support for C++11 features (and apparently not the ones needed by the
> parallel package, I have bypassed the configure check and can confirm than
> compilation indeed fails).

Correct, and thank you for confirming that GCC 4.6 doesn't cut it.

> I wouldn't call Ubuntu 12.04 LTS a *very* old release.  It is certainly old
> in some sense, but Ubuntu 12.04 LTS was release only four years ago, Ubuntu
> 12.04.5 two years ago, and this distribution hasn't reached its "end of
> life" date...

But it has been superseded by two LTS releases in the meantime. If one
is wary of upgrading to an LTS release in the first few months after its
release, 14.04 should be a viable “stable” release.

Just because it is not EOL does not mean users should expect all new
software to still work flawlessly with it. Being “supported” means that
you can still use it with the generation of software that it was
released with and still get security updates.

> I haven't tested, but the same can be said of Debian Wheezy (7.0), which was
> released in 2013 and will reach its LTS end of life in May 2018.  Wheezy has
> gcc 4.7, with a better but still incomplete support of C++11...

Correct, I would say the same thing about Debian 7. I still have a
Debian 7 server running that I haven't gotten around to updating, but I
wouldn't expect to be able to run the latest software on it, only to
keep it running as is with the software that was packaged for it.

> I have seen messages in the mailing list suggesting that more and more C++11
> feature are starting to be used in Octave itself...

Correct.

> Does anyone know what is currently the oldest version of gcc that can
> compile octave stable ? default ?

I believe that the default branch can be compiled with GCC 4.8 and
newer. I think that is a reasonable minimum version to aim for.

I think the stable (4.0.x) branch can still be compiled with GCC 4.1
(RHEL 5).

> Wouldn't it be a reasonable policy to refrain from using C++11 features that
> are unsupported in versions of gcc that are still "in production" ?

Yes, we may have different definitions of what “in production” means :)

I think it is a reasonable policy to require a GCC that is available on
“stable” versions of popular distributions at the time of the next
release. That includes Debian 8, Ubuntu 14.04, and RHEL/CentOS 7.

If someone wants to attempt to build Octave on a “barely hanging on”
version of a distribution, we can surely help them do that to some
extent. The first step would be installing/upgrading the system tools
and libraries to newer versions, including GCC, and probably OpenBLAS
and SuiteSparse as well.

Thanks for the feedback and discussion,

--
mike

Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

Przemek Klosowski-7
On 06/22/2016 11:33 AM, Mike Miller wrote:
On Wed, Jun 22, 2016 at 11:26:48 +0200, Julien Bect wrote:
Just wanted to share my disappointment: I just realized that, because of the
introduction of C++11 features, the "parallel" package cannot be installed
on Ubuntu 12.04 LTS.
[...]
I haven't tested, but the same can be said of Debian Wheezy (7.0), which was
released in 2013 and will reach its LTS end of life in May 2018.  Wheezy has
gcc 4.7, with a better but still incomplete support of C++11...
Correct, I would say the same thing about Debian 7. I still have a
Debian 7 server running that I haven't gotten around to updating, but I
wouldn't expect to be able to run the latest software on it, only to
keep it running as is with the software that was packaged for it.
Right---the development target environment has to be the latest available. After all, new versions of the compiler could fail to compile old code, and the only sane approach is to track the code to the newest compiler.

BTW, I think that the parallel package built with newer versions of GCC should run on the old system---you just can't compile it yourself on the old system, right?
Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

Dmitri A. Sergatskov


On Wed, Jun 22, 2016 at 12:41 PM, Przemek Klosowski <[hidden email]> wrote:
On 06/22/2016 11:33 AM, Mike Miller wrote:
On Wed, Jun 22, 2016 at 11:26:48 +0200, Julien Bect wrote:
Just wanted to share my disappointment: I just realized that, because of the
introduction of C++11 features, the "parallel" package cannot be installed
on Ubuntu 12.04 LTS.
[...]
I haven't tested, but the same can be said of Debian Wheezy (7.0), which was
released in 2013 and will reach its LTS end of life in May 2018.  Wheezy has
gcc 4.7, with a better but still incomplete support of C++11...
Correct, I would say the same thing about Debian 7. I still have a
Debian 7 server running that I haven't gotten around to updating, but I
wouldn't expect to be able to run the latest software on it, only to
keep it running as is with the software that was packaged for it.
Right---the development target environment has to be the latest available. After all, new versions of the compiler could fail to compile old code, and the only sane approach is to track the code to the newest compiler.

BTW, I think that the parallel package built with newer versions of GCC should run on the old system---you just can't compile it yourself on the old system, right?

​I think it is more realistic to install a newer gcc (in addition to the system's one)​.
I suspect gcc4.6 may be able to compile 5.x.

Dmitri.
--



Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

Rik-4
In reply to this post by jbect
On 06/22/2016 04:20 AM, [hidden email] wrote:
Subject:
A word about C++11 (my humble opinion)
From:
Julien Bect [hidden email]
Date:
06/22/2016 02:26 AM
To:
octave-maintainers [hidden email]
List-Post:
[hidden email]
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
Message-ID:
[hidden email]
Content-Type:
text/plain; charset=utf-8; format=flowed
Message:
5

Hello everyone,

Just wanted to share my disappointment: I just realized that, because of the introduction of C++11 features, the "parallel" package cannot be installed on Ubuntu 12.04 LTS.

(DISCLAIMER : I don't personally use Ubuntu 12.04 LTS, the problem happened for a colleague that has to use it.)

The reason is that Ubuntu 12.04 LTS has gcc 4.6.3, which only has a limited support for C++11 features (and apparently not the ones needed by the parallel package, I have bypassed the configure check and can confirm than compilation indeed fails).

I wouldn't call Ubuntu 12.04 LTS a *very* old release.  It is certainly old in some sense, but Ubuntu 12.04 LTS was release only four years ago, Ubuntu 12.04.5 two years ago, and this distribution hasn't reached its "end of life" date...

I haven't tested, but the same can be said of Debian Wheezy (7.0), which was released in 2013 and will reach its LTS end of life in May 2018.  Wheezy has gcc 4.7, with a better but still incomplete support of C++11...

I have seen messages in the mailing list suggesting that more and more C++11 feature are starting to be used in Octave itself...

Yes, the next major release, 4.2, will require C++11 for the core.  It will have been at least 5+ years since these features started to become available in compilers so we haven't been exactly hurrying to adopt new syntax.


Does anyone know what is currently the oldest version of gcc that can compile octave stable ? default ?

I think it is important to differentiate between Octave core and packages maintained at Octave Forge.  The stable version of core Octave should still be able to be compiled on 12.04.  The policies of any particular Octave Forge package, however, are set by the package maintainer.  If they want to require something different they can.

I do think Tatsuro's suggestion to build a more modern gcc is good if you absolutely must continue on 12.04.

--Rik
Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

LachlanA
Rik-4 wrote
I do think Tatsuro's suggestion to build a more modern gcc is good if you
absolutely must continue on 12.04.
I agree with Julien that we should be mindful of old computers.

When my computer was in for repairs, I recently had to use a 2005 laptop, with 512M of memory.  To keep everything manageable, I installed an old version of Ubuntu (12.04? 10.04?) so the GUI wasn't too bloated, and compiled more modern versions the tools I needed.  I didn't install the latest, because I assumed that they too would be heavier than their predecessors.

IIRC, the most thrashing occurred compiling the monolithic graphics.cc; it would have been easier if it had been broken into smaller files.

Also, although development code *compiles* fine with gcc 4.8, it currently fails five self-check tests.

$0.02,
Lachlan
Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

Olaf Till-2
In reply to this post by Rik-4
On Wed, Jun 22, 2016 at 11:46:44AM -0700, Rik wrote:
> ...
> I think it is important to differentiate between Octave core and packages
> maintained at Octave Forge.  The stable version of core Octave should still
> be able to be compiled on 12.04.  The policies of any particular Octave
> Forge package, however, are set by the package maintainer.  If they want to
> require something different they can.

Well, they can't quite do what they want, of course ... As for the
parallel package, constructor delegation made some new feature cleaner
to implement. And since Octave development branch requires c++11, it
will be required by the next major Octave release anyway -- so if a
package requires c++11 already now, it only shifts the issue for a
short span of time.

Olaf

--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: A word about C++11 (my humble opinion)

jbect
Le 23/06/2016 à 10:52, Olaf Till a écrit :
On Wed, Jun 22, 2016 at 11:46:44AM -0700, Rik wrote:
> ... > I think it is important to differentiate between Octave core and packages > maintained at Octave Forge. The stable version of core Octave should still > be able to be compiled on 12.04. The policies of any particular Octave > Forge package, however, are set by the package maintainer. If they want to > require something different they can.
Well, they can't quite do what they want, of course ... As for the parallel package, constructor delegation made some new feature cleaner to implement. And since Octave development branch requires c++11, it will be required by the next major Octave release anyway -- so if a package requires c++11 already now, it only shifts the issue for a short span of time.

As I said, the problem is not that *some* C++11 features are required, but depends on *which* feature you require.

For instance, "constructor delegation" (I don't even know what that means), since you mention it, is supported in gcc 4.7 and later.

Therefore, using this specific features means that people still using gcc 4.6 will have problems (sure, they can manually install a more recent gcc, for instance using mxe-octave, but that's not the point; requiring this feature just made their life more complicated).

Then there is a choice.  On the one hand, for the developer, as you said, "some new features [are] cleaner to implement" with gcc 4.7.  On the other some users (hard to say how many) curse either the sysadmin that leave them with gcc 4.6 or the developper that broke compatiblity with gcc 4.6 (perhaps for a good reason, but still...).

I would have chosen to preserve compatibility with gcc 4.6 as long as possible.  A different choice has been made in Octave 4.2 and even already in some OF packages.  I can understand this choice.

Thanks to all the people that joined this discussion.

@++
Julien