Error compiling even IV on 10.6 Snow Leopard

rishi
Posts: 3
Joined: Thu Jun 09, 2005 1:06 pm
Location: Indian Institute of Science

Error compiling even IV on 10.6 Snow Leopard

Post by rishi »

I have a problem in even compiling IV on Snow Leopard. configure works, and generates the makefiles. But, make fails! Typical error messages look like the compiler is apparently missing a header relating Carbon. Examples are below:

../include/IV-Mac/window.h:112: error: 'GetWindowPort' was not declared in this scope
../include/IV-MAC/window.h:112: error: 'SetPort' was not declared in this scope
IV-Mac/canvas.cpp:331: error: 'ClipRect' was not declared in this scope

I looked at the other thread related to Snow Leopard and tried the IV with the alpha 7.1 distribution.. That did not help. I am starting a new thread here because this was relating to compiling IV, even before getting to NRN.

Please help. Thanks in advance
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

I do not have access to a snow leopard mac. You didn't say what your configure line was.
Is there no carbon framework anymore?
rishi
Posts: 3
Joined: Thu Jun 09, 2005 1:06 pm
Location: Indian Institute of Science

Re: Error compiling even IV on 10.6 Snow Leopard

Post by rishi »

I used this for configure: configure --prefix=$IDIR/iv --enable-carbon

I have been reading through Carbon related problems on snow leopard on mac user forums. Though I see a number of instances of such problems, I don't see a solution apt for this one in hand!
btorb
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am

Re: Error compiling even IV on 10.6 Snow Leopard

Post by btorb »

./configure --prefix=$IDIR/iv --enable-carbon
configure: error: cannot run /bin/sh ./config.sub

(after installing XTools i can run "nrnivmodl", but the command doesn't work. Collegues (see the other thread about snow leopard) told me to install the latest version of NRN and recompile. but config even fails.)

UPDATE: apparently automake fails to generate "config.guess" and "config.sub".

unfortunately, it still doesn't compile, now with this error:

Code: Select all

In file included from IV-Mac/canvas.cpp:59:
../include/IV-Mac/window.h: In member function 'void MACwindow::setport()':
../include/IV-Mac/window.h:112: error: 'GetWindowPort' was not declared in this scope
../include/IV-Mac/window.h:112: error: 'SetPort' was not declared in this scope
../include/IV-Mac/window.h: In static member function 'static ivWindowRep* ivWindowRep::rc(OpaqueWindowPtr*)':
../include/IV-Mac/window.h:192: error: 'GetWRefCon' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::beginPaint()':
IV-Mac/canvas.cpp:331: error: 'ClipRect' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual ivCoord MACcanvas::width() const':
IV-Mac/canvas.cpp:405: error: 'GetWindowPort' was not declared in this scope
IV-Mac/canvas.cpp:405: error: 'GetPortBounds' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual ivCoord MACcanvas::height() const':
IV-Mac/canvas.cpp:419: error: 'GetWindowPort' was not declared in this scope
IV-Mac/canvas.cpp:419: error: 'GetPortBounds' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual ivPixelCoord MACcanvas::pwidth() const':
IV-Mac/canvas.cpp:433: error: 'GetWindowPort' was not declared in this scope
IV-Mac/canvas.cpp:433: error: 'GetPortBounds' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual ivPixelCoord MACcanvas::pheight() const':
IV-Mac/canvas.cpp:447: error: 'GetWindowPort' was not declared in this scope
IV-Mac/canvas.cpp:447: error: 'GetPortBounds' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::initClip()':
IV-Mac/canvas.cpp:518: error: 'ClipRect' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::push_clipping(osboolean)':
IV-Mac/canvas.cpp:534: error: 'ClipRect' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::pop_clipping()':
IV-Mac/canvas.cpp:557: error: 'ClipRect' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::clip()':
IV-Mac/canvas.cpp:605: error: 'ClipRect' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::stroke(const ivColor*, const ivBrush*)':
IV-Mac/canvas.cpp:922: error: 'MoveTo' was not declared in this scope
IV-Mac/canvas.cpp:924: error: 'LineTo' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::fill(const ivColor*)':
IV-Mac/canvas.cpp:953: error: 'OpenPoly' was not declared in this scope
IV-Mac/canvas.cpp:955: error: 'MoveTo' was not declared in this scope
IV-Mac/canvas.cpp:957: error: 'LineTo' was not declared in this scope
IV-Mac/canvas.cpp:962: error: 'ClosePoly' was not declared in this scope
IV-Mac/canvas.cpp:963: error: 'PaintPoly' was not declared in this scope
IV-Mac/canvas.cpp:964: error: 'KillPoly' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'void MACcanvas::color(const ivColor*)':
IV-Mac/canvas.cpp:999: error: 'RGBForeColor' was not declared in this scope
IV-Mac/canvas.cpp:1021: error: 'PenMode' was not declared in this scope
IV-Mac/canvas.cpp:1025: error: 'PenMode' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'void MACcanvas::brush(const ivBrush*)':
IV-Mac/canvas.cpp:1052: error: 'PenSize' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::flush()':
IV-Mac/canvas.cpp:1173: error: 'TextFont' was not declared in this scope
IV-Mac/canvas.cpp:1174: error: 'TextFace' was not declared in this scope
IV-Mac/canvas.cpp:1175: error: 'TextSize' was not declared in this scope
IV-Mac/canvas.cpp:1176: error: 'TextMode' was not declared in this scope
IV-Mac/canvas.cpp:1178: error: 'MoveTo' was not declared in this scope
IV-Mac/canvas.cpp:1179: error: 'DrawText' was not declared in this scope
IV-Mac/canvas.cpp: In member function 'virtual void MACcanvas::image(const ivRaster*, ivCoord, ivCoord)':
IV-Mac/canvas.cpp:1285: error: 'GetGWorld' was not declared in this scope
IV-Mac/canvas.cpp:1288: error: 'GetPortBitMapForCopyBits' was not declared in this scope
IV-Mac/canvas.cpp:1293: error: 'CopyBits' was not declared in this scope
make[2]: *** [IV-Mac/canvas.lo] Error 1
Making all in include
make[2]: Nothing to be done for `all'.
Making all in bin
Making all in idemo
g++ -DHAVE_CONFIG_H -I. -I. -I../../include   -g -O2 -DMAC=1 -Dcarbon=1 -DSYSV=1 -c -o main.o main.cpp
/bin/sh ../../../libtool --mode=link g++ -g -O2 -DMAC=1 -Dcarbon=1 -DSYSV=1 -framework Carbon  -o idemo main.o ../../lib/libIVhines.la  
libtool: link: cannot find the library `../../lib/libIVhines.la' or unhandled argument `../../lib/libIVhines.la'
make[3]: *** [idemo] Error 1
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

Code: Select all

../include/IV-Mac/window.h:112: error: 'GetWindowPort' was not declared in this scope
Since the compile line states '-Dcarbon=1', check that iv/config.h has the lines
#if defined(carbon)
#include <Carbon/Carbon.h>
#endif

Assuming it was included and there was no error saying it does not
exist, then I'm guessing some of the function names have been updated.
Run the window.cpp file throught the preprocessor using

Code: Select all

~/neuron/iv/src/lib hines$ g++ -DHAVE_CONFIG_H -I. -I. -I../include -DMAC=1 -Dcarbon=1 -DSYSV=1 -c IV-Mac/window.cpp  -fno-common -DPIC -E > temp
Looking at temp on my 10.4 os and searching for getwindowport I see
# 9078 "/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/MacWindows.h 3
extern CGrafPtr
GetWindowPort(WindowRef window) ;

I do admit that since 10.4 there have been an infinite number of warnings saying that these functions are deprecated.
I'm curious if
http://www.neuron.yale.edu/ftp/neuron/v ... 0.4.11.dmg
installs and runs correctly?
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

I've ordered the $29 snow leopard upgrade to my existing Leopard OS and will see what I can do about the carbon problem.
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

I installed Snow Leopard as an upgrade to an existing 10.5 and also re-installed the xcode development tools that
came with the Snow Leopard DVD and did not see any problem related to the --enable-carbon argument.
See my last message in http://www.neuron.yale.edu/phpBB/viewto ... 6364#p6364
in regard to changes you need to make in build.sh and symbol.c
I should mention that the 10.4 build distribution seems to work properly on Snow Leopard
http://www.neuron.yale.edu/ftp/neuron/v ... 0.4.11.dmg

I built InterViews from the mercurial sources (with modifications to both build.sh files and nrn/src/oc/symbol.c using

cd $HOME/neuron/iv
sh build.sh
./configure --prefix=/Applications/NEURON-7.1/iv --enable-carbon
make
make install

cd $HOME/neuron/nrn
sh build.sh
mkdir $HOME/neuron/nrnalphacarbon
cd $HOME/neuron/nrnalphacarbon
../nrn/configure --prefix=/Applications/NEURON-7.1/nrn --srcdir=../nrn --with-iv=/Applications/NEURON-7.1/iv --enable-carbon
make -j 2 install
make after_install

If there continues to be a problem on anyone's machine I suppose there could be a variation in the two aspects mentioned in
my first sentence above.
rishi
Posts: 3
Joined: Thu Jun 09, 2005 1:06 pm
Location: Indian Institute of Science

Re: Error compiling even IV on 10.6 Snow Leopard

Post by rishi »

Thanks, Hines. I tried all of your suggestions, but none of them helped. I still get the same error message when I "make". In terms of upgrade, I did the same thing as the one that you have mentioned — upgraded to Snow Leopard from 10.5 and also installed the xcode that came with it.

In any case, I downloaded the DMG distribution, and that seems to work properly!! So, I have NEURON running now on the system! I have always preferred compiling the source, but this time that did not work..!

Thanks, again!
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

On my machine I see that GetWindowPort is declared in
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolBox.framework/Versions/A/Headers
anusm
Posts: 8
Joined: Wed Sep 23, 2009 12:00 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by anusm »

I am having the same problem on Snow Leopard with similar error messages. I have installed the DMG distribution before and that works, but I really need to compile from source as I want to use NEURON as a module from Python and as I understand this is the only way to go about it. Any new ideas as to what I could do? Thanks!
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

I'm perplexed by the common problems everyone seems to be experiencing
along with my experience of seeing no problems at all.
I both upgraded and installed snowleopard from scratch. In both cases I installed the
snowleopard version of the xcode developer tools.
Are you having trouble building and installing from

Code: Select all

hg clone http://www.neuron.yale.edu/hg/neuron/iv iv
cd iv
sh build.sh
./configure --prefix=/Applications/NEURON-7.1/iv --enable-carbon
make
make install
anusm
Posts: 8
Joined: Wed Sep 23, 2009 12:00 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by anusm »

I installed Mercurial and tried the Mercurial version but am getting similar problems.

The configure step seems to work except I get some warnings:

Code: Select all

config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting
Then when I type make I get the following errors:

Code: Select all

IV-Mac/canvas.cpp: In member function ‘virtual void MACcanvas::beginPaint()’:
IV-Mac/canvas.cpp:331: error: ‘ClipRect’ was not declared in this scope
IV-Mac/canvas.cpp: In member function ‘virtual ivCoord MACcanvas::width() const’:
IV-Mac/canvas.cpp:405: error: ‘GetWindowPort’ was not declared in this scope
IV-Mac/canvas.cpp:405: error: ‘GetPortBounds’ was not declared in this scope
IV-Mac/canvas.cpp: In member function ‘virtual ivCoord MACcanvas::height() const’:
IV-Mac/canvas.cpp:419: error: ‘GetWindowPort’ was not declared in this scope
IV-Mac/canvas.cpp:419: error: ‘GetPortBounds’ was not declared in this scope
and other similar ones.
At the end I get:

Code: Select all

make[2]: *** [IV-Mac/canvas.lo] Error 1
Making all in include
make[2]: Nothing to be done for `all'.
Making all in bin
Making all in idemo
g++ -DHAVE_CONFIG_H -I. -I. -I../../include   -g -O2 -DMAC=1 -Dcarbon=1 -DSYSV=1 -c -o main.o main.cpp
/bin/sh ../../../libtool --mode=link g++ -g -O2 -DMAC=1 -Dcarbon=1 -DSYSV=1 -framework Carbon  -o idemo main.o ../../lib/libIVhines.la  
libtool: link: cannot find the library `../../lib/libIVhines.la' or unhandled argument `../../lib/libIVhines.la'
make[3]: *** [idemo] Error 1
anusm
Posts: 8
Joined: Wed Sep 23, 2009 12:00 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by anusm »

So, I searched for the ClipRect function definition but only found the declaration:

Code: Select all

/*
 *  ClipRect()   *** DEPRECATED ***
 *
 *  Mac OS X threading:
 *    Not thread safe
 *
 *  Availability:
 *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.4
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Non-Carbon CFM:   not available
 */
extern void
ClipRect(const Rect * r)                                      AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4;

This was in the file: /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/Headers/QuickdrawAPI.h
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

/Developer/SDKs/MacOSX10.5.sdk
Do you have a
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Carbon.framework
I get that whenever I install the Xcode.mpkg that comes with the Snow Leopard
install dvd.
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Error compiling even IV on 10.6 Snow Leopard

Post by hines »

I installed yet again from an empty partition. On my machine, the following works fine

Code: Select all

hg clone http://www.neuron.yale.edu/hg/neuron/iv iv
cd iv
sh build.sh
./configure --prefix=/Applications/NEURON-7.1/iv --enable-carbon
make
make install
I notice that the compile line for canvas.cpp is

Code: Select all

libtool: compile: g++ -DHAVE_CONFIG_H -I.  -I.  -I../include -g -O2
-DMAC=1 -Dcarbon=1 -DSYSV=1 -c IV-Mac/canvas.cpp -fno-common -DPIC -o
IV-Mac/.libs/canvas.o
and that
$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
Post Reply