Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#51399 closed defect (fixed)

octave-4.0.2_0 upgrade fails

Reported by: neilt (Neil Tiffin) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: lpn25, kpreid (Kevin Reid), skymoo (Adam Mercer), dershow, bryan.morrissey@…, AP1010, roberthuston@…, dimkab, miguelbarao, andrekw@…, dliessi (Davide Liessi)
Port: octave

Description (last modified by skymoo (Adam Mercer))

octave-4.0.2_0+app+atlas+docs+fltk+gcc5+java+qt4gui+sound.darwin_15.x86_64 failed to install.

:info:build In file included from /opt/local/include/gcc5/c++/cstdlib:72:0,
:info:build                  from /opt/local/include/gcc5/c++/bits/stl_algo.h:59,
:info:build                  from /opt/local/include/gcc5/c++/algorithm:62,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/qglobal.h:68,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/qnamespace.h:45,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/qobjectdefs.h:45,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/qobject.h:47,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/QObject:1,
:info:build                  from /opt/local/libexec/qt4/include/Qsci/qscilexeroctave.h:28,
:info:build                  from src/m-editor/file-editor-tab.cc:32:
:info:build ../libgnu/stdio.h:1039:1: error: conflicting declaration of 'char* gets(char*)' with 'C++' linkage
:info:build  _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
:info:build  ^
:info:build In file included from ../libgnu/stdio.h:43:0,
:info:build                  from ../libgnu/wchar.h:71,
:info:build                  from /opt/local/include/gcc5/c++/cwchar:44,
:info:build                  from /opt/local/include/gcc5/c++/bits/postypes.h:40,
:info:build                  from /opt/local/include/gcc5/c++/bits/char_traits.h:40,
:info:build                  from /opt/local/include/gcc5/c++/string:40,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/qstring.h:54,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/qobject.h:48,
:info:build                  from /opt/local/libexec/qt4/include/QtCore/QObject:1,
:info:build                  from /opt/local/libexec/qt4/include/Qsci/qscilexeroctave.h:28,
:info:build                  from src/m-editor/file-editor-tab.cc:32:
:info:build /usr/include/stdio.h:257:7: note: previous declaration with 'C' linkage
:info:build  char *gets(char *);

Attachments (1)

main.log (20.7 KB) - added by neilt (Neil Tiffin) 3 years ago.

Download all attachments as: .zip

Change History (24)

Changed 3 years ago by neilt (Neil Tiffin)

Attachment: main.log added

comment:1 Changed 3 years ago by neilt (Neil Tiffin)

MacPorts 2.3.4 OS X 10.11.4 (15E65)

comment:2 Changed 3 years ago by lpn25

Cc: lupincho25@… added

Cc Me!

comment:3 Changed 3 years ago by kpreid (Kevin Reid)

Cc: kpreid@… added

Cc Me!

comment:4 Changed 3 years ago by skymoo (Adam Mercer)

Cc: michaelld@… mcalhoun@… ram@… added
Description: modified (diff)
Keywords: octave removed

comment:5 Changed 3 years ago by dershow

Cc: dersh@… added

Cc Me!

comment:6 Changed 3 years ago by bryan.morrissey@…

Cc: bryan.morrissey@… added

Cc Me!

comment:7 Changed 3 years ago by AP1010

Cc: arthur@… added

Cc Me!

comment:8 Changed 3 years ago by AP1010

It looks like variants +gcc5 and +gcc6 fail to build, however variant +gfortran builds just fine.

comment:9 Changed 3 years ago by roberthuston@…

This looks to be an recurring issue with the gnulib files. There was a problem a couple of years ago with building octave 3.8.0 on Mountain Lion (http://octave.1599824.n4.nabble.com/Building-3-8-0-on-Mountain-Lion-10-8-5-td4660795.html). The solution was to disable 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

in the file libgnu/stdio.in.h of the MacPorts Octave build directory, which for this version is:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_octave/octave/work/octave-4.0.2

Once I made this local edit, I was able to resume my build and get Octave running.

I'm assuming that the Portfile might need to make a local patch to stdio.in.h as a permanent solution, but this should work for now.

comment:10 Changed 3 years ago by roberthuston@…

Cc: roberthuston@… added

Cc Me!

comment:11 Changed 3 years ago by dimkab

Cc: dima.batenkov@… added

Cc Me!

comment:12 Changed 3 years ago by miguelbarao

Cc: miguel.barao@… added

Cc Me!

comment:13 in reply to:  8 Changed 3 years ago by bryan.morrissey@…

Replying to arthur@…:

It looks like variants +gcc5 and +gcc6 fail to build, however variant +gfortran builds just fine.

I had the same result; I was able to build and run the +gfortran variant:

sudo port clean octave
sudo port install octave +gfortran -gcc5

Seems to work okay so far, I don't know what the long-term implications of this are.

comment:14 Changed 3 years ago by andrekw@…

Cc: andrekw@… added

Cc Me!

comment:15 Changed 3 years ago by michaelld (Michael Dickens)

Cc: michaelld@… removed

Cc Me!

comment:16 Changed 3 years ago by jsnuverink@…

Cc: jsnuverink@… added

Cc Me!

comment:17 Changed 3 years ago by gnw3

For me, after uuninstalling octave (built with +gcc5), "port install octave" worked on Mavericks and El Capitan, but fails on Snow Leopard (10.6.8 using the Apple C++ runtime):

:info:build   CXX      array/array_libarray_la-Array-idx-vec.lo
:info:build In file included from array/Array-idx-vec.cc:29:
:info:build In file included from ./array/idx-vector.h:29:
:info:build In file included from /usr/include/c++/4.2.1/cstring:52:
:info:build ../libgnu/string.h:723:84: error: no member named 'strndup' in the global namespace
:info:build namespace gnulib { static char * (*strndup) (char const *__string, size_t __n) = ::strndup; } extern "C" int _gl_cxxalias_dummy;
:info:build                                                                                  ~~^
:info:build 1 error generated.
:info:build make[3]: *** [array/array_libarray_la-Array-idx-vec.lo] Error 1

I assume this is Libcxx on older systems.

comment:18 Changed 3 years ago by dershow

For me as well, just deactivating and installing worked:

  sudo port deactivate octave
  sudo port clean octave
  sudo port install octave

So, I think that the old default variant now fails, but the new default works. So, just an upgrade fails, but a fresh install, uses +gfortran by default, so works.

comment:19 Changed 3 years ago by jsnuverink@…

Cc: jsnuverink@… removed

Cc Me!

comment:20 in reply to:  18 Changed 3 years ago by lpn25

Replying to dersh@…:

For me as well, just deactivating and installing worked:

  sudo port deactivate octave
  sudo port clean octave
  sudo port install octave

So, I think that the old default variant now fails, but the new default works. So, just an upgrade fails, but a fresh install, uses +gfortran by default, so works.

This worked for me too, although I am not sure if there are any implications of using only +fortran.

comment:21 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Owner: changed from macports-tickets@… to mcalhoun@…
Status: newassigned

comment:22 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… removed
Resolution: fixed
Status: assignedclosed

comment:23 Changed 3 years ago by dliessi (Davide Liessi)

Cc: davide.liessi@… added

Cc Me!

Note: See TracTickets for help on using tickets.