1

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
3
  • Where did ../../lib/libHalide.a come from? Did you build it, too? With the same toolchain? Mar 16, 2017 at 20:27
  • I think I built it when I ran "make" from the halide directory (github.com/halide/Halide), and it did compile without errors there. And I think it was with the same toolchain. Mar 16, 2017 at 20:35
  • Update: I re-ran "make-clean" and "make", so I'm certain it is with the same toolchain now. However, I am still getting that same error. Thank you for the suggestion. Mar 16, 2017 at 20:46

1 Answer 1

0

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.

4
  • Thank you, I don't have tinfo installed and I'm not sure where to get it, but I tried replacing it with -lcurses, and got the following error instead: ld: file too small (length=0) file 'bin/Demosaic.o' for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Mar 16, 2017 at 22:14
  • This is the current Makefile command: c++ -std=c++11 -I ../../include/ -I ../../tools/ -I ../../apps/support/ -Wall -O3 -I./bin process.cpp bin/camera_pipe.a bin/Demosaic.o bin/Demosaic_ARM.o -o bin/process -L/usr/local/Cellar/libpng/1.6.28/lib -lpng16 -ljpeg -I/usr/local/Cellar/libpng/1.6.28/include/libpng16 -I/usr/local/Cellar/libpng/1.6.28/include/libpng16/.. -lcurses -L/usr/local/lib -ldl -lpthread -lz Mar 16, 2017 at 22:15
  • Sorry, but is there something I could do to fix that error? Mar 17, 2017 at 20:44
  • Never mind, I did a "make clean" and then "make" and that fixed it! Thank you! Mar 17, 2017 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.