Building 3.8.0 on Mountain Lion 10.8.5

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Building 3.8.0 on Mountain Lion 10.8.5

watsodw
Hi all,

I have tried to compile Octave 3.8.0 on Mac Mountain Lion 10.8.5 but have run into the following problem: I have Macports installed in /opt/macports and all dependencies for Octave are installed there. I am also using Macports gcc-4.7.3 to compile. It goes fine until some thing tries to reference stdio.h from /usr/include instead from /opt/macports. I tried removing /usr from my path but there are system utils there that are needed. Also using Xcode 5.0.2. The relevant compile output is the following:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/opt/macports/include -I/opt/macports/include/QtGui -I/opt/macports/include -I/opt/macports/include/QtNetwork -I/opt/macports/include -I/opt/macports/include/QtCore -I./qterminal/libqterminal -Isrc -I./src -I./src/m-editor -I./src/qtinfo -I../liboctave/cruft/misc -I../liboctave/array -I../liboctave/numeric -I../liboctave/numeric -I../liboctave/operators -I../liboctave/operators -I../liboctave/system -I../liboctave/util -I../libinterp -I../libinterp -I../libinterp/parse-tree -I../libinterp/parse-tree -I../libinterp/corefcn -I../libinterp/corefcn -I../libinterp/octave-value -I../libgnu -I../libgnu -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -D_THREAD_SAFE -pthread -MT src/m-editor/src_libgui_src_la-file-editor-tab.lo -MD -MP -MF src/m-editor/.deps/src_libgui_src_la-file-editor-tab.Tpo -c src/m-editor/file-editor-tab.cc  -fno-common -DPIC -o src/m-editor/.libs/src_libgui_src_la-file-editor-tab.o
In file included from ../libgnu/stdio.h:43:0,
                 from ../libgnu/wchar.h:71,
                 from /opt/macports/include/gcc47/c++/cwchar:46,
                 from /opt/macports/include/gcc47/c++/bits/postypes.h:42,
                 from /opt/macports/include/gcc47/c++/bits/char_traits.h:42,
                 from /opt/macports/include/gcc47/c++/string:42,
                 from /opt/macports/include/QtCore/qstring.h:54,
                 from /opt/macports/include/QtCore/qobject.h:48,
                 from /opt/macports/include/Qsci/qscilexeroctave.h:33,
                 from src/m-editor/file-editor-tab.cc:31:
/usr/include/stdio.h:265:7: error: previous declaration of 'char* gets(char*)' with 'C' linkage
In file included from ../libgnu/wchar.h:71:0,
                 from /opt/macports/include/gcc47/c++/cwchar:46,
                 from /opt/macports/include/gcc47/c++/bits/postypes.h:42,
                 from /opt/macports/include/gcc47/c++/bits/char_traits.h:42,
                 from /opt/macports/include/gcc47/c++/string:42,
                 from /opt/macports/include/QtCore/qstring.h:54,
                 from /opt/macports/include/QtCore/qobject.h:48,
                 from /opt/macports/include/Qsci/qscilexeroctave.h:33,
                 from src/m-editor/file-editor-tab.cc:31:
../libgnu/stdio.h:1034:1: error: conflicts with new declaration with 'C++' linkage
make[3]: *** [src/m-editor/src_libgui_src_la-file-editor-tab.lo] Error 1


Anyone know how to fix this?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Building 3.8.0 on Mountain Lion 10.8.5

John W. Eaton
Administrator
On 01/08/2014 09:17 AM, watsodw wrote:

> Hi all,
>
> I have tried to compile Octave 3.8.0 on Mac Mountain Lion 10.8.5 but have
> run into the following problem: I have Macports installed in /opt/macports
> and all dependencies for Octave are installed there. I am also using
> Macports gcc-4.7.3 to compile. It goes fine until some thing tries to
> reference stdio.h from /usr/include instead from /opt/macports. I tried
> removing /usr from my path but there are system utils there that are needed.
> Also using Xcode 5.0.2. The relevant compile output is the following:
>
> libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/opt/macports/include
> -I/opt/macports/include/QtGui -I/opt/macports/include
> -I/opt/macports/include/QtNetwork -I/opt/macports/include
> -I/opt/macports/include/QtCore -I./qterminal/libqterminal -Isrc -I./src
> -I./src/m-editor -I./src/qtinfo -I../liboctave/cruft/misc
> -I../liboctave/array -I../liboctave/numeric -I../liboctave/numeric
> -I../liboctave/operators -I../liboctave/operators -I../liboctave/system
> -I../liboctave/util -I../libinterp -I../libinterp -I../libinterp/parse-tree
> -I../libinterp/parse-tree -I../libinterp/corefcn -I../libinterp/corefcn
> -I../libinterp/octave-value -I../libgnu -I../libgnu -Wall -W -Wshadow
> -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align
> -Wcast-qual -g -O2 -D_THREAD_SAFE -pthread -MT
> src/m-editor/src_libgui_src_la-file-editor-tab.lo -MD -MP -MF
> src/m-editor/.deps/src_libgui_src_la-file-editor-tab.Tpo -c
> src/m-editor/file-editor-tab.cc  -fno-common -DPIC -o
> src/m-editor/.libs/src_libgui_src_la-file-editor-tab.o
> In file included from ../libgnu/stdio.h:43:0,
>                   from ../libgnu/wchar.h:71,
>                   from /opt/macports/include/gcc47/c++/cwchar:46,
>                   from /opt/macports/include/gcc47/c++/bits/postypes.h:42,
>                   from /opt/macports/include/gcc47/c++/bits/char_traits.h:42,
>                   from /opt/macports/include/gcc47/c++/string:42,
>                   from /opt/macports/include/QtCore/qstring.h:54,
>                   from /opt/macports/include/QtCore/qobject.h:48,
>                   from /opt/macports/include/Qsci/qscilexeroctave.h:33,
>                   from src/m-editor/file-editor-tab.cc:31:
> /usr/include/stdio.h:265:7: error: previous declaration of 'char*
> gets(char*)' with 'C' linkage
> In file included from ../libgnu/wchar.h:71:0,
>                   from /opt/macports/include/gcc47/c++/cwchar:46,
>                   from /opt/macports/include/gcc47/c++/bits/postypes.h:42,
>                   from /opt/macports/include/gcc47/c++/bits/char_traits.h:42,
>                   from /opt/macports/include/gcc47/c++/string:42,
>                   from /opt/macports/include/QtCore/qstring.h:54,
>                   from /opt/macports/include/QtCore/qobject.h:48,
>                   from /opt/macports/include/Qsci/qscilexeroctave.h:33,
>                   from src/m-editor/file-editor-tab.cc:31:
> ../libgnu/stdio.h:1034:1: error: conflicts with new declaration with 'C++'
> linkage
> make[3]: *** [src/m-editor/src_libgui_src_la-file-editor-tab.lo] Error 1
>
>
> Anyone know how to fix this?

The gnulib header is supposed to include the system stdio.h, so you
don't want to disable that.

This looks like a bug in gnulib.  I think the quick fix is to
eliminate the lines

   /* It is very rare that the developer ever has full control of stdin,
      so any use of gets warrants an unconditional warning; besides, C11
      removed it.  */
   #undef gets
   #if HAVE_RAW_DECL_GETS
   _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
   #endif

from the file libgnu/stdio.in.h.

Octave should not be using gets and this code is present just to warn
anyway.

jwe

--
Follow me on twitter: @theoctaveguy
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Building 3.8.0 on Mountain Lion 10.8.5

watsodw
In reply to this post by watsodw
Thanks, that worked. However, the gui crashes with the simple plot commands:

x = -10:0.1:10;
plot (x, sin (x));

It works with the cli.
Reply | Threaded
Open this post in threaded view
|

Re: Building 3.8.0 on Mountain Lion 10.8.5

bpabbott
Administrator
On Jan 9, 2014, at 8:38 AM, watsodw <[hidden email]> wrote:

> Thanks, that worked. However, the gui crashes with the simple plot commands:
>
> x = -10:0.1:10;
> plot (x, sin (x));
>
> It works with the cli.

The "fltk" toolkit will crash on MacOS X when running the GUI.  Are you able to plot if ....

        graphics_toolkit gnuplot
        setenv GNUTERM aqua
        close all
        plot (rand (3))

Ben

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Building 3.8.0 on Mountain Lion 10.8.5

watsodw
Yes, that worked. I like aquaterm better anyway.
Reply | Threaded
Open this post in threaded view
|

Re: Building 3.8.0 on Mountain Lion 10.8.5

bpabbott
Administrator
On Jan 9, 2014, at 9:08 AM, watsodw <[hidden email]> wrote:

> Yes, that worked. I like aquaterm better anyway.
>

If you built your gnuplot with qt support ("port install gnuplot" returns "gnuplot @4.6.4_1+aquaterm+luaterm+pangocairo+qt+wxwidgets+x11" for me), you may prefer the Qt terminal.

        graphics_toolkit gnuplot
        setenv GNUTERM qt
        close all
        plot (rand (3))

Ben

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Building 3.8.0 on Mountain Lion 10.8.5

watsodw
I just tried the qt plot engine, and I do like it. Thanks!