Page 1 of 1

compiling cfdg under mac os x

Posted: Mon Dec 17, 2012 5:52 pm
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.

Re: compiling cfdg under mac os x

Posted: Mon Dec 17, 2012 11:31 pm
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?

Re: compiling cfdg under mac os x

Posted: Thu Dec 20, 2012 12:59 am
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-/

Re: compiling cfdg under mac os x

Posted: Thu Dec 20, 2012 7:58 am
by MtnViewJohn
OK. I will update the README to explain what assumptions the makefile makes about libpng.