Python 3.1.1 on Mac OS X 10.6 Snow Leopard - macos

I've spent some time today playing with getting the source for python 3.1.1 to build on my MacBook Pro using the --enable-framework and --enable-universalsdk options with no success. I will humbly admit that I have no real clue why I can't compile 3.1.1 on Snow Leopard, I did make sure to get the new Xcode version for Snow Leopard, and made sure I also installed the 10.4u SDK. It seems to be choking on the 10.4 SDK during the make stage, and has several error regarding headers for wchar, cursor, and ncursor during the configure stage. I have been able to get a make from a plain configure, and most the test pass, but that just isn't challenging enough. Has anyone else attempted to build python 3.1.1 on a Mac running Snow Leopard

There is an automated installer here: http://python.org/ftp/python/3.1.1/python-3.1.1.dmg

You need to set MACOSX_DEPLOYMENT_TARGET if you actually want to use an older SDK.
If you target 10.6, it may be that PPC building is not supported anymore, according to this bug report. In fact, that may be the case even if you target 10.4, using XCode 3.2 (haven't tried myself).

I don't have 10.6 installed yet so I can't say for sure it will work without issue but, in general, if you want to build a batteries-included framework build optimized for 10.6 of Python on OS X, you're best off using the installer build script in the source tree at Mac/BuildScript/build-installer.py after applying the patch in the bug report Martin referred to. Something like this should work [untested]:
./build-installer.py --sdk-path=/Developer/SDKs/MacOSX10.6.sdk --universal-archs=intel --dep-target=10.6 --src-dir=... --build-dir=...
That will build everything including dependent third-party libraries and the documentation but, be forewarned, you'll probably have to tweak things until you get it right and a few things aren't supported yet in 64-bit, most notably, tkinter. As mentioned above, the standard python.org 3.1.1 installer should likely work OK as long as you don't need 64-bit support.
[EDIT: I should clarify that, WRT 64-bit support, the problem isn't in tkinter, rather that the Apple-supplied versions of Tk in 10.5 and earlier were 32-bit only and so there was code in setup.py to prevent attempting to build a 64-bit version of tkinter on OSX. Perhaps that check can be removed now if the 10.6 Tk is 64-bit.]

Kenneth Reitz's soluton doesn't work for me. In fact, the install works fine but my default PATH still points to /usr/bin/python (v2.6.1.). I vaguely recall that we should be modifying our ~/.profile to point to /.../Frameworks and I expected the installer to do this for me (nope).
Anyway, /Library/Frameworks/Python.framework/Versions/3.1/bin exists so we could add it.
But I'm curious why the python bin in there does a crash and burn on me.
No time to resolve this now. Bye.

Related

How can I use the pre-compiled binaries to update to clang 3.3 on Mac OS 10.6.x?

I'm trying to install/update my clang from Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn) to clang version 3.3. I've downloaded the pre-compiled binaries into usr/bin/, as suggested by other posts (How can I update clang to 3.3 on Mac OS X 10.6).
The point of this installation/update is to be able to use C++ code (not written by me, and written for a newer machine OS 10.8.x) on my mac. I would preferentially use Xcode to update this, but unfortunately, Apple has not made the necessary version of Xcode available for free without a developer's subscription.
I've edited my PATH and LD_LIBRARY_PATH to include clang3.3/bin/ and clang3.3/lib, but I get an "Illegal Instruction" error and it's not clear to me why this is.
What I'd really like is to try the whole process again from the beginning with a step-by-step outline of the process, like is seen here (How to install clang pre-built binaries ubuntu 12.04), except for Mac OSX system, not Ubuntu.
I realize there are some previous threads that ask almost the same question, but I am asking specifically for these versions (and from a standpoint that includes very little experience installing via terminal/understanding pathways/etc.).
Thanks for any help.

../include/wx/mac/carbon/private.h:1459: error: ‘Cursor’ does not name a type

I have been using RapidSVN on a Linux machine for the past few years - it has become an excellent tool for managing my source.
Yesterday my trusty Linux laptop had a couple of strokes so I decided it was time to replace it. Today I went out and purchased a new Mac Book Pro with the flashy display and solid state drives.
Then I went hunting for an SVN tool to run on Mac. I found that RapidSVN will run on a Mac as it was developed using wxWidgets (cross platform windowing).
So, I needed to install wxWidgets, however this doesn't come as an executable so I had to download the tar ball. To compile I realised I don't have a compiler installed yet... so, install Xcode 4.4, then learn that doesn't install a compiler either... find the Xcode preference to install the command line tools (compiler).
So, now I have Xcode installed, a gcc compiler, and tracking back up it comes to wxWidgets. It takes a little working out but I manage to extract the files into a directory in my home folder, (following instructions of course), and from the 'build' folder I run the ../configure command (which seems to work) and then the 'make' command which fails:
In file included from ../include/wx/mac/private.h:4,
from ../src/common/dynlib.cpp:48:
../include/wx/mac/carbon/private.h:1459: error: ‘Cursor’ does not name a type
../include/wx/mac/carbon/private.h:1488: error: ‘ClassicCursor’ does not name a type
make: *** [baselib_dynlib.o] Error 1
So I go hunting for a solution only to find this bug: http://trac.wxwidgets.org/ticket/14536 which unfortunately indicates this is not going to be fixed.
Changed 10 months ago by csomor
* status changed from new to closed
* resolution set to wontfix
A dismal day in the land of computers. I am now stuck for the next 5-6 years on a computer that will never be able to compile anything using wxWidgets - I rather feel like taking it back to Apple and getting my money back.
So where to from here? Is there a binary version of wxWidgets available? Is there a binary version of RapidSVN available? Should I downgrade to OSX 10.x something less than I am currently on? Should I upgrade to unstable wxWidgets?
This is an interesting but not very understandable read. What exactly are you trying to achieve? If you're looking to use the best available version of wxWidgets under OS X, get 2.9.4 or the current svn version and build it using the Xcode version you have already with Cocoa support. If you absolutely need to continue to use Carbon (why?), either install Xcode 3, available from Apple, or get 10.6 (or 10.5) SDK in some other way and pass it as the SDK to use to configure using --with-macosx-sdk option as explained in the documentation.
VZ is right. If you need to use wxWidgets 2.8 on OS X (and there are legitimate reasons for needing to do so), get the 10.6 SDK. Copy it alongside the already installed 10.7 and/or 10.8 , and select it in the project/target's build settings.
From here I have given up trying to compile anything on my current OSX. I am not going to downgrade or install multiple versions of different libraries in order to satisfy the lack of support for the latest current stable versions.
From here I will download and install binaries only.
I have Mac OSX Lion and just did this:
brew install wxmac
and was able to get through the install with no issues.

confusion of how to make osx app backward compatible & how to test them

after reading the apple SDK guide
https://developer.apple.com/library/mac/#documentation/developertools/conceptual/cross_development/Overview/overview.html
I'm still confused of how to make the mac app backward compatible & how to test them properly
I have an app, I run it and tested it on Mountain Lion 10.8 without any problem, however I want to make this app backward compatible so that other users can run it on a mac 10.6 - 10.7 machine.
I have an apple developer id and I can download the old versions of 10.7 and 10.6, but the problem is, I have a 2011 macbook air which is currently running 10.8, and that's the only apple machine that I have. Can I test the 10.7 and 10.6 by using vmware or parallels?
in my project settings, I set the target deployment to 10.6 (as I want 10.6 users to run my app), but should I set my SDK to 10.8 or 10.7? if I set the SDK to 10.8 but having the target deployment set to 10.6, if I fix all the xcode warnings will it run successfully on 10.6??
from the SDK drop down, I can only set to 10.8 or 10.7, but 10.6 is missing, how do I fix that?
thanks in advance
I develop on a 10.8 box and support back to 10.5. Just a couple of months ago we dropped 10.4 PPC support, and I'm still cleaning out some of the 10.2-specific code. This may get a little rant-y, but I've been doing old versions for a long time. I have some opinions on the matter.
No matter what Apple says in their docs, if you want to support 10.6, then build with the 10.6 SDK. Do not rely on distribution target.
I have had this discussion with the Xcode engineers, and while they hold to Apple's party line that you should always build with the latest SDK, they also acknowledge that it's generally insane to do so. If you build against the 10.8 SDK and mark your deployment target at 10.6, you will get no warnings for using methods that do not exist on 10.6. The only way you will discover that you've used a nonexistent method is that it might give you strange bugs when run on 10.6. That's insane.
Remember, OS X doesn't crash when you send an unknown selector. It just aborts the current runloop. So the bugs are even harder to track down then on iOS, where it crashes the app.
Sure, you can do weak linking. Talk about dangerous.... Yes, there are a few times this is useful, but the compiler gives you no warning if you don't do it correctly. If I'm going to do weak linking like this, I go the other way, linking against the old SDK and copying the new function's prototype into my implementation. That way I have documentation of every function I think I'm going to weak-link.
Download the old SDKs and symlink them into your Xcode distribution.
Guard them jealously. Apple will try to delete them every time you upgrade Xcode. Make your own copies and stick them in /SDKs or somewhere else away from Xcode. I provide a script called fix-xcode to manage the symlinks automatically. Am I bitter at Apple for their relentless insistance on deleting my old SDKs? Yes, I am.
You can run 10.6 Server in a VM legally. You can run 10.7+ Desktop in a VM legally. These are good ways to test your code.
Or you can do what I do and have a small pile of old MacBooks each with two or three partitions on them that you reboot all the time.
Now that 10.7 comes from App Store, it's a little harder to make VMs. My strong recommendation is to snapshot your image immediately after install, and make a clean backup copy of it. You'll want to be able to clone that image from time to time when you need to get back to a "raw" machine.
Get in the habit of squirreling away SDKs as they come out. 10.8 will be old some day. You might as well make a copy now while it's easy.
Whether you support individual dot-releases or not, it can be very helpful to keep around the upgrade packages for individual dot releases. When you encounter customers running non-current releases, it's nice to be able to check whether an "unreproducible" bug in fact is easily reproducible on their specific version. Whether this is worth it or not depends heavily on your product and customers. It was a life-saver for me when 10.4.11 made major changes to WebKit during a dot release...
Invest in a small NAS or a big external USB drive (though I've had trouble with those failing when used extensively, so I prefer a RAID). You'll need the space. You want to hold onto lots of VMs and lots of SDKs and sometimes even old versions of Xcode.
Adding to Rob Napier's great in-depth answer:
To use an old SDK, put the SDK (or a symlink) to it here:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
With XCode 7.3 or later, you need you to open this file and change "MinimumSDKVersion" (otherwise XCode will refuse to use the old SDK):
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
You can install multiple versions of Mac OS on a single machine, booting between each.
The SDK should be the latest (10.8).
See 2.
One alternative to 1 that I've considered (I am in the same boat) is to create a Snow Leopard Hackintosh using an old PC and just installing Lion and Mountain Lion on my MBP.
You need to do these settings :
1.Set the Base SDK to Current version of Mac (ex. 10.7)
2.Set the Deployment SDK to older version (ex.1.4)

Is it possible to build MonoDevelop 3 on Mac OSX 10.5.8 (Leopard)?

A while ago I had downloaded MonoDevelop 3 for Mac, only to find out that it doesn't run on version 10.5.8 (Leopard). Later I found a terse statement on some obscure website (which I can't find now). I can't find anything on the MonoDevelop website about minimum system requirements for MD version 3.XX on a Mac.
Is it possible then to build MD 3 to run on my Mac Leopard machine, or am I stuck having to upgrade to Snow Leopard? Or, is there a dependency which requires a minimum version of Xcode (in the 4.xx series?) to build it?
If someone could even point me to some information about what I need to build it for my Mac, that would be great.
CHEERS
Instructions for building MonoDevelop on OS X are here. I haven't built it on 10.5 in years but can't think of any major reason why it shouldn't work. It has a build time dependency on some of the Unix tools from Xcode (make, autoconf etc) but an older Xcode should work fine, or you might be able to get them on Homebrew. The main dependency is Mono, and the GTK+ included with Mono, and I'm not sure what the dependency of those is - try the latest packages. There may be a few places in MD itself where we took minor dependencies on newer things (e.g. P/Invokes) that you could fix as you run into them.

Upgrading to Mac OS Lion as Developer

I'm planning to buy Mac OS Lion, but I would like to know some informations.
- Are Snow Leopard's apps compatible with Lion?
- Are apps compiled with Xcode for Lion compatible with Snow Leopard? What if these app uses popovers/fullscreen which are features of Lion?
xCode requires a full download (the full 5*ish GB) and if you are a Java guy you will have to re download Java as it is not included (this was my experience when opening eclipse for the first time in Lion).
Some of Snow leopards apps are compatible, not all (ppc apps will not work). It is probably best to check with the software vendor first.
Another thing your Library folder disappears on an upgrade among some others where Lion is trying to 'Protect' its users. To get round this simply enter the command into terminal. (replace username with your username and foldertoreveal with the hidden foldername)
chflags nohidden /Users/Username/FolderToReveal
The upgrade process other wise has been fine. For reference I am an Obj C /C++ /C and Java developer. Hope this helps
Also will link you to this post about Developing Java on Lion:
Stack Overflow post on Java in Lion
A very good list of compatible applications is available at RoaringApps. I highly recommend checking for your favorite editors/IDEs/etc there.
Of note:
TextMate: "Works fine," but there are some issues
BBEdit: "Works fine"
iTerm2: "Works fine" (minor interface bugs)
And of course, Apple's tools require an upgrade to XCode 4.1.
As far as developing with the new APIs in Lion, you can explicitly target a specific version of OS X for compatibility. When building for 10.6, those new APIs will not be exposed during compilation and you will get warnings about unrecognized selectors if you try to use them.
So far what I've noticed :
- make sure you install XCode 4.1 (not the same as 4.0, it's a free separate download), which fixes the Python includes mess
- go to terminal and type "java", this will trigger the download of the Java runtime
But I chose to avoid the burden of fixing all libs by going with a clean install of Lion (from a USB key)
cvs stopped working for me, but downloading Xcode seemed like an unnecessarily heavyweight fix. Adding /Developer/usr/bin to my PATH fixed it for me.

Resources