Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#45011 closed defect (fixed)

octave-3.8.1 build fails with Xcode 6

Reported by: AP1010 Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: yosemite, mavericks, Xcode 6 Cc: Schamschula (Marius Schamschula), tim.lahey@…, dhuffkc@…, waterson@…, Zippyzip, shaeffer@…, othiman@…, cielartisan@…, agraef (Albert Graef), askbal@…, iozkucuk@…, SickTeddyBear, roberthuston@…, sultanqasim@…, tkbrekken@…, olmec@…, egon.geerardyn@…, bhadder@…, MacPorts@…
Port: octave

Description

Build on Yosemite with Xcode 6.1 (beta 6A1030), fails with:

/bin/sh ../libtool  --tag=CXX   --mode=compile /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I..  -I./array -I./cruft/misc -Inumeric -I./numeric -Ioperators -I./operators -I./system -I./util -I../libgnu -I../libgnu          -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -pipe -Os -arch x86_64 -stdlib=libc++ -D_THREAD_SAFE -pthread -c -o array/array_libarray_la-int32NDArray.lo `test -f 'array/int32NDArray.cc' || echo './'`array/int32NDArray.cc
libtool: compile:  /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I.. -I./array -I./cruft/misc -Inumeric -I./numeric -Ioperators -I./operators -I./system -I./util -I../libgnu -I../libgnu -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -pipe -Os -arch x86_64 -stdlib=libc++ -D_THREAD_SAFE -pthread -c array/int32NDArray.cc  -fno-common -DPIC -o array/.libs/array_libarray_la-int32NDArray.o
In file included from array/int16NDArray.cc:28:
In file included from ./array/int16NDArray.h:26:
In file included from ./array/intNDArray.h:26:
In file included from ./array/MArray.h:28:
In file included from ./array/Array.h:32:
In file included from /Applications/Xcode-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:624:
/Applications/Xcode-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:1169:21: error: call to '__test' is ambiguous
   typedef decltype(__test(declval<_Tp>())) type;

I tried +gcc48 and +gcc49 variants. The result is the same.

Attachments (2)

main.log (528.9 KB) - added by AP1010 10 years ago.
octave.diff (534 bytes) - added by ryandesign (Ryan Carsten Schmidt) 10 years ago.

Download all attachments as: .zip

Change History (54)

Changed 10 years ago by AP1010

Attachment: main.log added

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: michaelld removed
Keywords: yosemite added
Owner: changed from macports-tickets@… to michaelld@…
Port: octave added

Note that the Cc field requires complete email addresses. And don't forget to fill in the Port field.

comment:2 Changed 10 years ago by Schamschula (Marius Schamschula)

This problem also happens on Mavericks computers with Xcode 6.0.1.

comment:3 Changed 10 years ago by Schamschula (Marius Schamschula)

Cc: mschamschula@… added

Cc Me!

comment:4 Changed 10 years ago by tim.lahey@…

Cc: tim.lahey@… added

Cc Me!

comment:5 Changed 10 years ago by dhuffkc@…

Cc: dhuffkc@… added

Cc Me! Mavericks with Xcode 6.0.1 (6A317).

Last edited 10 years ago by dhuffkc@… (previous) (diff)

comment:6 Changed 10 years ago by waterson@…

Cc: waterson@… added

Cc Me!

comment:7 Changed 10 years ago by Zippyzip

[Edit: removed because of redundancy]

Last edited 10 years ago by Zippyzip (previous) (diff)

comment:8 Changed 10 years ago by Zippyzip

Cc: cekoassa@… added

Cc Me! (Cc Me! (Mavericks/Xcode 6.0.1 (6A317) )

Last edited 10 years ago by Zippyzip (previous) (diff)

comment:9 Changed 10 years ago by michaelld (Michael Dickens)

Keywords: mavericks Xcode 6 added
Summary: octave-3.8.1 - build fails on Yosemiteoctave-3.8.1 build fails with Xcode 6

I'm switching the name to better reflect the issue: octave 3.8 isn't happy with Xcode 6. I'll get there soon ...

comment:10 Changed 10 years ago by michaelld (Michael Dickens)

Has duplicate #45111.

comment:11 Changed 10 years ago by shaeffer@…

Cc: shaeffer@… added

Cc Me!

comment:12 Changed 10 years ago by othiman@…

Cc: othiman@… added

Cc Me!

comment:13 Changed 10 years ago by jordigh@…

I have an inkling of what's going wrong. LLVM 3.5 is attempting to resolve our pow(octave_int, octave_int) function overload by considering its own templated std::pow()... but I think this is wrong. It should attempt first our exact function overload, and disregard the templated one if there's an error during template argument substitution. This might be a SFINAE bug, but I don't have Apple hardware for testing. I can think of some workarounds, and if it really is a LLVM bug, I would like to report it on their tracker too.

Do we have someone comfortable with C++ and building Octave on Mac OS X who can help us? The Octave developers are very short on Mac OS X resources.

comment:14 Changed 10 years ago by Schamschula (Marius Schamschula)

Not too surprisingly, today's update to octave version 3.8.2 also fails to build.

Last edited 10 years ago by Schamschula (Marius Schamschula) (previous) (diff)

comment:15 Changed 10 years ago by jordigh@…

With the help of Agustín Bergé and others in IRC, we have reduced the problem to the test case in the following bug report:

http://llvm.org/bugs/show_bug.cgi?id=21083

Can we wait to see if the LLVM devs can release a bugfix quickly and only implement a workaround in Octave if they take more than a couple of weeks?

Last edited 10 years ago by jordigh@… (previous) (diff)

comment:16 Changed 10 years ago by Schamschula (Marius Schamschula)

Update:

Reviewing the main.log file I've found that MacPorts was not passing my desired compiler (i.e. +gcc48 - macports-gcc-4.8) on to octave, hence the build was using Apple clang! - with the same results as llvm3.5.

I see that the Portfile defines default_variants-append +gcc48 , but there is no corresponding variant. Am I missing something here? Is the +gcc48 variant defined by MacPorts?

I just built octave 3.8.2 using (in my case mp-gcc48 is selected):

sudo port install octave +atlas configure.compiler=macports-gcc

comment:17 in reply to:  15 ; Changed 10 years ago by shaeffer@…

Replying to jordigh@…:

With the help of Agustín Bergé and others in IRC, we have reduced the problem to the test case in the following bug report:

http://llvm.org/bugs/show_bug.cgi?id=21083

Can we wait to see if the LLVM devs can release a bugfix quickly and only implement a workaround in Octave if they take more than a couple of weeks?

You would need to file a bug directly with Apple for Xcode. The llvm within Xcode is a snapshot of the llvm code base and thus differs from the public llvm code base.

comment:18 Changed 10 years ago by cielartisan@…

Cc: cielartisan@… added

Cc Me!

comment:19 in reply to:  16 ; Changed 10 years ago by cielartisan@…

Replying to mschamschula@…:

sudo port install octave +atlas configure.compiler=macports-gcc

Sadly it does not work here. It seems octave tries to link GraphicsMagick++, which is compiled using libc++.

comment:20 in reply to:  19 Changed 10 years ago by Schamschula (Marius Schamschula)

Replying to cielartisan@…:

Replying to mschamschula@…:

sudo port install octave +atlas configure.compiler=macports-gcc

Sadly it does not work here. It seems octave tries to link GraphicsMagick++, which is compiled using libc++.

Correct. I had to rebuild GraphicsMagick with configure.compiler=macports-gcc.

I have since rebuilt octave with sudo port install octave +atlas +x11 configure.compiler=macports-gcc as I had forgotten to include X11.

comment:21 Changed 10 years ago by agraef (Albert Graef)

Cc: aggraef@… added

Cc Me!

comment:22 Changed 10 years ago by agraef (Albert Graef)

Upgrades are broken because of this, so when will this be fixed? If there's no immediate fix, can this port be downgraded to a version that's already in the binary package repositories?

I'm asking because I have a university course soon where students are supposed to install this package from MacPorts. It wouldn't be nice if their first experience with MacPorts was that it's broken. ;-)

comment:23 in reply to:  22 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to aggraef@…:

Upgrades are broken because of this, so when will this be fixed?

When someone knows how to! :)

It sounds like the problem is with llvm-3.5. Therefore, the port could use the compiler_blacklist_versions portgroup to blacklist clang compilers based on llvm-3.5.

If there's no immediate fix, can this port be downgraded to a version that's already in the binary package repositories?

That's not what we usually do. In any case, there are no binaries of octave because:

$ ~/macports/base/portmgr/jobs/port_binary_distributable.tcl -v octave
"octave" is not distributable because its license "gpl" conflicts with license "APSL-2" of dependency "ld64"

Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: octave.diff added

comment:24 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

To those on Mavericks with Xcode 6, please try the patch I just attached. It doesn't work for me, but that may be because I'm using Xcode 6.1 beta and/or Yosemite beta.

comment:25 in reply to:  24 ; Changed 10 years ago by askbal@…

Replying to ryandesign@…:

To those on Mavericks with Xcode 6, please try the patch I just attached. It doesn't work for me, but that may be because I'm using Xcode 6.1 beta and/or Yosemite beta.

I have Xcode 6.0.1 and on OS X 10.9.4. I tried your patch and octave 3.8.2 does compile successfully and shows up in port installed as octave3.8.2_0+atlas+gcc48. However, whenever I quit/exit octave it exits with the following message. Not sure yet if this is impacting the program during runtime.

Could it be because of some compiler mixing as I installed Xcode 6 recently? Should I fetch and reinstall all the ports again and try again?

octave:9> exit
libc++abi.dylib: terminating with uncaught exception of type octave_interrupt_exception
panic: Abort trap: 6 -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Abort trap: 6

comment:26 Changed 10 years ago by askbal@…

Cc: askbal@… added

Cc Me!

comment:27 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: iozkucuk@… added

Has duplicate #45176.

comment:28 in reply to:  25 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to askbal@…:

Replying to ryandesign@…:

To those on Mavericks with Xcode 6, please try the patch I just attached. It doesn't work for me, but that may be because I'm using Xcode 6.1 beta and/or Yosemite beta.

I have Xcode 6.0.1 and on OS X 10.9.4. I tried your patch and octave 3.8.2 does compile successfully and shows up in port installed as octave3.8.2_0+atlas+gcc48.

Great, then let's go with that for now. Committed my patch in r125832.

However, whenever I quit/exit octave it exits with the following message. Not sure yet if this is impacting the program during runtime.

Could it be because of some compiler mixing as I installed Xcode 6 recently?

I don't use octave and I don't know why that's happening.

Should I fetch and reinstall all the ports again and try again?

I doubt that would help.

comment:29 Changed 10 years ago by agraef (Albert Graef)

Tried it as well (using clang++ 3.4), compiled and installed without any hitches, works fine so far. Thanks, Ryan!

comment:30 in reply to:  29 Changed 10 years ago by AP1010

Replying to aggraef@…:

Tried it as well (using clang++ 3.4), compiled and installed without any hitches, works fine so far. Thanks, Ryan!

I have managed to successfully build & install:
octave +atlas +gcc48 on Mavericks with Xcode 6.0.1 and
octave +atlas +gcc49 on Yosemite with Xcode 6.1 (6A1030)

Thanks!!!

comment:31 Changed 10 years ago by Schamschula (Marius Schamschula)

Also worked for me (Mavericks, Xcode 6.0.1). Just had to re-install the non-gcc48 port of GraphicsMagick.

Last edited 10 years ago by Schamschula (Marius Schamschula) (previous) (diff)

comment:32 in reply to:  24 Changed 10 years ago by mike@…

Replying to ryandesign@…:

To those on Mavericks with Xcode 6, please try the patch I just attached. It doesn't work for me, but that may be because I'm using Xcode 6.1 beta and/or Yosemite beta.

First of all, sorry for not being able to figure this out on my own, but can you point me in the right direction of how/where to apply the patch? I'm brand new to applying patches with macports, and having difficulty making the connection between the examples I've found online and actually applying this patch. Thanks in advance.

comment:33 Changed 10 years ago by SickTeddyBear

Cc: amcgee@… added

Cc Me!

comment:34 Changed 10 years ago by michaelld (Michael Dickens)

@mike@…: Ryan's patch is now included in what MacPorts provides; you just have to update the ports info. We generally recommend you do this by updating "port" itself, via:

sudo port selfupdate

If you know that "port" has recently been updated, you can just synchronize the ports info:

sudo port sync

To answer your specific question: (1) download the patch from this ticket, by clicking on the (hopefully obvious) download icon next to the filename, or the text "Original Format" if you are viewing the actual item itself. Let's say you do a standard download of the file "octave.diff" into ~/Downloads/. (2) in this case, the patch is for a Portfile itself, which is contained the ports tree that MacPorts uses. You get to Octave's location via

cd `port dir octave`

and if you do a directory listing there (for example: "ls -l") you'll see a file "Portfile". To do the patch (assuming it is not already in place), you'll issue:

sudo patch -p0 < ~/Downloads/octave.diff

assuming all is well, then "patch" will tell you the file was patched. Please remember that if you do this type of patching, port a "sync" or "selfupdate' will generally result in a conflict for the port in issue that you'll need to resolve -- when port is being updated, it provides a means for you to select which version to use or to delay decisions.

I hope the above answers your questions. If not, please email me off ticket.

comment:35 Changed 10 years ago by mike@…

Success! Thanks everyone.

comment:36 Changed 10 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

comment:37 in reply to:  17 ; Changed 10 years ago by jordigh@…

Replying to shaeffer@…:

Replying to jordigh@…:

With the help of Agustín Bergé and others in IRC, we have reduced the problem to the test case in the following bug report:

http://llvm.org/bugs/show_bug.cgi?id=21083

Can we wait to see if the LLVM devs can release a bugfix quickly and only implement a workaround in Octave if they take more than a couple of weeks?

You would need to file a bug directly with Apple for Xcode. The llvm within Xcode is a snapshot of the llvm code base and thus differs from the public llvm code base.

Can you please do that? I am not an Apple customer or user.

comment:38 in reply to:  37 Changed 10 years ago by shaeffer@…

Replying to jordigh@…:

Replying to shaeffer@…:

Replying to jordigh@…:

With the help of Agustín Bergé and others in IRC, we have reduced the problem to the test case in the following bug report:

http://llvm.org/bugs/show_bug.cgi?id=21083

Can we wait to see if the LLVM devs can release a bugfix quickly and only implement a workaround in Octave if they take more than a couple of weeks?

You would need to file a bug directly with Apple for Xcode. The llvm within Xcode is a snapshot of the llvm code base and thus differs from the public llvm code base.

Can you please do that? I am not an Apple customer or user.

I did follow up and file bug 18542254 at https://bugreport.apple.com/ And in the bug report I referenced this bug and ​http://llvm.org/bugs/show_bug.cgi?id=21083.

comment:39 Changed 10 years ago by ole.kjormo@…

Hi! Thanks for bringing up a solution for this, it has been bugging me for weeks! However, I've not been able to get the patch to work yet.

After downloading the octave.diff file from the top and putting into my Downloads folder, I run this:

"sudo patch -p0 < ~/Downloads/octave.diff"

I get this:

patch unexpectedly ends in middle of line patch: Only garbage was found in the patch input.

Any ideas ? Thanks and greetings from norway

comment:40 Changed 10 years ago by roberthuston@…

Cc: roberthuston@… added

Cc Me!

comment:41 Changed 10 years ago by roberthuston@…

@ole.kjormo@…: The patch is already in the current octave Portfile (r125857) and it appears that octave 3.8.2 now pulls and builds correctly, at least from a fresh MacPorts install.

However, I can confirm that the "libc++abi.dylib: terminating with uncaught exception of type octave_interrupt_exception" crash at program exit still occurs running on Mac OS X 10.10 (Yosemite) using Xcode 6.1 and its associated command-line tools. After upgrading to Yosemite, I did a complete MacPorts reinstall, and installing octave was the first major port I selected. After installing "octave +gui" (which produced "octave @3.8.2_1+atlas+gcc48+gui"), the libc++abi.dylib crash still occurs when I exit octave.

From other threads and discussions out there, it seems to be related to the llvm build, which is confusing to me because octave is supposed to default to using gcc48. Does anybody have any insight as to whether rebuilding octave (and its dependencies) specifically using "configure.compiler=macports-gcc-4.8" might solve the problem?

Update: Another thing that may shed some light on the matter is that, while my octave 3.8.2 installation indeed claims to have used the "+gcc48" variant, when cctools, ld64, and atlas were all built as dependencies, they were built with the "+llvm35" variant for cctools and ld64, and the "+clang" variant for atlas. While cctools and ld64 only build with llvm or universal variants, atlas does still support a "+gcc48" variant. But somehow that didn't get passed down from the octave installer. Wondering if this makes a difference?

Last edited 10 years ago by roberthuston@… (previous) (diff)

comment:42 Changed 10 years ago by sultanqasim@…

Cc: sultanqasim@… added

Cc Me!

comment:43 Changed 10 years ago by sultanqasim@…

I am having the same issue that roberthuston is experiencing. I am also running Yosemite with XCode 6.1.

comment:44 Changed 10 years ago by tkbrekken@…

Cc: tkbrekken@… added

Cc Me!

Yosemite and Xcode 6.1. Octave crashes when I multiply matrices of improper dimension or exit.

libc++abi.dylib: terminating with uncaught exception of type octave_interrupt_exception panic: Abort trap: 6 -- stopping myself... attempting to save variables to 'octave-workspace'... save to 'octave-workspace' complete zsh: abort octave

Last edited 10 years ago by tkbrekken@… (previous) (diff)

comment:45 Changed 10 years ago by olmec@…

Cc: olmec@… added

Cc Me!

comment:46 Changed 10 years ago by olmec@…

comment:47 Changed 10 years ago by egon.geerardyn@…

Cc: egon.geerardyn@… added

Cc Me!

comment:48 Changed 10 years ago by bhadder@…

Cc: bhadder@… added

Cc Me!

comment:49 Changed 10 years ago by rahul.is.also@…

Faced same issue on OS X Yosemite, CommandLineTools version 2339, and MacPorts base version 2.3.3. Solved it by using:

port select --list gcc
sudo port select --set gcc mp-gcc49
sudo port install octave +gui configure.compiler=macports-gcc

comment:50 in reply to:  49 Changed 10 years ago by olmec@…

Hi folk,

Thanks for your solution, I tried it and it failed.

The error is

libtool: link: /opt/local/bin/g++  -o dldfcn/.libs/colamd.so -bundle  dldfcn/.libs/dldfcn_colamd_la-colamd.o   ./.libs/liboctinterp.dylib -L/opt/local/lib -L/opt/local/lib/gcc49/gcc/x86_64-apple-darwin14/4.9.2 -L/opt/local/lib/gcc49/gcc/x86_64-apple-darwin14/4.9.2/../../.. ../liboctave/.libs/liboctave.dylib -lcholmod -lumfpack -lSuiteSparse -lamd -lcamd -lcolamd -lccolamd -lcxsparse -lm  -Os -m64 -pthread -Wl,-dylib_file -Wl,/opt/local/lib/octave/3.8.2/liboctave.2.dylib:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_octave/octave/work/octave-3.8.2/liboctave/.libs/liboctave.dylib   -pthread
Undefined symbols for architecture x86_64:
  "Magick::Image::ping(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      F__magick_ping__(octave_value_list const&, int) in dldfcn___magick_read___la-__magick_read__.o
  "Magick::Image::attribute(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)", referenced from:
      is_indexed(Magick::Image const&)  in dldfcn___magick_read___la-__magick_read__.o
      fill_exif(octave_scalar_map&, Magick::Image&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in dldfcn___magick_read___la-__magick_read__.o
      fill_exif_ints(octave_scalar_map&, Magick::Image&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in dldfcn___magick_read___la-__magick_read__.o
      fill_exif_floats(octave_scalar_map&, Magick::Image&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in dldfcn___magick_read___la-__magick_read__.o
      F__magick_finfo__(octave_value_list const&, int) in dldfcn___magick_read___la-__magick_read__.o
      octave_value_list read_images<boolNDArray>(std::vector<Magick::Image, std::allocator<Magick::Image> >&, Array<int> const&, int const&, octave_scalar_map const&) in dldfcn___magick_read___la-__magick_read__.o
      octave_value_list read_images<intNDArray<octave_int<unsigned char> > >(std::vector<Magick::Image, std::allocator<Magick::Image> >&, Array<int> const&, int const&, octave_scalar_map const&) in dldfcn___magick_read___la-__magick_read__.o
      ...
  "Magick::CoderInfo::CoderInfo(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      F__magick_formats__(octave_value_list const&, int) in dldfcn___magick_read___la-__magick_read__.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Any suggestions?

comment:51 Changed 10 years ago by MacPorts@…

Cc: MacPorts@… added

Cc Me!

comment:52 Changed 10 years ago by michaelld (Michael Dickens)

For folks experiencing the "libc++abi.dylib: terminating with uncaught exception" issue on exit, please add yourself to ticket #45210.

For folks with other issue, please search for your issue here; if you cannot find it, please open a new ticket with as much relevant info as you can provide.

Note: See TracTickets for help on using tickets.