Search code examples
c++x86-64halide

Problems compiling Halide's camera_pipe application on Mac OS


I'm new to Halide and just successfully compiled Halide from source. I wanted to try out the camera_pipe application from the source code (https://github.com/halide/Halide/tree/master/apps/camera_pipe), but I'm getting the following error, and I'm not sure how to debug / fix it. Thank you in advance for any suggestions or help!

My system is running Mac OS Sierrar (10.12.3)

This is command that the Makefile ran:

c++ -std=c++11 -I ../../include/ -I ../../tools/ -I ../../apps/support/ -g -fno-rtti camera_pipe_generator.cpp ../../lib/libHalide.a ../../tools/GenGen.cpp -o bin/camera_pipe_exec -L/usr/local/lib -ldl -lpthread -lz

And this is the error output that I got:

Undefined symbols for architecture x86_64:
      "_del_curterm", referenced from:
          llvm::sys::Process::FileDescriptorHasColors(int) in libHalide.a(llvm_460_Process.cpp.o)
      "_set_curterm", referenced from:
          llvm::sys::Process::FileDescriptorHasColors(int) in libHalide.a(llvm_460_Process.cpp.o)
      "_setupterm", referenced from:
          llvm::sys::Process::FileDescriptorHasColors(int) in libHalide.a(llvm_460_Process.cpp.o)
      "_tigetnum", referenced from:
          llvm::sys::Process::FileDescriptorHasColors(int) in libHalide.a(llvm_460_Process.cpp.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [bin/camera_pipe_exec] Error 1

Solution

  • Looks like your llvm depends on terminfo, but the camera pipe doesn't link it by default. Try adding a -ltinfo into the makefile along with -lpthread -lz, etc.