bugGNU Octave - Bugs: bug #32444, Range.cc build error: ‘floor’...

 
 

bug #32444: Range.cc build error: ‘floor’ is not a member of ‘gnulib’

Submitter:  Michael B Allen <ioplex>
Submitted:  Sat 12 Feb 2011 10:52:23 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Michael B Allen Open/Closed:  * Closed
Release:  * 3.4.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 04 Jan 2018 07:42:31 PM UTC, comment #7: 

For people finding this page while trying to
build octave 4.0.3 with gcc 6.4.0 for instance,
and experiencing

../../liboctave/array/Range.cc:502:8: error: 'floor' is not a member of 'gnulib'


here are two patches extracted from a debian patch
made by Mike Miller
https://anonscm.debian.org/gitweb/?p=pkg-octave/octave.git;a=commitdiff_plain;h=ed46a2ce08d585e6c635dc0a60cadf406a1c3bfc

just

patch -p1 < gcc-6-abs-overload.patch
patch -p1 < gcc-6-include-math-stdlib.patch


then all checks passed (except docs that were disabled)


(file #42834, file #42835)

ederag <ederag>
Wed 23 Feb 2011 09:28:08 PM UTC, comment #6: 

I think the


#include_next <math.h>


is your problem.  So it is GCC 4.3.x that had the "#include_next" problem, not 4.1.x.  This is a GCC bug, not a problem with Octave.  See the following bug report about it:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38000

The fix is to upgrade your GCC or apply the fix given in the GCC bug report.

So I think this bug report for Octave should be closed.

John W. Eaton <jwe>
Group administrator
Wed 23 Feb 2011 09:09:17 PM UTC, comment #5: 

Yes, I have a file libgnu/math.h:

$ ls -l libgnu/math.h
-rw-r--r-- 1 mc gher 36615 Feb 22 22:13 libgnu/math.h

The file '/usr/include/c++/cvos/shared/apps/gcc/4.3.2/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/../../../../include/c++/4.3.2/cmath ' does not exist, but I have the file '/cvos/shared/apps/gcc/4.3.2/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/../../../../include/c++/4.3.2/cmath'

In this file, math.h is included right at the beginning:
#pragma GCC system_header

#include <bits/c++config.h>
#include <bits/cpp_type_traits.h>
#include <ext/type_traits.h>
#include_next <math.h>

#ifndef _GLIBCXX_CMATH
#define _GLIBCXX_CMATH 1

I have also gcc 4.1.2 on my system which compiles Range.cc without problem. The corresponding Range.ii contains a line:

# 30 "../libgnu/math.h" 2 3
# 618 "../libgnu/math.h" 3
namespace gnulib { static double (*floor) (double x) = ::floor; } extern "C" int _gl_cxxalias_dummy;


This declaration is missing in Range.ii when I use gcc 4.3.2.

Alexander Barth <abarth>
Tue 22 Feb 2011 09:49:06 PM UTC, comment #4: 

In your Octave build tree, do you have a file libgnu/math.h?

On your system, how does the file

  /usr/include/c++/cvos/shared/apps/gcc/4.3.2/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/../../../../include/c++/4.3.2/cmath

include math.h?

John W. Eaton <jwe>
Group administrator
Tue 22 Feb 2011 09:37:23 PM UTC, comment #3: 

Range.ii is to big for an attachement.
You can get it here:
http://gher-diva.phys.ulg.ac.be/upload/Alex/Range.ii

Alexander Barth <abarth>
Tue 22 Feb 2011 09:34:21 PM UTC, comment #2: 

Hi all,
I have the same error with g++ 4.3.2:

 g++ -save-temps -DHAVE_CONFIG_H -I. -I.. -I/u/mc/opt/gcc-4.3.2/suitesparse-3.5.0/include -I/u/mc/opt/gcc-4.3.2/fftw-3.1.2/include -I/u/mc/opt/gcc-4.3.2/qhull-2003.1/include -I/u/mc/opt/gcc-4.3.2/hdf5-1.8.6/include -I/u/mc/opt/gcc-4.3.2/glpk-4.31/include -I/u/mc/opt/gcc-4.3.2/readline-6.0/include -I../libgnu -I../libgnu -I../libcruft/misc -I/u/mc/opt/gcc-4.3.2/suitesparse-3.5.0/include -I/u/mc/opt/gcc-4.3.2/fftw-3.1.2/include -I/u/mc/opt/gcc-4.3.2/qhull-2003.1/include -I/u/mc/opt/gcc-4.3.2/hdf5-1.8.6/include -I/u/mc/opt/gcc-4.3.2/glpk-4.31/include -I/u/mc/opt/gcc-4.3.2/readline-6.0/include -g -O2 -DHAVE_CONFIG_H -I/usr/include/freetype2 -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -g -O2 -MT liboctave_la-Range.lo -MD -MP -MF .deps/liboctave_la-Range.Tpo -c Range.cc  -fPIC -DPIC -o .libs/liboctave_la-Range.o
Range.cc: In function 'double tfloor(double, double)':
Range.cc:440: error: 'floor' is not a member of 'gnulib'
Range.cc:444: error: 'floor' is not a member of 'gnulib'

The distribution is Scientific Linux 5.5 which is compiled with g++ 4.1.2. Compiling octave 3.4.0 with g++ 4.1.2 gives me the error described here:https://savannah.gnu.org/bugs/?30685.

So in my case some libraries are compiled with g++ 4.1.2 and some others with g++ 4.3.2.

I attach Range.ii.

I hope this helps,

Thanks,
Alex



Alexander Barth <abarth>
Mon 14 Feb 2011 08:05:39 PM UTC, comment #1: 

Given what you show for the libgnu/math.h file, the macro


_GL_ _GL_CXXALIAS_SYS (floor, double, (double x));


should be expanded, and it should provide gnulib::floor.

Can you please add -save-temps to the command the libtool is executing to compile Range.cc and attach the resulting .ii file to this bug report?  That should show whether there is some other math.h file that is being included instead of libgnu/math.h.

What version of g++ do you have?

Maybe the problem is caused by the bug in GCC that was discussed in the following thread:

https://mailman.cae.wisc.edu/pipermail/help-octave/2010-October/043043.html

John W. Eaton <jwe>
Group administrator
Sat 12 Feb 2011 10:52:23 PM UTC, original submission:  

Trying to build Range.cc from the 3.4.0 tar.gz package (not  Mercurial sources) with gcc-c++-4.3.0-8.i386 on Fedora 9 results in the following error:

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..            -I../libgnu -I../libgnu -I../libcruft/misc  -g -O2  -DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread -g -O2 -MT liboctave_la-Range.lo -MD -MP -MF .deps/liboctave_la-Range.Tpo -c -o liboctave_la-Range.lo `test -f 'Range.cc' || echo './'`Range.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../libgnu -I../libgnu -I../libcruft/misc -g -O2 -DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread -g -O2 -MT liboctave_la-Range.lo -MD -MP -MF .deps/liboctave_la-Range.Tpo -c Range.cc  -fPIC -DPIC -o .libs/liboctave_la-Range.o
Range.cc: In function ‘double tfloor(double, double)’:
Range.cc:440: error: ‘floor’ is not a member of ‘gnulib’
Range.cc:444: error: ‘floor’ is not a member of ‘gnulib’
make[3]: * [liboctave_la-Range.lo] Error 1
make[3]: Leaving directory `/home/miallen/tmp/octave-3.4.0/liboctave'

My libgnu/math.h contains:

 610 #if 1
 611 # if 0
 612 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 613 #   define floor rpl_floor
 614 #  endif
 615 _GL_FUNCDECL_RPL (floor, double, (double x));
 616 _GL_CXXALIAS_RPL (floor, double, (double x));
 617 # else
 618 _GL_CXXALIAS_SYS (floor, double, (double x));
 619 # endif
 620 _GL_CXXALIASWARN (floor);
 621 #endif

Michael B Allen <ioplex>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #42834:  gcc-6-abs-overload.patch added by ederag (785B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ederag (Updated the item)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by abarth (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by ioplex (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-04 ederag Attached File- Added gcc-6-abs-overload.patch, #42834
        Attached File- Added gcc-6-include-math-stdlib.patch, #42835
    2011-03-29 rik5 Open/ClosedOpen Closed
    2011-03-29 rik5 StatusNeed Info Invalid / Not an Octave Bug
    2011-02-16 jwe StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code