Opened 15 years ago
Closed 15 years ago
#21077 closed defect (fixed)
issues compiling Octave
Reported by: | LenoreHorner | Owned by: | alakazam@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.8.0 |
Keywords: | Cc: | francois@…, faisal.moledina@… | |
Port: | octave |
Description (last modified by mf2k (Frank Schima))
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
Attachments (1)
Change History (8)
comment:1 Changed 15 years ago by alakazam@…
Description: | modified (diff) |
---|---|
Owner: | changed from macports-tickets@… to alakazam@… |
Status: | new → assigned |
comment:2 Changed 15 years ago by mf2k (Frank Schima)
Description: | modified (diff) |
---|---|
Port: | octave added |
comment:3 Changed 15 years ago by francois@…
Cc: | francois@… added |
---|
Changed 15 years ago by faisal.moledina@…
Attachment: | octave-build-debug.txt.gz added |
---|
debug build of octave on macports 1.8.0 on OS X 10.6.1 (fresh macports install on 10.6)
comment:7 Changed 15 years ago by alakazam@…
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I believe this now works correctly with octave 3.2.3.
Cc Me!