[Gdal-dev] Universal GDAL build on OS-X ??

Christopher Barker Chris.Barker at noaa.gov
Fri Oct 26 12:53:45 EDT 2007


William,

Thanks for the detailed answer. I've probably screwed up threading with 
this message, as our spam filter suddenly got all aggressive and was 
filtering out all sort of mailing list messages -- I had to go to the 
web to find this.

I wonder if this should be put up on a Wiki page? It's in the list 
archive, but the Wiki may be a better place for it.

Anyway, now I need to decide what to do. I'm trying to build on OS-X, as 
it's been my primary platform lately, and I want to work with/on the 
trunk, to help a bit with 1.5 issues with python.

On the other hand, this all such a pain in the *&^@& that maybe I'll 
just do all this with my Linux box instead. But, I may move forward a 
bit with this...

> Oh, there's a fun one.  And Python forces you to supply universal  
> libraries to build extensions.  Though you might check the mac python  
> mailing list - it may be possible to build a single architecture  
> extension for the universal python.

I'm pretty sure that that is possible -- I'll go dig up the info -- 
that's probably the best solution for the problem at hand.

> First, as you speculate, there's the method that takes no patching of  
> sources (a couple dependencies have minor endian issues) - build on  
> both architectures and lipo them together.  But that's too much trouble.

I agree -- it does seem to be too much trouble - and it you only have 
one architecture handy -- you've got the same endian issues, don't you?

> The better way is to do it all at once on a single OSX architecture.   
> It depends on where you want to start.  If you use universal  
> dependencies and just build GDAL yourself from source, it's not too  
> hard.

That's OK with me!

It seems various libraries are getting better about being able to build 
Universal out of the box -- but by the time we get there, most of us 
will be running Intel Macs anyway!

> You probably know about the arch flags needed, -arch ppc -arch i386,  
> and the SDK, -isysroot /Developer/SDKs/MacOSX10.4u.sdk.

actually, I didn't know about the isysroot one...

> The  
> isysroot flag has its own trap - /Library/Frameworks and /usr/local  
> is not in it, so 3rd-party libs and frameworks will be missed unless  
> some symlinks are added to it

arg!!

> There is an easy way to get the flags into the compile and link  
> commands where needed:
> 
> http://www.macosxhints.com/article.php?story=20061025213851279

Thanks, that should help.

> The key for the sources is that some packages use a configured endian  
> setting, instead of runtime endian detection

all I can say is AARRGG!

> SO, for GDAL, if you have all other dependencies universal, after  
> running configure edit port/cpl_config.h and delete the two lines  
> with WORDS_BIGENDIAN and HOST_FILLORDER, and replace them with:
> 
> #ifdef __BIG_ENDIAN__
>    #define WORDS_BIGENDIAN 1
>    #define HOST_FILLORDER FILLORDER_MSB2LSB
> #else
>    #undef WORDS_BIGENDIAN
>    #define HOST_FILLORDER FILLORDER_LSB2MSB
> #endif

Is there some way we could automate this so that we could have a 
--with-osx-universal flag to configure?

I can just put that in my "run configure" script, but it'd be nice to 
have it standard.

> Universal-friendliness is not something I can do much about, unless  
> there is a lot of interest or I really get aggressive about it (I got  
> GRASS to change).

Anything you do is great -- things are getting better elsewhere too.

 > One I'm thinking about pursuing (when other things
> settle down a bit) is PROJ.

That would be great, thanks for everything you're doing with all this!!

A new thought - could you send me whatever scripts you're using to 
build? It makes more sense for me to just follow what you're doing than 
re-invent it. (plus it would save me some work ;-)  )

thanks again,

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the Gdal-dev mailing list