imdadable
imdadable

Reputation: 147

Error compiling x264 on Mac OS X

I'm trying to compile and install the x264 H.264/AVC encoder. I've got gcc installed. But I get the 'No working C compiler found' error when I run:

./configure --enable-shared --enable-static

What can I do?

The config log said:

/bin/gcc conftest.c  -Wall -I. -I$(SRCPATH) -falign-loops=16 -mdynamic-no-pic -o conftest
clang: error: unknown argument: '-falign-loops=16' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

Upvotes: 4

Views: 3914

Answers (2)

notnot
notnot

Reputation: 31

I encountered the same error and found a simple solution here: http://www.xin.at/x264/x264-guide-macosx-en.htm

Before actually being able to start the build we will however need to remove a GCC compiler flag from the configure script, that the newer LLVM+CLANG compiler will not be able to handle. For that, please open the file configure in your favorite text editor and look for the following spot:

darwin*) SYS="MACOSX" CFLAGS="$CFLAGS -falign-loops=16"

Replace that with the following, effectively removing the -falign-loops=16 option:

darwin*) SYS="MACOSX" CFLAGS="$CFLAGS"

After doing the above, libx264 builds just fine :)

Upvotes: 3

Jonathan Leffler
Jonathan Leffler

Reputation: 753675

The configure script is trying to set a compiler option -falign-loops=16 that the clang compiler (masquerading as gcc) declines to accept.

Either get (compile) your own real GCC and use that (I've done the compilation and installation; it's not very hard, though neither is it trivial), or work out how to stop the configure script from failing simply because it assumes that the -falign-loops=16 option must be supported by all versions of GCC. That is the sort of thing the configure script should be checking so that you don't run into that sort of failure. Ultimately, this is a bug in the configuration for this code.

Upvotes: 0

Related Questions