octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: attempt to build on Mac OS 10.6 (Snow Leopard)


From: Ben Abbott
Subject: Re: attempt to build on Mac OS 10.6 (Snow Leopard)
Date: Sun, 30 Aug 2009 23:58:12 -0400


On Aug 30, 2009, at 11:48 PM, John W. Eaton wrote:

On 30-Aug-2009, John W. Eaton wrote:

| On 30-Aug-2009, Ben Abbott wrote:
|
| | Thanks Joel. 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?

jwe

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

Thanks
Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]