Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build gdal 1.10.1 on Maverick Xcode 5.0.2 #1

Open
mohpor opened this issue Feb 18, 2014 · 13 comments
Open

Cannot build gdal 1.10.1 on Maverick Xcode 5.0.2 #1

mohpor opened this issue Feb 18, 2014 · 13 comments

Comments

@mohpor
Copy link

mohpor commented Feb 18, 2014

Hi,
I'm working hard on compiling gdal for iOS and I ran into your python scripts (wonderful work btw) but I'm stuck with a weird issue.
let me explain the situation:
1- gdal 1.10.0 won't be compiled because of some known issues with OSX/iOS on gdal side discussed here and here
2- After changing gdal.py to reflect the need to download 1.10.1 instead of 1.10.0, when I run

python preflight.py build gdal

certain errors come up that when I investigate, I can see that the linker is trying to link standard libraries from OSX SDK (in /usr/include/sys) instead of iOS SDK (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/sys)! this leads to errors like _Unsupported Architecture_ in cdef.h and all.

P.S.: proj4 gets compiled for all architectures and is present in ~/iOS_libs output directory, gdal compiles for i386 & x86_64 only.
P.P.S: I have limited my Archs to armv7 for the sake of speed. I had to remove arm64 because it wouldn't pass for proj4.
same error goes for 1.10.0,1.10.1, 1.9.2

How can I overcome this issue?

@ghost
Copy link

ghost commented Feb 18, 2014

I just successfully ran a build using Xcode 5.0.2 and Mavericks.

Have you run xcode-select to ensure your Xcode 5.0.2 install is the active install?

@mohpor
Copy link
Author

mohpor commented Feb 18, 2014

Thanks for the reply,
I just checked it with another mac, this time it is built successfully for armv7, armv7s but not for arm64,
I have decided to set aside arm64 for now.
I'm guessing some env. settings must be corrupted on my other mac that makes the script fail. I may have symlinked some important paths, though, when I checked my /usr/ folder on this mac, it's very different from my problematic mac!
I'm just trying to explore gdal, it would be nice if you could provide us with the fat binary somewhere on the web for now!
thanks again

@afarnham
Copy link
Owner

Yes, I had troubles when I tried compiling it for arm64 today as well. However, like you, arm7 and arm7s compiled fine. I'll have to dig into the arm64 stuff more.

I know that in many cases the autoconf files for these projects are out of date. Proj4.9 beta has udpated autoconf files that will compile for arm64, but GDAL does not last time I checked (early January 2014)

@mohpor
Copy link
Author

mohpor commented Feb 18, 2014

I have changed the min version to 6.0 and I'm guessing I'm going to have to make a special lib for arm64 because arm64 is not supported in iOS 6.0 SDK! am I right or I'm horribly wrong?

@afarnham
Copy link
Owner

I don't think so. iOS 6 devices will just ignore the arm64 slice of the lib as long as you have an arm7 or arm7s slice in the lib.

@mohpor
Copy link
Author

mohpor commented Feb 18, 2014

I'm not talking about the app that'll use the lib, but about the compilation process. if I try to set the min deployment target to 6.0, it'll use the iOS 6.0 SDK for linker and arm64 is not a valid architecture for iOS 6.0! I'm not sure if I'm right. I'm no even sure if I should set min deployment version to 6.0! my app will support iOS 6 but do I have to compile libgdal for min.dep.ver. 6 or not?!

@afarnham
Copy link
Owner

Oh, I understand. You are correct. The iOS 6 SDK cannot compile for arm64.

However, you could compile a separate arm64 only lib and add it to your lib that was compiled with the iOS 6 SDK using the lipo tool.

@afarnham
Copy link
Owner

If your app supports iOS 6, you should set min deployment version to 6

@mohpor
Copy link
Author

mohpor commented Feb 18, 2014

thanks aaron,
looks like x86_64 is not compiling too. it might help if we include --without--gif to config prefixes.

@afarnham
Copy link
Owner

I can do that next week when I have more free time or if you create a pull request with that change, I will merge it in as soon as possible (today or tomorrow).

@mohpor
Copy link
Author

mohpor commented Feb 18, 2014

That might help with x86_64 but then again, one might need the gif lib, it's not a good idea, I'd rather remove x86_64 arch from the list altogether.
There is a minimized driver config for gdal, might worth taking a look, whenever you had the time.

@afarnham
Copy link
Owner

Fixed armv7 and armv7s builds by making sqlite3 a dependency. GDAL required a sqlite3 lib and was willing to use the MacOS X sqlite3 if necessary. By pointing to a sqlite3 built for iOS, the GDAL build system will not seek out the MacOS X version. Have not tested on arm64 yet, but I did push the changes.

@afarnham
Copy link
Owner

Also, I used Xcode 5.1 with iOS 7.1 as the minimum deployment target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants