compiling cfdg under mac os x

Here you can discuss and share functionality improvements and helper programs to make Context Free better.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
kipling
Posts: 91
Joined: Wed Jun 18, 2008 2:36 am

compiling cfdg under mac os x

Post by kipling »

I wanted a command line cfdg to automate some experiments, and thought I should share the tweaking required to build it under mac os x.

The main problem seems to be that ffmpeg requires gcc, which I could have used, but instead of that, I decided to try and build it using XCode's clang compiler, and turning off the ffmpeg part of the build using the instructions in src-ffmpeg/README.txt. These instructions need updating a little - the Makefile tweaks don't quite purge all reference to ffmpeg and so the build still chokes. I think it was the LIB_DIRS variable that killed it (the current src-ffmpeg/lib points nowhere), but I also trimmed INC_DIRS.

The only other tweak I had to make was due to the fact that my copy of libpng is from fink, so in the end I had LIB_DIRS = /sw/lib, but whether this is worth documenting I will leave up to you.

User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: compiling cfdg under mac os x

Post by MtnViewJohn »

The changes in src-ffmpeg/README.txt work on my system (OS X Mountain Lion and XCode 4.5.2). I do get a warning
ld: warning: directory not found for option '-Lsrc-ffmpeg/lib'
But the build still completes. I could put a dummy file at src-ffmpeg/lib to suppress this warning. Does your build really fail?

User avatar
kipling
Posts: 91
Joined: Wed Jun 18, 2008 2:36 am

Re: compiling cfdg under mac os x

Post by kipling »

Thanks for the reply.

I've got Mac OS X 10.7.4 with XCode 4.3.3, Clang 3.1. I was using Make from the command line.

But now I've actually figured out what I did by redoing what I did with a clean copy of the downloaded source. It was actually me trying to solve two problems (libpng in an unexpected place and trying to disable ffmpeg) and not doing either of them all at once. I attributed my success at getting a build to the last thing I did.

To make it worse I was doing some of the "look here for libpng" by messing with shell variables and some by messing with the variables in the Makefile.

Is it obvious that I don't do this sort of thing that often??

So yes, no panic, I was wrong. The ffmpeg instructions should work perfectly for a system with libpng at /usr/local. 8-/

User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: compiling cfdg under mac os x

Post by MtnViewJohn »

OK. I will update the README to explain what assumptions the makefile makes about libpng.

Post Reply