Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#40806 closed defect (fixed)

octave-devel: error: 'CGDisplayBitsPerPixel' was not declared in this scope

Reported by: skymoo (Adam Mercer) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: mavericks Cc: jsalort (Julien Salort), jasonxh@…, macports@…, roberthuston@…, michaelbartz@…, lawrence.ong@…, lpsinger (Leo Singer), davydden@…, tenomoto (Takeshi Enomoto), marcs@…, skymoo (Adam Mercer), jendrek@…, lord@…, comtoisg@…, onurdomanic@…, iqgrande, shauriege@…, lukasz.m.dobrzanski@…
Port: octave-devel

Description (last modified by skymoo (Adam Mercer))

Looks like the #30737 also effects Mavericks as I'm getting the following:

:info:build libtool: compile:  /opt/local/bin/g++-mp-4.8 -DHAVE_CONFIG_H -I. -I.. -I../libgnu -I../libgnu -I../libcruft/misc -I../liboctave -I../liboctave -I. -I. -pipe -Os -m64 -DHAVE_CONFIG_H -I/opt/local/include -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -pipe -Os -m64 -D_THREAD_SAFE -pthread -pipe -Os -m64 -c dynamic-ld.cc  -fno-common -DPIC -o .libs/liboctinterp_la-dynamic-ld.o
:info:build display.cc: In member function 'void display_info::init(bool)':
:info:build display.cc:75:46: error: 'CGDisplayBitsPerPixel' was not declared in this scope
:info:build            dp = CGDisplayBitsPerPixel (display);
:info:build                                               ^

Using the same fix as #30737, i.e.:

platform darwin 13 {
    # In 10.9 patch is required as above, also
    # the LANG environment variable needs to
    # be set to "C" otherwise /usr/bin/sed
    # fails with an error, if you installed gsed
    # with default name this should have no effect.

    patchfiles-append patch-src-display.cc.diff
    build.args-append LANG="C"
}

allows the build to get a little further but then it fails with:

Undefined symbols for architecture x86_64:
  "Magick::CoderInfo::CoderInfo(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      F__magick_format_list__(octave_value_list const&, int) in DLD_FUNCTIONS___magick_read___la-__magick_read__.o
ld: symbol(s) not found for architecture x86_64

full build log is attached.

Attachments (6)

main.log.bz2 (54.7 KB) - added by skymoo (Adam Mercer) 11 years ago.
main.log (2.5 MB) - added by jendrek@… 11 years ago.
octave_install_fail.log (2.5 MB) - added by michaelbartz@… 11 years ago.
config.log (2.8 MB) - added by michaelbartz@… 11 years ago.
config.2.log (2.8 MB) - added by jendrek@… 11 years ago.
main.2.log (2.5 MB) - added by jendrek@… 11 years ago.

Change History (59)

Changed 11 years ago by skymoo (Adam Mercer)

Attachment: main.log.bz2 added

comment:1 Changed 11 years ago by skymoo (Adam Mercer)

Description: modified (diff)

comment:2 Changed 11 years ago by michaelld (Michael Dickens)

I don't have 10.9 to test on, so this might have to wait for a bit. In the meantime, does the following command:

nm -a /opt/local/lib/libGraphicsMagick++.dylib | grep CoderInfo

return something like "__ZN6Magick9CoderInfoC1ERKSs" or "__ZN6Magick9CoderInfoC2ERKSs" (without the "!" which the wiki requires to get the formatting correct) as one item?

comment:3 in reply to:  2 Changed 11 years ago by skymoo (Adam Mercer)

Replying to michaelld@…:

I don't have 10.9 to test on, so this might have to wait for a bit.

No rush.

In the meantime, does the following command:

nm -a /opt/local/lib/libGraphicsMagick++.dylib | grep CoderInfo

return something like "__ZN6Magick9CoderInfoC1ERKSs" or "__ZN6Magick9CoderInfoC2ERKSs" (without the "!" which the wiki requires to get the formatting correct) as one item?

Doesn't look like it:

[ram@cizin ~]$ nm -a /opt/local/lib/libGraphicsMagick++.dylib | grep CoderInfo
0000000000005abc T __ZN6Magick9CoderInfoC1EPKN9MagickLib11_MagickInfoE
0000000000005844 T __ZN6Magick9CoderInfoC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
00000000000057a2 T __ZN6Magick9CoderInfoC1ERKS0_
0000000000005722 T __ZN6Magick9CoderInfoC1Ev
0000000000005ac6 T __ZN6Magick9CoderInfoC2EPKN9MagickLib11_MagickInfoE
000000000000584e T __ZN6Magick9CoderInfoC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
00000000000057ac T __ZN6Magick9CoderInfoC2ERKS0_
0000000000005762 T __ZN6Magick9CoderInfoC2Ev
00000000000059de T __ZN6Magick9CoderInfoD1Ev
00000000000059e8 T __ZN6Magick9CoderInfoD2Ev
0000000000005a74 T __ZN6Magick9CoderInfoaSERKS0_
0000000000005a56 T __ZNK6Magick9CoderInfo10isReadableEv
0000000000005a60 T __ZNK6Magick9CoderInfo10isWritableEv
0000000000005a3a T __ZNK6Magick9CoderInfo11descriptionEv
0000000000005a6a T __ZNK6Magick9CoderInfo12isMultiFrameEv
0000000000005a22 T __ZNK6Magick9CoderInfo4nameEv
[ram@cizin ~]$

comment:4 Changed 11 years ago by michaelld (Michael Dickens)

The entry

__ZN6Magick9CoderInfoC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE

is what we're looking for, but it seems incorrect. It demangles to (for me, running 10.8):

Magick::CoderInfo::CoderInfo(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)

with the extra "__1::" (without the "!") compared with the error you got. So, either Octave or GraphicsMagick is messing with std::string. Looking at the code for GraphicsMagick++ (GraphicsMagick-1.3.18/Magick++/lib/CoderInfo.cpp:37) reads

Magick::CoderInfo::CoderInfo ( const std::string &name_ )

so, I'd guess that it is your install of GraphicsMagick that is the culprit here, not Octave.

One way to test this is to create a simple program which uses std::string, compile and link it, then do an "nm -a" on the resulting binary and see which mangled C++ expression comes up (using std::basic_string or std::__1::basic_string).

comment:5 in reply to:  4 Changed 11 years ago by skymoo (Adam Mercer)

Replying to michaelld@…:

One way to test this is to create a simple program which uses std::string, compile and link it, then do an "nm -a" on the resulting binary and see which mangled C++ expression comes up (using std::basic_string or std::__1::basic_string).

Do you have a simple code example, as I know next to nothing about C++?

comment:6 Changed 11 years ago by michaelld (Michael Dickens)

Sure; save the following as "test_std_string.cc":

#include <iostream>

void print (const std::string& str)
{ std::cout << str << std::endl; }

int main (void)
{ print ("foo"); return (1); }

then compile as:

clang++ -o test_std_string -pipe -g test_std_string.cc

and, if that succeeds,

c++filt `nm -a test_std_string | grep print | grep " T " | awk '{ print $NF }'`

should find, demangle, and print out the actual function. When I do the above, I get back:

print(std::string const&)

as expected.

comment:7 Changed 11 years ago by skymoo (Adam Mercer)

Something very different here:

[ram@cizin ~]$ cat test_std_string.cc
#include <iostream>

void print (const std::string& str)
{ std::cout << str << std::endl; }

int main (void)
{ print ("foo"); return (1); }
[ram@cizin ~]$ clang++ -o test_std_string -pipe -g test_std_string.cc
[ram@cizin ~]$ c++filt `nm -a test_std_string | grep print | grep " T " | awk '{ print $NF }'`
print(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ram@cizin ~]$

comment:8 Changed 11 years ago by michaelld (Michael Dickens)

That's strange, but I guess that's the way it is. So, the issue is probably with Octave after all. I'll push this bug report upstream and see what they say.

comment:9 Changed 11 years ago by skymoo (Adam Mercer)

Thanks, let me know if I can help with anything.

comment:10 in reply to:  8 Changed 11 years ago by bpabbott@…

I don't have a 10.9 box to test on, but we've applied a fix to display.cc related to the CGDisplayBitsPerPixel problem. The link to the patch is below.

http://hg.savannah.gnu.org/hgweb/octave/diff/0eb1b1eb2c76/src/display.cc

comment:11 Changed 11 years ago by jsalort (Julien Salort)

Cc: lists@… added

Cc Me!

comment:12 Changed 11 years ago by michaelld (Michael Dickens)

I've finally downloaded 10.9, but I'm busy through this weekend. Hopefully I'll find time next week to work on this ticket.

comment:13 in reply to:  12 ; Changed 11 years ago by AP1010

Replying to michaelld@…:

I've finally downloaded 10.9, but I'm busy through this weekend. Hopefully I'll find time next week to work on this ticket.

FWIW: I managed to successfully build octave-devel on Mavericks. After applying the "platform darwin 13" patch, I fixed the GraphicsMagick issue by building it with gcc48 (not default clang).

comment:14 Changed 11 years ago by jasonxh@…

Cc: jasonxh@… added

Cc Me!

comment:15 Changed 11 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:16 Changed 11 years ago by roberthuston@…

Cc: roberthuston@… added

Cc Me!

comment:17 in reply to:  13 ; Changed 11 years ago by roberthuston@…

Replying to arthur@…:

Replying to michaelld@…:

I've finally downloaded 10.9, but I'm busy through this weekend. Hopefully I'll find time next week to work on this ticket.

FWIW: I managed to successfully build octave-devel on Mavericks. After applying the "platform darwin 13" patch, I fixed the GraphicsMagick issue by building it with gcc48 (not default clang).

I applied the "platform darwin 13" patch also, but I still get the same error. I uninstalled and cleaned GraphicsMagick and then did a port select gcc to "mp-gcc48" before reinstalling GraphicsMagick. Do I have to do something different to build it with gcc48?

comment:18 in reply to:  17 Changed 11 years ago by roberthuston@…

Replying to roberthuston@…:

Replying to arthur@…:

Replying to michaelld@…:

I've finally downloaded 10.9, but I'm busy through this weekend. Hopefully I'll find time next week to work on this ticket.

FWIW: I managed to successfully build octave-devel on Mavericks. After applying the "platform darwin 13" patch, I fixed the GraphicsMagick issue by building it with gcc48 (not default clang).

I applied the "platform darwin 13" patch also, but I still get the same error. I uninstalled and cleaned GraphicsMagick and then did a port select gcc to "mp-gcc48" before reinstalling GraphicsMagick. Do I have to do something different to build it with gcc48?

Never mind, I got it to work. Used

  sudo port install GraphicsMagick configure.compiler=macports-gcc-4.8

and then re-ran

  sudo port install octave-devel +atlas +gcc48
Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:19 Changed 11 years ago by michaelld (Michael Dickens)

I'm running a 10.9 boot disk, currently downloaded xcode. I'll hopefully be able to verify all of the above in ~2 hours. Plenty of fixes for 10.9 needed in my ports :)

comment:20 Changed 11 years ago by michaelbartz@…

Cc: michaelbartz@… added

Cc Me!

comment:21 Changed 11 years ago by lawrence.ong@…

Cc: lawrence.ong@… added

Cc Me!

comment:22 Changed 11 years ago by lpsinger (Leo Singer)

Cc: aronnax@… added

Cc Me!

comment:23 Changed 11 years ago by davydden@…

Cc Me!

comment:24 in reply to:  23 Changed 11 years ago by larryv (Lawrence Velázquez)

Cc: davydden@… added

You have to click the “CcMe!” button next to the Cc list above to actually Cc yourself. I have done this.

comment:25 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: takeshi@… damian@… ralph@… iqgrande@… onurdomanic@… marcs@… ram@… jendrek@… lord@… comtoisg@… added
Summary: octave-devel:octave-devel: error: 'CGDisplayBitsPerPixel' was not declared in this scope

Has duplicates #40930, #41059, #41091.

comment:26 Changed 11 years ago by onurdomanic@…

Cc: onurdomanic@… removed

Cc Me!

comment:27 Changed 11 years ago by onurdomanic@…

Cc: onurdomanic@… added

Cc Me!

comment:28 Changed 11 years ago by iqgrande

Cc: iqgrande@… removed

Cc Me!

comment:29 Changed 11 years ago by iqgrande

Cc: iqgrande@… added

Cc Me!

comment:30 in reply to:  7 ; Changed 11 years ago by jendrek@…

Replying to ram@…:

Something very different here:

[ram@cizin ~]$ clang++ -o test_std_string -pipe -g test_std_string.cc
[ram@cizin ~]$ c++filt `nm -a test_std_string | grep print | grep " T " | awk '{ print $NF }'`
print(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ram@cizin ~]$

Same here...

comment:31 in reply to:  30 Changed 11 years ago by jendrek@…

Replying to jendrek@…:

Replying to ram@…:

Something very different here:

[ram@cizin ~]$ clang++ -o test_std_string -pipe -g test_std_string.cc
[ram@cizin ~]$ c++filt `nm -a test_std_string | grep print | grep " T " | awk '{ print $NF }'`
print(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
[ram@cizin ~]$

Same here...

Except that my ports are 2.2.1... not 2.2.0 as listed in this ticket... 2.2.1 installed from scratch...

comment:32 Changed 11 years ago by ralph@…

Cc: ralph@… removed

Cc Me!

comment:33 Changed 11 years ago by michaelld (Michael Dickens)

I'm up to getting atlas installed, which is taking just !@#$ forever; then metis, suitesparse, and maybe a few others which should be fast in comparison. I should be working on this ticket either later today or tomorrow.

comment:34 Changed 11 years ago by shauriege@…

Cc: shauriege@… added

Cc Me!

comment:35 Changed 11 years ago by lukasz.m.dobrzanski@…

Cc: lukasz.m.dobrzanski@… added

Cc Me!

comment:36 Changed 11 years ago by apple@…

Cc Me!

Last edited 11 years ago by apple@… (previous) (diff)

comment:37 Changed 11 years ago by michaelld (Michael Dickens)

For folks having this issue, I think the following should work:

sudo port -f uninstall GraphicsMagick
sudo port install GraphicsMagick configure.compiler=macports-gcc-4.8
sudo port clean octave-devel
sudo port install octave-devel +gcc48 configure.compiler=macports-gcc-4.8

I'm working on a clang/clang solution too.

comment:38 Changed 11 years ago by lord@…

Michael, I tried you suggestion and still getting the same as before build error:

:info:build display.cc:75:46: error: 'CGDisplayBitsPerPixel' was not declared in
 this scope

comment:39 in reply to:  38 Changed 11 years ago by shauriege@…

Replying to lord@…:

Michael, I tried you suggestion and still getting the same as before build error:

:info:build display.cc:75:46: error: 'CGDisplayBitsPerPixel' was not declared in
 this scope

Michael's fix works for me when I apply the Darwin 13 fix discussed in the ticket description above.

comment:40 Changed 11 years ago by michaelld (Michael Dickens)

Sorry; I needed to push my changed Portfile, which I just did in r112810. At least for me on 10.9, octave-devel now works with [GraphicsMagick/octave-devel] compiled with clang/clang or gcc/gcc; I have not tried combining. Meaning: putting configure.compiler=macports-gcc-4.8 after the port command. The +gcc48 is for Fortran only now in octave-devel. This change should be live by ~5:10 PM/US/ET, if not sooner. You'll need to do:

sudo port clean octave-devel
sudo port selfupdate
sudo port install octave-devel

or whatever your special sauce is, and hopefully octave-devel will work now on 10.9 (as well as continue to work on 10.8 or older). I'm leaving this ticket open until either I hear confirmation or a week has passed without a peep.

comment:41 in reply to:  40 Changed 11 years ago by roberthuston@…

Replying to michaelld@…:

Sorry; I needed to push my changed Portfile, which I just did in r112810. At least for me on 10.9, octave-devel now works with [GraphicsMagick/octave-devel] compiled with clang/clang or gcc/gcc; I have not tried combining. Meaning: putting configure.compiler=macports-gcc-4.8 after the port command. The +gcc48 is for Fortran only now in octave-devel. This change should be live by ~5:10 PM/US/ET, if not sooner. You'll need to do:

sudo port clean octave-devel
sudo port selfupdate
sudo port install octave-devel

or whatever your special sauce is, and hopefully octave-devel will work now on 10.9 (as well as continue to work on 10.8 or older). I'm leaving this ticket open until either I hear confirmation or a week has passed without a peep.

I still get failures in building octave-devel even after performing the above steps. I uninstalled (and cleaned) GraphicsMagick, and then all of my octave packages, and finally octave-revel itself. I then did a selfupdate, updated my outdated ports (there were a few) and then did a "sudo port install octave-devel +atlas +gcc48." I ended up rebuilding both GraphicsMagick and octave-devel with the "configure.compiler=macports-gcc4.8" option to get things to work again.

comment:42 Changed 11 years ago by damian@…

Cc: damian@… removed

Cc Me!

comment:43 in reply to:  40 Changed 11 years ago by jendrek@…

Replying to michaelld@…: Sorry; still problems... I am attaching the log.

Changed 11 years ago by jendrek@…

Attachment: main.log added

Changed 11 years ago by michaelbartz@…

Attachment: octave_install_fail.log added

comment:44 Changed 11 years ago by michaelld (Michael Dickens)

Same issue for both of you: clang is being picky about class instantiation when checking for existence. Can you also post the file "port work octave-devel/octave-3.6.4/config.log"? I thought my patch to configure takes care of this issue, but maybe not.

Changed 11 years ago by michaelbartz@…

Attachment: config.log added

comment:45 Changed 11 years ago by michaelld (Michael Dickens)

My bad. I forgot to add the patch to the patchfiles. Should now be fixed in r112833.

Changed 11 years ago by jendrek@…

Attachment: config.2.log added

comment:46 in reply to:  45 Changed 11 years ago by jendrek@…

Replying to michaelld@…:

My bad. I forgot to add the patch to the patchfiles. Should now be fixed in r112833.

Still fails... I selfupdated, cleaned, and re-run the build...

Am attaching the log.

Changed 11 years ago by jendrek@…

Attachment: main.2.log added

comment:47 Changed 11 years ago by michaelbartz@…

I did not get too far:

Error: Unable to open port: extra characters after close-quote
Error: Unable to execute port: upgrade qhull failed
Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:48 Changed 11 years ago by michaelld (Michael Dickens)

@michaelbartz: qhull uses CMake, and the CMake PortGroup has been in flux today. Hopefully it's stable again.

@jendrek: The log implies to me that the patch is not in place; not your fault; probably not enough time between when I posted and when you updated: I've been told it takes ~30 minutes for changes to be "live".

So, both of you, try this yet again -- we -will- get there sooner or later :)

sudo port clean octave-devel
sudo port selfupdate
sudo port install octave-devel

Sometimes 'port' just requires a few good cleans and retries to get working ...

comment:49 Changed 11 years ago by michaelbartz@…

I can confirm that octave-devel complies successfully now.

comment:50 in reply to:  48 Changed 11 years ago by jendrek@…

I can also compile now.

Thank you very much!

comment:51 Changed 11 years ago by lukasz.m.dobrzanski@…

x3 should be enough to mark as fixed (octave-devel complies successfully now). Thank you Michael.

comment:52 Changed 11 years ago by roberthuston@…

FWIW: I can build it now too. Thank you so very much for fixing this!

comment:53 Changed 11 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Excellent! Y'all are welcome! I'm closing this ticket as fixed.

Note: See TracTickets for help on using tickets.