[MacPorts] #21077: issues compiling Octave

MacPorts noreply at macports.org
Fri Sep 4 05:14:35 PDT 2009


#21077: issues compiling Octave
----------------------------------------+-----------------------------------
 Reporter:  LenoreHorner@…              |       Owner:  alakazam@…           
     Type:  defect                      |      Status:  assigned             
 Priority:  Normal                      |   Milestone:                       
Component:  ports                       |     Version:  1.8.0                
 Keywords:                              |        Port:                       
----------------------------------------+-----------------------------------
Changes (by alakazam@…):

  * owner:  macports-tickets@… => alakazam@…
  * status:  new => assigned


Old description:

> I'm not sure whether this is the same as ticket 20636 or not.
>
> There are multiple reports of failures of Octave to compile.  Initial
> reports to the Octave list indicated without any details that people
> outside MacPorts were successfully compiling so the issue must be with
> the port rather than Octave per se.  However, since Snow Leopard came
> out, the Octave list has seen the same failure that at least some
> MacPorts users are seeing.
>
> The following is part of an exchange indicating a possible workaround
> (which I haven't had time to understand and try).  Hopefully it will
> help.
>

>
> |
> | | Thanks. WIth Mac OS 10.6, I now get as far as ...
> | |
> | | g++-4 -c -I/sw/include -I/sw/include/freetype2 -I/sw/lib/flex/include
> -
> | | I/sw/include   -fPIC -I. -I.. -I../liboctave -I../src -I../libcruft/
> | | misc  -DHAVE_CONFIG_H -mieee-fp -I/sw/include/freetype2 -I/sw/include
> -
> | | I/usr/X11/include   -Wall -W -Wshadow -Wold-style-cast -Wformat -g
> -O2
> | | -D_THREAD_SAFE  lo-specfun.cc -o pic/lo-specfun.o
> | | lo-specfun.cc: In function $,1rx(BComplex xlgamma(const
> Complex&)$,1ry(B:
> | | lo-specfun.cc:327: error: $,1rx(Blgamma_r$,1ry(B was not declared
> in this scope
> | | lo-specfun.cc: In function $,1rx(BFloatComplex xlgamma(const
> FloatComplex&)$,1ry(B:
> | | lo-specfun.cc:394: error: $,1rx(Blgammaf_r$,1ry(B was not
> declared in this scope
> | | make[2]: *** [pic/lo-specfun.o] Error 1
> | | make[1]: *** [liboctave] Error 2
> | | make: *** [all] Error 2
> |
> | Your system apparently has lgamma_r, but maybe something needs to be
> | defined for it to be declared?  On my system (Debian, using GNU libc)
> | it is declared in math.h (actually, in bits/mathcalls.h, which is
> | unconditionally included in math.h.  It's declaration apparently
> | requires __USE_MISC to be defined, but apparently it is by default.
> | Of course, the details on OS X may be completely different, but maybe
> | you could start by searching for declarations of lgamma in
> | /usr/include?
>
> Oh, I just found the page
>
> http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/lgamma_r.3.html
>
> Which says that you need to define _REENTRANT before including math.h
> in order for lgamma_r to be declared.  What happens if you make the
> following change?
>
> diff --git a/liboctave/lo-specfun.cc b/liboctave/lo-specfun.cc
> --- a/liboctave/lo-specfun.cc
> +++ b/liboctave/lo-specfun.cc
> @@ -25,6 +25,12 @@
> #include <config.h>
> #endif
>
> +#if !defined (_REENTRANT)
> +#define _REENTRANT
> +#endif
> +#include <cmath>
> +#undef _REENTRANT
> +
> #include "Range.h"
> #include "CColVector.h"
> #include "CMatrix.h"
>

> If we include this change in Octave, then maybe we should restrict it
> to OS X systems?  Ugh.  Is there a better way?
>

>
> I've run ./configure with you change, and make has now progressed past
> lo-specfun.o

New description:

 I'm not sure whether this is the same as ticket 20636 or not.

 There are multiple reports of failures of Octave to compile.  Initial
 reports to the Octave list indicated without any details that people
 outside MacPorts were successfully compiling so the issue must be with the
 port rather than Octave per se.  However, since Snow Leopard came out, the
 Octave list has seen the same failure that at least some MacPorts users
 are seeing.

 The following is part of an exchange indicating a possible workaround
 (which I haven't had time to understand and try).  Hopefully it will help.



 |
 | | Thanks. WIth Mac OS 10.6, I now get as far as ...
 | |
 | | g++-4 -c -I/sw/include -I/sw/include/freetype2 -I/sw/lib/flex/include
 -
 | | I/sw/include   -fPIC -I. -I.. -I../liboctave -I../src -I../libcruft/
 | | misc  -DHAVE_CONFIG_H -mieee-fp -I/sw/include/freetype2 -I/sw/include
 -
 | | I/usr/X11/include   -Wall -W -Wshadow -Wold-style-cast -Wformat -g -O2
 | | -D_THREAD_SAFE  lo-specfun.cc -o pic/lo-specfun.o
 | | lo-specfun.cc: In function $,1rx(BComplex xlgamma(const
 Complex&)$,1ry(B:
 | | lo-specfun.cc:327: error: $,1rx(Blgamma_r$,1ry(B was not declared in
 this scope
 | | lo-specfun.cc: In function $,1rx(BFloatComplex xlgamma(const
 FloatComplex&)$,1ry(B:
 | | lo-specfun.cc:394: error: $,1rx(Blgammaf_r$,1ry(B was not declared in
 this scope
 | | make[2]: *** [pic/lo-specfun.o] Error 1
 | | make[1]: *** [liboctave] Error 2
 | | make: *** [all] Error 2
 |
 | Your system apparently has lgamma_r, but maybe something needs to be
 | defined for it to be declared?  On my system (Debian, using GNU libc)
 | it is declared in math.h (actually, in bits/mathcalls.h, which is
 | unconditionally included in math.h.  It's declaration apparently
 | requires __USE_MISC to be defined, but apparently it is by default.
 | Of course, the details on OS X may be completely different, but maybe
 | you could start by searching for declarations of lgamma in
 | /usr/include?

 Oh, I just found the page

 http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/lgamma_r.3.html

 Which says that you need to define _REENTRANT before including math.h
 in order for lgamma_r to be declared.  What happens if you make the
 following change?

 diff --git a/liboctave/lo-specfun.cc b/liboctave/lo-specfun.cc
 --- a/liboctave/lo-specfun.cc
 +++ b/liboctave/lo-specfun.cc
 @@ -25,6 +25,12 @@
 #include <config.h>
 #endif

 +#if !defined (_REENTRANT)
 +#define _REENTRANT
 +#endif
 +#include <cmath>
 +#undef _REENTRANT
 +
 #include "Range.h"
 #include "CColVector.h"
 #include "CMatrix.h"


 If we include this change in Octave, then maybe we should restrict it
 to OS X systems?  Ugh.  Is there a better way?



 I've run ./configure with you change, and make has now progressed past lo-
 specfun.o

--

-- 
Ticket URL: <http://trac.macports.org/ticket/21077#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list