[Qgis-developer] Re: OSX build notes

William Kyngesburye woklist at kyngchaos.com
Tue Jun 5 10:32:52 EDT 2007

On Jun 5, 2007, at 12:13 AM, Tim Sutton wrote:

> Hi
> 2007/6/4, William Kyngesburye <woklist at kyngchaos.com>:
>> OK, so I had some time today and broke down and tried the cmake thing
>> on OSX.
> Yay :-)
>  Here are a few notes about Tim's wiki instructions after a
>> quick run thru (I tried 0.8.0 first, but moved on to 0.9 trunk).
> Its working for me with both 0.8.1 branch and trunk
I noticed that some of the dependency checking is broken - fixes in  
0.9 haven't been backported.  It sets .so extensions for some:

-- Found GDAL: /Library/Frameworks/GDAL.framework/unix/lib/libgdal.so
-- Found PostgreSQL: /usr/local/pgsql/lib/libpq.so

>> - Python - for a universal build, add the -n flag to the SIP
>> configure.  PyQt picks this up and automatically builds universal.
> Like this you mean?
> python configure.py -n

>> - I wasn't too keen on the cmake binaries installing in /usr (that
>> should be left alone, for system stuff), so I built from source using
>> the default /usr/local.  Pretty simple:
> Ok - in the instructions I suggested to build in your home dir like  
> this:
> cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ ..
No, I mean for installing cmake itself, not Qgis.

>> ./bootstrap
>> make
>> sudo make install
> Where does ./bootstrap come from?
part of cmake source
>> - it would be nice to list variables for configurable dependencies.
>> I have some static libs in non-standard locations.  Or maybe the
>> ccmake interactive configure can take care of this?
> I think you can set pretty much everything in ccmake or by editing
> CMakeCache.txt (==hack I think). Did you have probelsm with gdal.so
> etc? Will be nice if we can get the mac version to use .dylib rather.
> In openModeller I edited cmake/FindGDAL etc scripts to achieve this
> but I dont know if thats the best way...
You mean like the above 0.8 problem I mentioned?  Seems to be OK in  
0.9 trunk.

>> - I see some universal flags in the resulting cmakecache.txt, though
>> just my architecture is set.  I tried editing cmakecache.txt to set
>> both architectures, but it's not adding those flags to compile and
>> link.  How do I turn on a universal build?  Or do I need to manually
>> add the flags for now?
> specify CMAKE_OSX_ARCHITECTURES as i386;ppc
Found that immediately after sending email

> I havent been able to successfully make a universal binary yet - I
> guess some of my deps need to be compiled as unoversal too. Did you
> see in my wiki notes where I should have done this for gsl etc? Or
> does it happen automagically?
Since I was talking about universal-ness, I should have looked at the  
extra deps you mention ^_^

GSL is a bit tricky.  First, for all universal building where it  
isn't a builtin option, this nifty trick helps a LOT:


Install it as /usr/local/bin/ccub and c++ub

Then, configure GSL with (prefix defaults to /usr/local, BTW):

./configure --mandir=/usr/local/share/man CC=/usr/loca/bin/ccub

BEFORE running make, take care of a couple PPC/Intel configured  
options.  Edit config.h and replace the HAVE_DARWIN_IEEE_INTERFACE  

#ifdef __BIG_ENDIAN__

then make

For expat, the simple way would be to require X11 installed and use  
that one - the universal SDK has it for building universal.

Otherwise, it's similar to GSL, using ccub.

./configure CC=/usr/loca/bin/ccub

BEFORE make, edit expat_config.h and lib/macconfig.h for these options:

#ifdef __BIG_ENDIAN__
   #define BYTEORDER 4321
   #define WORDS_BIGENDIAN 1
   #define BYTEORDER 1234

Bison doesn't need to be universal.

>> - and then I get stuck at:
>> cc1plus: warnings being treated as errors
>> ...
>> /Users/Shared/src/qgis/qgis-svn-070604/src/core/qgsgeometry.cpp:2511:
>> warning: comparison between signed and unsigned integer expressions
> Ok this is fixed in SVN. By default the pedantic flag is on and all
> warnings are treated as errors. You can turn the pedantic flag off in
> ccmake (though I recommend you keep it on and let us know if you get a
> similar warning).

Thanks, I'll grab a new tarball.

William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

More information about the Qgis-developer mailing list