MakeFile adjustments to build on OS X 10.10.5
In order to build FIAT on OS X 10.10.5 I was unable to use the default MakeFile -- make errors out with:
ld: library not found for -lopencv_gpu
I needed to make adjustments to the Makefile line 17, removing these arguments:
- -lopencv_gpu
- -lopencv_legacy
- -lopencv_ocl
- -lopencv_ts
After that FIAT built with no apparent issues.
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64-apple-darwin14.5.0
I also had to add the --std=c++11 flag to the compiler lines in the Makefile to get round issues with Protobuf compatibility on my Mac. Errors included below to help future searchers :)
g++ -DCAFFE_=1 -o bin/extractRect -I/usr/local/Cellar/opencv/3.4.2/include/opencv src/WorkImage.cpp src/Utils.cpp src/Output.cpp src/extractRect.cpp -L/usr/local/lib -lopencv_calib3d -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -lopencv_imgcodecs -lopencv_videoio -llmdb -lprotobuf -lglog -lgflags -lpthread
In file included from src/Output.cpp:1:
In file included from src/Output.h:16:
In file included from /usr/local/include/google/protobuf/text_format.h:48:
In file included from /usr/local/include/google/protobuf/message.h:119:
/usr/local/include/google/protobuf/message_lite.h:117:3: error: unknown type name 'constexpr'
constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
^
/usr/local/include/google/protobuf/message_lite.h:117:13: error: expected member name or ';' after declaration specifiers
constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
~~~~~~~~~ ^
/usr/local/include/google/protobuf/message_lite.h:110:11: error: use of undeclared identifier 'union_'
new (&union_) T();
^
/usr/local/include/google/protobuf/message_lite.h:114:5: error: use of undeclared identifier 'get_mutable'
get_mutable()->~T();
^
/usr/local/include/google/protobuf/message_lite.h:131:48: error: found '<::' after a template name which forms the digraph '<:'
(aka '[') and a ':', did you mean '< ::'?
LIBPROTOBUF_EXPORT extern ExplicitlyConstructed<::std::string> fixed_address_empty_string;
^
/usr/local/include/google/protobuf/message_lite.h:137:37: error: no member named 'get' in
'google::protobuf::internal::ExplicitlyConstructed<std::__1::basic_string<char> >'
return fixed_address_empty_string.get();
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
In file included from src/Output.cpp:1:
In file included from src/Output.h:16:
In file included from /usr/local/include/google/protobuf/text_format.h:47:
In file included from /usr/local/include/google/protobuf/descriptor.h:63:
/usr/local/include/google/protobuf/stubs/once.h:106:3: error: no matching function for call to 'call_once'
std::call_once(*once, init_func, arg);
^~~~~~~~~~~~~~
/usr/local/include/google/protobuf/stubs/once.h:117:5: note: in instantiation of function template specialization
'google::protobuf::GoogleOnceInitArg<const google::protobuf::FieldDescriptor>' requested here
GoogleOnceInitArg<T>(&this->state_, func_with_arg, arg);
^
/usr/local/include/google/protobuf/descriptor.h:2003:17: note: in instantiation of function template specialization
'google::protobuf::GoogleOnceDynamic::Init<const google::protobuf::FieldDescriptor>' requested here
type_once_->Init(&FieldDescriptor::TypeOnceInit, this);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/mutex:675:1: note: candidate function template not
viable: requires 2 arguments, but 3 were provided
call_once(once_flag& __flag, _Callable& __func)
+ Makefile
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/mutex:687:1: note: candidate function template not
viable: requires 2 arguments, but 3 were provided
call_once(once_flag& __flag, const _Callable& __func)
^
7 errors generated.
In file included from src/extractRect.cpp:3:
In file included from src/Output.h:16:
In file included from /usr/local/include/google/protobuf/text_format.h:48:
In file included from /usr/local/include/google/protobuf/message.h:119:
/usr/local/include/google/protobuf/message_lite.h:117:3: error: unknown type name 'constexpr'
constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
^
/usr/local/include/google/protobuf/message_lite.h:117:13: error: expected member name or ';' after declaration specifiers
constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
~~~~~~~~~ ^
/usr/local/include/google/protobuf/message_lite.h:110:11: error: use of undeclared identifier 'union_'
new (&union_) T();
^
/usr/local/include/google/protobuf/message_lite.h:114:5: error: use of undeclared identifier 'get_mutable'
get_mutable()->~T();
^
/usr/local/include/google/protobuf/message_lite.h:131:48: error: found '<::' after a template name which forms the digraph '<:'
(aka '[') and a ':', did you mean '< ::'?
LIBPROTOBUF_EXPORT extern ExplicitlyConstructed<::std::string> fixed_address_empty_string;
^
/usr/local/include/google/protobuf/message_lite.h:137:37: error: no member named 'get' in
'google::protobuf::internal::ExplicitlyConstructed<std::__1::basic_string<char> >'
return fixed_address_empty_string.get();
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
In file included from src/extractRect.cpp:3:
In file included from src/Output.h:16:
In file included from /usr/local/include/google/protobuf/text_format.h:47:
In file included from /usr/local/include/google/protobuf/descriptor.h:63:
/usr/local/include/google/protobuf/stubs/once.h:106:3: error: no matching function for call to 'call_once'
std::call_once(*once, init_func, arg);
^~~~~~~~~~~~~~
/usr/local/include/google/protobuf/stubs/once.h:117:5: note: in instantiation of function template specialization
'google::protobuf::GoogleOnceInitArg<const google::protobuf::FieldDescriptor>' requested here
GoogleOnceInitArg<T>(&this->state_, func_with_arg, arg);
^
/usr/local/include/google/protobuf/descriptor.h:2003:17: note: in instantiation of function template specialization
'google::protobuf::GoogleOnceDynamic::Init<const google::protobuf::FieldDescriptor>' requested here
type_once_->Init(&FieldDescriptor::TypeOnceInit, this);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/mutex:675:1: note: candidate function template not
viable: requires 2 arguments, but 3 were provided
call_once(once_flag& __flag, _Callable& __func)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/mutex:687:1: note: candidate function template not
viable: requires 2 arguments, but 3 were provided
call_once(once_flag& __flag, const _Callable& __func)
^
7 errors generated.
make: *** [all] Error 1
Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.5.0 Thread model: posix