Build error in build with GO_TAGS=stablediffusion
LocalAI version:
commit f505d7ab3f4dabf927413d42691adb37bd46f131 (HEAD -> master, origin/master, origin/HEAD) Environment, CPU architecture, OS, and Version:
Darwin Samarths-MacBook-Pro-495.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 Describe the bug
I tried building locally using the command
make GO_TAGS=stablediffusion build
on MacBook M1 Pro I followed the setup guide on the website and was able to build and use without errors using:
make build
To Reproduce
On Mac M1 Pro using the series of commands:
brew install abseil cmake go grpc protobuf wget protoc-gen-go protoc-gen-go-grpc
git clone https://github.com/go-skynet/LocalAI.git
cd LocalAI
make build
# worked fine till now and able to use the build
make GO_TAGS=stablediffusion build
# gives error
Expected behavior
Logs
Error logs
In file included from /opt/homebrew/include/absl/strings/string_view.h:39:
In file included from /opt/homebrew/include/absl/base/attributes.h:37:
In file included from /opt/homebrew/include/absl/base/config.h:92:
/opt/homebrew/include/absl/base/policy_checks.h:79:2: error: "C++ versions less than C++14 are not supported."
#error "C++ versions less than C++14 are not supported."
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:108:
In file included from /opt/homebrew/include/google/protobuf/stubs/common.h:21:
In file included from /opt/homebrew/include/absl/strings/string_view.h:40:
In file included from /opt/homebrew/include/absl/base/nullability.h:153:
/opt/homebrew/include/absl/base/internal/nullability_impl.h:40:16: warning: variable templates are a C++14 extension [-Wc++14-extensions]
constexpr bool IsSupportedType = IsNullabilityCompatible<T>::value;
^
/opt/homebrew/include/absl/base/internal/nullability_impl.h:56:55: error: no template named 'remove_cv_t' in namespace 'std'; did you mean simply 'remove_cv_t'?
static_assert(nullability_internal::IsSupportedType<std::remove_cv_t<T>>,
^~~~~~~~~~~~~~~~
remove_cv_t
/opt/homebrew/include/absl/meta/type_traits.h:238:1: note: 'remove_cv_t' declared here
using remove_cv_t = typename std::remove_cv<T>::type;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:108:
In file included from /opt/homebrew/include/google/protobuf/stubs/common.h:21:
In file included from /opt/homebrew/include/absl/strings/string_view.h:40:
In file included from /opt/homebrew/include/absl/base/nullability.h:153:
/opt/homebrew/include/absl/base/internal/nullability_impl.h:64:55: error: no template named 'remove_cv_t' in namespace 'std'; did you mean simply 'remove_cv_t'?
static_assert(nullability_internal::IsSupportedType<std::remove_cv_t<T>>,
^~~~~~~~~~~~~~~~
remove_cv_t
/opt/homebrew/include/absl/meta/type_traits.h:238:1: note: 'remove_cv_t' declared here
using remove_cv_t = typename std::remove_cv<T>::type;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:108:
In file included from /opt/homebrew/include/google/protobuf/stubs/common.h:21:
In file included from /opt/homebrew/include/absl/strings/string_view.h:40:
In file included from /opt/homebrew/include/absl/base/nullability.h:153:
/opt/homebrew/include/absl/base/internal/nullability_impl.h:72:55: error: no template named 'remove_cv_t' in namespace 'std'; did you mean simply 'remove_cv_t'?
static_assert(nullability_internal::IsSupportedType<std::remove_cv_t<T>>,
^~~~~~~~~~~~~~~~
remove_cv_t
/opt/homebrew/include/absl/meta/type_traits.h:238:1: note: 'remove_cv_t' declared here
using remove_cv_t = typename std::remove_cv<T>::type;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:108:
In file included from /opt/homebrew/include/google/protobuf/stubs/common.h:23:
In file included from /opt/homebrew/include/google/protobuf/stubs/port.h:22:
/opt/homebrew/include/google/protobuf/port_def.inc:139:1: error: static assertion failed due to requirement '201103L >= 201402L': Protobuf only supports C++14 and newer.
static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:108:
In file included from /opt/homebrew/include/google/protobuf/stubs/common.h:35:
/opt/homebrew/include/google/protobuf/port_def.inc:139:1: error: static assertion failed due to requirement '201103L >= 201402L': Protobuf only supports C++14 and newer.
static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:110:
In file included from /opt/homebrew/include/absl/log/absl_check.h:38:
In file included from /opt/homebrew/include/absl/log/internal/check_impl.h:19:
In file included from /opt/homebrew/include/absl/log/internal/check_op.h:36:
In file included from /opt/homebrew/include/absl/log/internal/nullstream.h:36:
/opt/homebrew/include/absl/base/log_severity.h:102:3: warning: use of this statement in a constexpr function is a C++14 extension [-Wc++14-extensions]
switch (s) {
^
/opt/homebrew/include/absl/base/log_severity.h:108:3: warning: multiple return statements in constexpr function is a C++14 extension [-Wc++14-extensions]
return "UNKNOWN";
^
/opt/homebrew/include/absl/base/log_severity.h:103:36: note: previous return statement is here
case absl::LogSeverity::kInfo: return "INFO";
^
/opt/homebrew/include/absl/base/log_severity.h:104:39: note: previous return statement is here
case absl::LogSeverity::kWarning: return "WARNING";
^
/opt/homebrew/include/absl/base/log_severity.h:105:37: note: previous return statement is here
case absl::LogSeverity::kError: return "ERROR";
^
/opt/homebrew/include/absl/base/log_severity.h:106:37: note: previous return statement is here
case absl::LogSeverity::kFatal: return "FATAL";
^
/opt/homebrew/include/absl/base/log_severity.h:116:21: warning: variable declaration in a constexpr function is a C++14 extension [-Wc++14-extensions]
absl::LogSeverity n = s;
^
/opt/homebrew/include/absl/base/log_severity.h:117:3: warning: use of this statement in a constexpr function is a C++14 extension [-Wc++14-extensions]
if (n < absl::LogSeverity::kInfo) n = absl::LogSeverity::kInfo;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:110:
In file included from /opt/homebrew/include/absl/log/absl_check.h:38:
In file included from /opt/homebrew/include/absl/log/internal/check_impl.h:19:
In file included from /opt/homebrew/include/absl/log/internal/check_op.h:37:
In file included from /opt/homebrew/include/absl/log/internal/strip.h:24:
In file included from /opt/homebrew/include/absl/log/internal/log_message.h:41:
In file included from /opt/homebrew/include/absl/log/log_entry.h:35:
/opt/homebrew/include/absl/time/time.h:278:22: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
constexpr HiRep& operator=(const int64_t value) {
^
const
/opt/homebrew/include/absl/time/time.h:255:7: warning: use of this statement in a constexpr constructor is a C++14 extension [-Wc++14-extensions]
*this = value;
^
/opt/homebrew/include/absl/time/time.h:259:22: warning: variable declaration in a constexpr function is a C++14 extension [-Wc++14-extensions]
const uint64_t unsigned_value =
^
/opt/homebrew/include/absl/time/time.h:284:11: error: cannot assign to non-static data member within const member function 'operator='
hi_ = static_cast<uint32_t>(unsigned_value >> 32);
~~~ ^
/opt/homebrew/include/absl/time/time.h:278:22: note: member function 'absl::Duration::HiRep::operator=' is declared const here
constexpr HiRep& operator=(const int64_t value) {
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/absl/time/time.h:285:11: error: cannot assign to non-static data member within const member function 'operator='
lo_ = static_cast<uint32_t>(unsigned_value);
~~~ ^
/opt/homebrew/include/absl/time/time.h:278:22: note: member function 'absl::Duration::HiRep::operator=' is declared const here
constexpr HiRep& operator=(const int64_t value) {
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/absl/time/time.h:286:14: error: binding reference of type 'HiRep' to value of type 'const absl::Duration::HiRep' drops 'const' qualifier
return *this;
^~~~~
/opt/homebrew/include/absl/time/time.h:283:18: warning: variable declaration in a constexpr function is a C++14 extension [-Wc++14-extensions]
const auto unsigned_value = static_cast<uint64_t>(value);
^
/opt/homebrew/include/absl/time/time.h:284:7: warning: use of this statement in a constexpr function is a C++14 extension [-Wc++14-extensions]
hi_ = static_cast<uint32_t>(unsigned_value >> 32);
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:110:
In file included from /opt/homebrew/include/absl/log/absl_check.h:38:
In file included from /opt/homebrew/include/absl/log/internal/check_impl.h:19:
In file included from /opt/homebrew/include/absl/log/internal/check_op.h:37:
In file included from /opt/homebrew/include/absl/log/internal/strip.h:24:
In file included from /opt/homebrew/include/absl/log/internal/log_message.h:41:
In file included from /opt/homebrew/include/absl/log/log_entry.h:36:
In file included from /opt/homebrew/include/absl/types/span.h:70:
/opt/homebrew/include/absl/types/internal/span.h:119:21: error: no template named 'remove_const_t' in namespace 'std'; did you mean simply 'remove_const_t'?
using Container = std::remove_const_t<T>;
^~~~~~~~~~~~~~~~~~~
remove_const_t
/opt/homebrew/include/absl/meta/type_traits.h:241:1: note: 'remove_const_t' declared here
using remove_const_t = typename std::remove_const<T>::type;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:110:
In file included from /opt/homebrew/include/absl/log/absl_check.h:38:
In file included from /opt/homebrew/include/absl/log/internal/check_impl.h:19:
In file included from /opt/homebrew/include/absl/log/internal/check_op.h:37:
In file included from /opt/homebrew/include/absl/log/internal/strip.h:24:
In file included from /opt/homebrew/include/absl/log/internal/log_message.h:41:
In file included from /opt/homebrew/include/absl/log/log_entry.h:36:
In file included from /opt/homebrew/include/absl/types/span.h:70:
/opt/homebrew/include/absl/types/internal/span.h:130:24: error: no template named 'enable_if_t' in namespace 'std'; did you mean simply 'enable_if_t'?
using EnableIfIsView = std::enable_if_t<IsView<T>::value, int>;
^~~~~~~~~~~~~~~~
enable_if_t
/opt/homebrew/include/absl/meta/type_traits.h:307:1: note: 'enable_if_t' declared here
using enable_if_t = typename std::enable_if<B, T>::type;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:110:
In file included from /opt/homebrew/include/absl/log/absl_check.h:38:
In file included from /opt/homebrew/include/absl/log/internal/check_impl.h:19:
In file included from /opt/homebrew/include/absl/log/internal/check_op.h:37:
In file included from /opt/homebrew/include/absl/log/internal/strip.h:24:
In file included from /opt/homebrew/include/absl/log/internal/log_message.h:41:
In file included from /opt/homebrew/include/absl/log/log_entry.h:36:
In file included from /opt/homebrew/include/absl/types/span.h:70:
/opt/homebrew/include/absl/types/internal/span.h:133:27: error: no template named 'enable_if_t' in namespace 'std'; did you mean simply 'enable_if_t'?
using EnableIfNotIsView = std::enable_if_t<!IsView<T>::value, int>;
^~~~~~~~~~~~~~~~
enable_if_t
/opt/homebrew/include/absl/meta/type_traits.h:307:1: note: 'enable_if_t' declared here
using enable_if_t = typename std::enable_if<B, T>::type;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:110:
In file included from /opt/homebrew/include/absl/log/absl_check.h:38:
In file included from /opt/homebrew/include/absl/log/internal/check_impl.h:19:
In file included from /opt/homebrew/include/absl/log/internal/check_op.h:37:
In file included from /opt/homebrew/include/absl/log/internal/strip.h:24:
In file included from /opt/homebrew/include/absl/log/internal/log_message.h:43:
/opt/homebrew/include/absl/strings/has_absl_stringify.h:56:8: error: no template named 'enable_if_t' in namespace 'std'; did you mean simply 'enable_if_t'?
T, std::enable_if_t<std::is_void<decltype(AbslStringify(
^~~~~~~~~~~~~~~~
enable_if_t
/opt/homebrew/include/absl/meta/type_traits.h:307:1: note: 'enable_if_t' declared here
using enable_if_t = typename std::enable_if<B, T>::type;
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:112:
In file included from /opt/homebrew/include/absl/strings/cord.h:79:
In file included from /opt/homebrew/include/absl/container/inlined_vector.h:53:
In file included from /opt/homebrew/include/absl/container/internal/inlined_vector.h:31:
In file included from /opt/homebrew/include/absl/container/internal/compressed_tuple.h:40:
/opt/homebrew/include/absl/utility/utility.h:54:12: error: no member named 'index_sequence' in namespace 'std'
using std::index_sequence;
~~~~~^
/opt/homebrew/include/absl/utility/utility.h:55:12: error: no member named 'index_sequence_for' in namespace 'std'
using std::index_sequence_for;
~~~~~^
/opt/homebrew/include/absl/utility/utility.h:56:12: error: no member named 'integer_sequence' in namespace 'std'; did you mean '__integer_sequence'?
using std::integer_sequence;
~~~~~^~~~~~~~~~~~~~~~
__integer_sequence
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__utility/integer_sequence.h:25:8: note: '__integer_sequence' declared here
struct __integer_sequence {
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:112:
In file included from /opt/homebrew/include/absl/strings/cord.h:79:
In file included from /opt/homebrew/include/absl/container/inlined_vector.h:53:
In file included from /opt/homebrew/include/absl/container/internal/inlined_vector.h:31:
In file included from /opt/homebrew/include/absl/container/internal/compressed_tuple.h:40:
/opt/homebrew/include/absl/utility/utility.h:57:12: error: no member named 'make_index_sequence' in namespace 'std'
using std::make_index_sequence;
~~~~~^
/opt/homebrew/include/absl/utility/utility.h:58:12: error: no member named 'make_integer_sequence' in namespace 'std'; did you mean '__integer_sequence'?
using std::make_integer_sequence;
~~~~~^~~~~~~~~~~~~~~~~~~~~
__integer_sequence
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__utility/integer_sequence.h:25:8: note: '__integer_sequence' declared here
struct __integer_sequence {
^
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/tools/caffe/caffe2ncnn.cpp:19:
In file included from /Users/samarthpusalkar/Desktop/LocalAI/sources/go-stable-diffusion/ncnn/build/tools/caffe/caffe.pb.h:20:
In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:112:
In file included from /opt/homebrew/include/absl/strings/cord.h:79:
In file included from /opt/homebrew/include/absl/container/inlined_vector.h:53:
In file included from /opt/homebrew/include/absl/container/internal/inlined_vector.h:31:
In file included from /opt/homebrew/include/absl/container/internal/compressed_tuple.h:40:
/opt/homebrew/include/absl/utility/utility.h:82:12: error: no member named 'in_place_t' in namespace 'std'
using std::in_place_t;
~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
10 warnings and 20 errors generated.
make[4]: *** [tools/caffe/CMakeFiles/caffe2ncnn.dir/caffe2ncnn.cpp.o] Error 1
make[3]: *** [tools/caffe/CMakeFiles/caffe2ncnn.dir/all] Error 2
make[2]: *** [all] Error 2
make[1]: *** [ncnn/build/src/libncnn.a] Error 2
make: *** [sources/go-stable-diffusion/libstablediffusion.a] Error 2
` Additional context
Yes, I confirm that with GO_TAGS=stablediffusion not works. Well, following build instructions from website. Also, is necessary opencv lib and ncnn. But some errors on building. Machine: Apple Macbook Pro Intel 2019 16"
same issue here
same here
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.