Opened 10 years ago

Closed 9 years ago

#30737 closed defect (fixed)

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

Reported by: liamg@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.0.1
Keywords: lion Cc: bpabbott@…, derekathomas@…, onurdomanic@…, mechgyver@…
Port: octave-devel

Description (last modified by ryandesign (Ryan Schmidt))

I tried installing octave-devel on an OSX 10.7 machine both before and after the Portfile mods of 8/12/2011. It failed with the same error both times:

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

The log file is over 10 MB long so I just attached the last partl I wasn't sure how much to include so I'll send more if necessary. I'm using Macports 2.01 on a MacBook Air. I installed octave-devel on my iMac under Snow Leopard and it still works under Lion.

Attachments (3)

main.log (15.2 KB) - added by liamg@… 10 years ago.
log file excerpt
Portfile (5.9 KB) - added by sebastian@… 10 years ago.
Portfile without carbon
main.2.log (1.8 MB) - added by onurdomanic@… 9 years ago.
for error ":info:build sed: RE error: illegal byte sequence"

Download all attachments as: .zip

Change History (22)

Changed 10 years ago by liamg@…

Attachment: main.log added

log file excerpt

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

Cc: michaelld@… removed
Description: modified (diff)
Keywords: lion added
Owner: changed from macports-tickets@… to michaelld@…
Summary: Build failure of octave-devel on OSX 10.7 (Lion) Machineoctave-devel: error: 'CGDisplayBitsPerPixel' was not declared in this scope

Correct, CGDisplayBitsPerPixel does not exist anymore. It was deprecated in Snow Leopard and removed in Lion.

comment:2 Changed 10 years ago by ForTozs

CC Me!!!

comment:3 Changed 10 years ago by sebastian@…

Hi,

it compiles on Lion, if you add

--without-framework-carbon

to the configure.args section of

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/math/octave-devel/Portfile

Bye Sebastian

Changed 10 years ago by sebastian@…

Attachment: Portfile added

Portfile without carbon

comment:4 Changed 10 years ago by bpabbott@…

A discussion of the same problem by developers of OpenSceneGraph is at the link below.

http://forum.openscenegraph.org/viewtopic.php?t=8894

comment:5 in reply to:  description Changed 10 years ago by bpabbott@…

A work around is to use the 10.6 Caron Framework. This can be done by adding the "-mmacosx-version-min=10.6" to CPPFLAGS, CFLAGS, and LDFLAGS.

comment:6 Changed 10 years ago by jkeeler@…

I had no luck with the CFLAGS option, but --without-framework-carbon option above worked for me. Using OS X 10.7.1

I also had success with this patch file, with carbon framework enabled.

  1 --- /opt/local/var/macports/sources/rsync.macports.org/release/ports/math/octave-devel/work/octave-3.4.2/src/display.cc 2011-04-11 07:57:08.000000000 -0700
  2 +++ /opt/local/var/macports/sources/rsync.macports.org/release/ports/math/octave-devel/work/octave-3.4.2/src/display.cc.new     2011-08-25 15:17:02.000000000 -0700
  3 @@ -39,6 +39,19 @@
  4 
  5  display_info *display_info::instance = 0;
  6 
  7 +size_t CGDisplayBitsPerPixel (CGDirectDisplayID display)
  8 +{
  9 +  CGDisplayModeRef originalMode = CGDisplayCopyDisplayMode (display);
 10 +  CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(originalMode);
 11 +
 12 +  if (CFStringCompare(pixelEncoding,CFSTR(IO32BitDirectPixels),0)==0)
 13 +    return 32;
 14 +  else if (CFStringCompare(pixelEncoding,CFSTR(IO16BitDirectPixels),0)==0)
 15 +    return 16;
 16 +  else 
 17 +    return 8;
 18 +}
 19 +
 20  void
 21  display_info::init (bool query)
 22  {

Also had to add this line to the Portfile:

patchfiles patch-src-display.cc.diff

and place the diff file above into /opt/local/var/macports/sources/rsync.macports.org/release/ports/math/octave-devel/files folder

good description for patching ports here: http://guide.macports.org/

comment:7 in reply to:  6 Changed 10 years ago by bpabbott@…

@jkeeler, If you can provide a patch that will work with earlier versions of MacOS I can see that it is committed to Octave's development sources.

comment:8 Changed 10 years ago by bpabbott@…

Cc: bpabbott@… added

Cc Me!

comment:9 Changed 10 years ago by derekathomas@…

Cc: derekathomas@… added

Cc Me!

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

I just updated octave-devel to 3.4.3. Is this still an issue for others? I know of folks (using MacPorts) who have had success installing octave-devel on Lion.

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

I installed "octave-devel +fltk +gcc45" today on 10.7 (latest updates) -- worked just fine with the changes I checked in this morning in r87964 (and, without adding "--without-framework-carbon" to the configure arguments). That said, I'd bet that the OP didn't do +fltk, and thus the "default" display is being selected ... which even with 3.4.3 (I just checked) uses "CGDisplayBitsPerPixel". I'll try compiling without +fltk tomorrow & see if that produces this error; and, if so, I'll try the patch above.

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

Resolution: fixed
Status: newclosed

Fixed in r88087.

comment:13 Changed 9 years ago by onurdomanic@…

Resolution: fixed
Status: closedreopened

I'm trying building octave-devel in Mountain Lion and getting the same error. I have MacPorts 2.1.2 and Xcode 4.4 and everything is up to date.

comment:14 Changed 9 years ago by onurdomanic@…

Cc: onurdomanic@… added

Cc Me!

comment:15 Changed 9 years ago by bpabbott@…

Octave's sources have recently been patched with the intent of fixing this.

Regarding "the same error", are you seeing;

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

If so the fix should be simple. The portfile for octave-devel has the lines below. A similar block can be added for 10.8 (darwin 12).

95    platform darwin 11 {
96	    # 10.7 requires an extra patch; this patch will break the build on
97	    # 10.6 and prior, so apply it only under 10.7.
98	    patchfiles-append patch-src-display.cc.diff
99	}

comment:16 Changed 9 years ago by mechgyver@…

Cc: mechgyver@… added

Cc Me!

comment:17 Changed 9 years ago by onurdomanic@…

Thanks for the help. I added a similar block for darwin 12 as you suggested and that particular error is gone, but now I see another one:

:info:build sed: RE error: illegal byte sequence

I'm attaching the log file.

Changed 9 years ago by onurdomanic@…

Attachment: main.2.log added

for error ":info:build sed: RE error: illegal byte sequence"

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

Hopefully this ticket is addressed in r97159. Please do a seflupdate and then see if the new octave-devel works for you. I'm leaving this ticket open for now, hoping for feedback (one way or the other).

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

Resolution: fixed
Status: reopenedclosed

OK; so I'll backtrack a bit on my word :) This ticket's issue is fixed, so I'm closing it. If the ":info:build sed: RE error: illegal byte sequence" error continues after the latest changes, please open a new ticket.

Note: See TracTickets for help on using tickets.