servo: Unable to build on Mac because the build can't find libavformat/avformat.h

I tried following the directions at https://github.com/servo/servo/blob/master/README.md to compile Servo on mac. The build dies, like so:

 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.10.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name vmrs.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 253.9 -v -gdwarf-2 -dwarf-column-info -ffunction-sections -fdata-sections -coverage-file /Users/bzbarsky/mozilla/servo/target/debug/build/video-metadata-68095025ad9189db/out/ffi/vmrs.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2 -O0 -fdebug-compilation-dir /Users/bzbarsky/mozilla/servo/.cargo/git/checkouts/video-metadata-rs-58c16900f00fb0a1/master -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.10.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -o /Users/bzbarsky/mozilla/servo/target/debug/build/video-metadata-68095025ad9189db/out/ffi/vmrs.o -x c ffi/vmrs.c
clang -cc1 version 7.0.2 based upon LLVM 3.7.0svn default target x86_64-apple-darwin14.5.0
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
In file included from ffi/vmrs.c:1:
ffi/vmrs.h:4:10: fatal error: 'libavformat/avformat.h' file not found
#include <libavformat/avformat.h>
         ^

I tried port install ffmpeg and port install ffmpeg-devel, both of which install the relevant header, but both put it in /opt/local/include/libavformat/avformat.h and the above header search path does not contain /opt/local/include. Note the ignoring nonexistent directory "/usr/local/include" bit, in case it matters.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 18 (14 by maintainers)

Most upvoted comments

That’s really weird, because on my mac (10.11) and our builders (10.10), the files are in /usr/local/include/libavformat. The error that seems to generate this condition is that /usr/local gets set to no longer have read permission for the user (literally, goofball d-wx--x--x) permissions.