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

 
 

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

Submitted by:  Michael B Allen <ioplex>
Submitted on:  Sat 12 Feb 2011 10:52:23 PM UTC  
 
Category: Configuration and Build SystemSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Build Failure
Status: InvalidAssigned to: None
Originator Name: Michael B AllenOpen/Closed: Closed
Release: 3.4.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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

I think the

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>
Project 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>
Project 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

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 29 Mar 2011 08:59:35 PM UTCrik5Open/ClosedOpen=>Closed
    Tue 29 Mar 2011 08:59:34 PM UTCrik5StatusNeed Info=>Invalid
    Wed 16 Feb 2011 06:28:34 PM UTCjweStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1