build errors: "type of ‘std::copysign’ is unknown"

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

build errors: "type of ‘std::copysign’ is unknown"

Colin Macdonald-2

I updated my system to Fedora 24; when rebuilding Octave dev I get the
following errors (any many more for other math.h functions).

Anyone recognize this?

-----------------------------------------------------

   CXX      libgui/src/m-editor/libgui_src_libgui_src_la-octave-txt-lexer.lo
In file included from /usr/include/sys/types.h:219:0,
                  from libgnu/sys/types.h:28,
                  from /usr/include/stdlib.h:314,
                  from /usr/include/c++/6.1.1/cstdlib:75,
                  from /usr/include/c++/6.1.1/bits/stl_algo.h:59,
                  from /usr/include/c++/6.1.1/algorithm:62,
                  from /usr/include/QtCore/qglobal.h:68,
                  from /usr/include/QtCore/qnamespace.h:45,
                  from /usr/include/QtCore/qobjectdefs.h:45,
                  from /usr/include/QtCore/qobject.h:47,
                  from /usr/include/QtCore/qabstracteventdispatcher.h:45,
                  from /usr/include/QtCore/QtCore:3,
                  from /usr/include/QtGui/QtGui:3,
                  from libgui/src/m-editor/find-dialog.cc:68:
libgnu/math.h:775:1: error: type of ‘std::copysign’ is unknown
  _GL_CXXALIASWARN (copysign);
  ^
libgnu/math.h:775:1: error: ‘int copysign’ redeclared as different kind
of symbol
  _GL_CXXALIASWARN (copysign);
  ^
In file included from /usr/include/c++/6.1.1/math.h:36:0,
                  from libgnu/math.h:27,
                  from /usr/include/QtCore/qmath.h:45,
                  from /usr/include/QtCore/QtCore:9,
                  from /usr/include/QtGui/QtGui:3,
                  from libgui/src/m-editor/find-dialog.cc:68:
/usr/include/c++/6.1.1/cmath:1288:3: note: previous declaration
‘constexpr float std::copysign(float, float)’
    copysign(float __x, float __y)
    ^~~~~~~~

-----------------------------------------------------

Previously to this error, I was getting:

libinterp/corefcn/oct-tex-parser.cc: In function ‘int
octave_tex_parse(text_parser_tex&)’:
./oct-conf-post.h:24:28: error: ‘malloc’ is not a member of ‘gnulib’
  #  define GNULIB_NAMESPACE gnulib

I installed a `gnulib-devel` that I don't recall needed on Fedora 23
which got paste that part but perhaps causes the above?

thanks,
Colin

Reply | Threaded
Open this post in threaded view
|

Re: build errors: "type of ‘std::copysign’ is unknown"

Mike Miller-4
On Mon, Jun 06, 2016 at 11:19:36 -0700, Colin Macdonald wrote:
>
> I updated my system to Fedora 24; when rebuilding Octave dev I get the
> following errors (any many more for other math.h functions).
>
> Anyone recognize this?

Basically, Octave doesn't build with gcc 6 currently.

There have been some threads about this but I don't think any decisions
about what to fix or progress has been made yet.

My understanding is

 * Octave has for some time used gnulib to replace both system and math
   library functions, and has been designed under the assumption that
   `#include <cmath>` would make functions such as `gnulib::floor`
   available to C++ modules

 * Gcc 6 has been made more strict, such that `#include <cmath>`
   includes the *system* math.h rather than any other math.h that may
   appear in the include search path

 * Gnulib has support for C++ to the extent that they will wrap their
   C library replacement functions in a namespace of the user's
   choosing, but they do not (to my knowledge) provide replacements for
   any standard C++ headers or functions

This may end up leaving Octave in the position that we have to decide to
use only C library header files when expicitly using the gnulib
replacement functions, and not use gnulib functions at the same time as
we are using the C++ standard library.

I'm sure help on fixing this would be appreciated. Otherwise you might
want to keep a gcc 5 handy for building Octave.

Some starting points:

http://lists.gnu.org/archive/html/octave-maintainers/2016-02/msg00164.html
https://lists.fedoraproject.org/archives/list/devel@.../thread/74YWUCBM7KR2FCACH3WQNTX75WB76JSD
https://savannah.gnu.org/bugs/?47073

--
mike

Reply | Threaded
Open this post in threaded view
|

Re: build errors: "type of ‘std::copysign’ is unknown"

John W. Eaton
Administrator
This is high on my list of things to work on, but I don't have a
solution yet.  I'm still trying to decide what the best path forward is.

jwe


On 06/06/2016 02:35 PM, Mike Miller wrote:

> On Mon, Jun 06, 2016 at 11:19:36 -0700, Colin Macdonald wrote:
>>
>> I updated my system to Fedora 24; when rebuilding Octave dev I get the
>> following errors (any many more for other math.h functions).
>>
>> Anyone recognize this?
>
> Basically, Octave doesn't build with gcc 6 currently.
>
> There have been some threads about this but I don't think any decisions
> about what to fix or progress has been made yet.
>
> My understanding is
>
>   * Octave has for some time used gnulib to replace both system and math
>     library functions, and has been designed under the assumption that
>     `#include <cmath>` would make functions such as `gnulib::floor`
>     available to C++ modules
>
>   * Gcc 6 has been made more strict, such that `#include <cmath>`
>     includes the *system* math.h rather than any other math.h that may
>     appear in the include search path
>
>   * Gnulib has support for C++ to the extent that they will wrap their
>     C library replacement functions in a namespace of the user's
>     choosing, but they do not (to my knowledge) provide replacements for
>     any standard C++ headers or functions
>
> This may end up leaving Octave in the position that we have to decide to
> use only C library header files when expicitly using the gnulib
> replacement functions, and not use gnulib functions at the same time as
> we are using the C++ standard library.
>
> I'm sure help on fixing this would be appreciated. Otherwise you might
> want to keep a gcc 5 handy for building Octave.
>
> Some starting points:
>
> http://lists.gnu.org/archive/html/octave-maintainers/2016-02/msg00164.html
> https://lists.fedoraproject.org/archives/list/devel@.../thread/74YWUCBM7KR2FCACH3WQNTX75WB76JSD
> https://savannah.gnu.org/bugs/?47073
>


Reply | Threaded
Open this post in threaded view
|

Re: build errors: "type of ‘std::copysign’ is unknown"

Michael Godfrey
In reply to this post by Mike Miller-4


On 06/06/2016 07:35 PM, Mike Miller wrote:
On Mon, Jun 06, 2016 at 11:19:36 -0700, Colin Macdonald wrote:
> 
> I updated my system to Fedora 24; when rebuilding Octave dev I get the
> following errors (any many more for other math.h functions).
> 
> Anyone recognize this?
Basically, Octave doesn't build with gcc 6 currently.

There have been some threads about this but I don't think any decisions
about what to fix or progress has been made yet.

My understanding is

 * Octave has for some time used gnulib to replace both system and math
   library functions, and has been designed under the assumption that
   `#include <cmath>` would make functions such as `gnulib::floor`
   available to C++ modules

 * Gcc 6 has been made more strict, such that `#include <cmath>`
   includes the *system* math.h rather than any other math.h that may
   appear in the include search path

 * Gnulib has support for C++ to the extent that they will wrap their
   C library replacement functions in a namespace of the user's
   choosing, but they do not (to my knowledge) provide replacements for
   any standard C++ headers or functions

This may end up leaving Octave in the position that we have to decide to
use only C library header files when expicitly using the gnulib
replacement functions, and not use gnulib functions at the same time as
we are using the C++ standard library.

I'm sure help on fixing this would be appreciated. Otherwise you might
want to keep a gcc 5 handy for building Octave.

Some starting points:

http://lists.gnu.org/archive/html/octave-maintainers/2016-02/msg00164.html
https://lists.fedoraproject.org/archives/list/devel@.../thread/74YWUCBM7KR2FCACH3WQNTX75WB76JSD
https://savannah.gnu.org/bugs/?47073

-- mike
Another useful thread:
http://octave.1599824.n4.nabble.com/Major-issues-with-g-6-and-gnulib-td4674928.html


Reply | Threaded
Open this post in threaded view
|

Re: build errors: "type of ‘std::copysign’ is unknown"

Michael Godfrey
In reply to this post by John W. Eaton


On 06/06/2016 08:03 PM, John W. Eaton wrote:
This is high on my list of things to work on, but I don't have a solution yet.  I'm still trying to decide what the best path forward is.

jwe


On 06/06/2016 02:35 PM, Mike Miller wrote:
On Mon, Jun 06, 2016 at 11:19:36 -0700, Colin Macdonald wrote:

I updated my system to Fedora 24; when rebuilding Octave dev I get the
following errors (any many more for other math.h functions).

Anyone recognize this?

Basically, Octave doesn't build with gcc 6 currently.

There have been some threads about this but I don't think any decisions
about what to fix or progress has been made yet.

My understanding is

  * Octave has for some time used gnulib to replace both system and math
    library functions, and has been designed under the assumption that
    `#include <cmath>` would make functions such as `gnulib::floor`
    available to C++ modules

  * Gcc 6 has been made more strict, such that `#include <cmath>`
    includes the *system* math.h rather than any other math.h that may
    appear in the include search path

  * Gnulib has support for C++ to the extent that they will wrap their
    C library replacement functions in a namespace of the user's
    choosing, but they do not (to my knowledge) provide replacements for
    any standard C++ headers or functions

This may end up leaving Octave in the position that we have to decide to
use only C library header files when expicitly using the gnulib
replacement functions, and not use gnulib functions at the same time as
we are using the C++ standard library.

I'm sure help on fixing this would be appreciated. Otherwise you might
want to keep a gcc 5 handy for building Octave.

Some starting points:

http://lists.gnu.org/archive/html/octave-maintainers/2016-02/msg00164.html
https://lists.fedoraproject.org/archives/list/devel@.../thread/74YWUCBM7KR2FCACH3WQNTX75WB76JSD
https://savannah.gnu.org/bugs/?47073


John,

Your patch octave-4.0.0-cxx11.patch applies for current dev system (ignoring HUNK #1 fails)
and causes build on FC24 to get a lot further. i.e. to:CXX      libinterp/corefcn/libinterp_corefcn_libcorefcn_la-mex.lo
So, will your suggestion of applying it to more #includes should do it.

Of course, if you have a better way...
Michael