Error running '__rvm_make -j8' in macos Monterey - ruby

I'm trying to install ruby 2.7.0 using RVM on MacOS(12.4: apple M2), but i'm getting below error and not able to install required ruby version. I have tried all the solutions available on internet related to openssl but nothing works for me and tried with rbenv also but no luck. Please help me, thank you in advance.
Current version: OpenSSL 1.1.1s 1 Nov 2022
+__rvm_make:0> make -j8
BASERUBY = /usr/bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -ggdb3 -Wno-error=implicit-function-declaration -std=gnu99 -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/-darwin21 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl#1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -Wl,-multiply_defined,suppress -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl#1.1/lib -install_name /Users/rashmib/.rvm/rubies/ruby-2.7.0/lib/libruby.2.7.dylib -compatibility_version 2.7 -current_version 2.7.0 -fstack-protector-strong -framework Security -framework Foundation -fstack-protector-strong -framework Security -framework Foundation
SOLIBS = -lpthread -ldl -lobjc
LANG =
LC_ALL =
LC_CTYPE = UTF-8
MFLAGS = - --jobserver-fds=4,5 -j
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
translating probes probes.d
compiling bignum.c
compiling class.c
compiling ast.c
. ./vm_opts.h
compiling compar.c
compiling compile.c
compiling complex.c
compiling cont.c
bignum.c:6127:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
bignum.c:6127:33: note: '{' token is here
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
{ \
^
bignum.c:6127:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
}
^
bignum.c:6127:33: note: ')' token is here
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
class.c:541:13: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]

After trying lot of suggestions, following these steps worked for me
MAC ports installation
https://trac.macports.org/wiki/Migration
Run
rvm install 2.7.0 --with-out-ext=fiddle

Related

Makefile and run on Mac M1 chip?

Is there any way to compile and run this on Mac M1 chip? I have xcode installed and all other c and c++ libraries. I try with UTM/ubunto also dodnt work.
default:
g++ -O3 -c oldbloom/bloom.cpp -o oldbloom.o
g++ -O3 -c bloom/bloom.cpp -o bloom.o
# g++ -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
g++ -O3 -c sha3/sha3.c -o sha3.o
g++ -O3 -c sha3/keccak.c -o keccak.o
gcc -O3 -c xxhash/xxhash.c -o xxhash.o
g++ -O3 -c util.c -o util.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Int.cpp -o Int.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Point.cpp -o Point.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/SECP256K1.cpp -o SECP256K1.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/IntMod.cpp -o IntMod.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Random.cpp -o Random.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/IntGroup.cpp -o IntGroup.o
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/ripemd160.o -c hash/ripemd160.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/sha256.o -c hash/sha256.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/ripemd160_sse.o -c hash/ripemd160_sse.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/sha256_sse.o -c hash/sha256_sse.cpp
g++ -o keyhunt keyhunt.cpp base58.o rmd160.o hash/ripemd160.o hash/ripemd160_sse.o hash/sha256.o hash/sha256_sse.o bloom.o oldbloom.o xxhash.o util.o Int.o Point.o SECP256K1.o IntMod.o Random.o IntGroup.o sha3.o keccak.o -lm -lpthread
rm -r *.o
clean:
rm keyhunt
I get all this errors when i try to compile it on Mac M1:
In file included from secp256k1/Int.cpp:18:
secp256k1/Int.h:204:27: error: invalid output constraint '=d' in asm
__asm__( "mulq %[b];" :"=d"(rhi),"=a"(rlo) :"1"(a),[b]"rm"(b));
^
secp256k1/Int.h:211:43: error: invalid output constraint '=D' in asm
__asm__ ("movq %1,%0;shrdq %3,%2,%0;" : "=D"(c) : "r"(a),"r"(b),"c"(n));
^
secp256k1/Int.h:218:43: error: invalid output constraint '=D' in asm
__asm__ ("movq %1,%0;shldq %3,%2,%0;" : "=D"(c) : "r"(b),"r"(a),"c"(n));
^
secp256k1/Int.h:234:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[1], y, &h), carry, dst + 1); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:235:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[2], y, &h), carry, dst + 2); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:236:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[3], y, &h), carry, dst + 3); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:237:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[4], y, &h), carry, dst + 4); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:253:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[1], y, &h), carry, dst + 1); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:254:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[2], y, &h), carry, dst + 2); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:255:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[3], y, &h), carry, dst + 3); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:262:3: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
_addcarry_u64(c, 0ULL, carry, dst + (NB64BLOCK - 1));
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
In file included from secp256k1/Int.cpp:24:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
In file included from secp256k1/Int.cpp:24:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/xmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
In file included from secp256k1/Int.cpp:24:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:17:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/xmmintrin.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
__builtin_ia32_emms();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:5: note: '__builtin_isless' declared here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:25: error: too few arguments to function call, expected 2, have 0
__builtin_ia32_emms();
~~~~~~~~~~~~~~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:54:19: error: use of undeclared identifier '__builtin_ia32_vec_init_v2si'
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:71:12: error: use of undeclared identifier '__builtin_ia32_vec_ext_v2si'
return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:133:19: error: use of undeclared identifier '__builtin_ia32_packsswb'
return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
My question is, is it needed to change Makefile only or the whole script, to work on M1 chip?
Thanks in advance!

Unable to install fasttext through terminal using make

I am working on Ubuntu 16.04 and am trying to install fasttext through terminal using the following commands (from their website):
$ wget https://github.com/facebookresearch/fastText/archive/v0.2.0.zip
$ unzip v0.2.0.zip
$ cd fastText-0.2.0
$ make
But I am getting the following error when I try to make it:
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/args.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/dictionary.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/productquantizer.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/matrix.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/qmatrix.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/vector.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/model.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/utils.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/meter.cc
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/fasttext.cc
src/fasttext.cc: In member function ‘void fasttext::FastText::quantize(const fasttext::Args&)’:
src/fasttext.cc:302:16: warning: ‘std::vector<int> fasttext::FastText::selectEmbeddings(int32_t) const’ is deprecated: selectEmbeddings is being deprecated. [-Wdeprecated-declarations]
auto idx = selectEmbeddings(qargs.cutoff);
^
src/fasttext.cc:279:22: note: declared here
std::vector<int32_t> FastText::selectEmbeddings(int32_t cutoff) const {
^
src/fasttext.cc:302:45: warning: ‘std::vector<int> fasttext::FastText::selectEmbeddings(int32_t) const’ is deprecated: selectEmbeddings is being deprecated. [-Wdeprecated-declarations]
auto idx = selectEmbeddings(qargs.cutoff);
^
src/fasttext.cc:279:22: note: declared here
std::vector<int32_t> FastText::selectEmbeddings(int32_t cutoff) const {
^
src/fasttext.cc: In member function ‘void fasttext::FastText::lazyComputeWordVectors()’:
src/fasttext.cc:531:5: warning: ‘void fasttext::FastText::precomputeWordVectors(fasttext::Matrix&)’ is deprecated: precomputeWordVectors is being deprecated. [-Wdeprecated-declarations]
precomputeWordVectors(*wordVectors_);
^
src/fasttext.cc:514:6: note: declared here
void FastText::precomputeWordVectors(Matrix& wordVectors) {
^
src/fasttext.cc:531:40: warning: ‘void fasttext::FastText::precomputeWordVectors(fasttext::Matrix&)’ is deprecated: precomputeWordVectors is being deprecated. [-Wdeprecated-declarations]
precomputeWordVectors(*wordVectors_);
^
src/fasttext.cc:514:6: note: declared here
void FastText::precomputeWordVectors(Matrix& wordVectors) {
^
src/fasttext.cc: In member function ‘void fasttext::FastText::trainThread(int32_t)’:
src/fasttext.cc:650:7: warning: ‘void fasttext::FastText::supervised(fasttext::Model&, fasttext::real, const std::vector<int>&, const std::vector<int>&)’ is deprecated: supervised is being deprecated. [-Wdeprecated-declarations]
supervised(model, lr, line, labels);
^
src/fasttext.cc:338:6: note: declared here
void FastText::supervised(
^
src/fasttext.cc:650:41: warning: ‘void fasttext::FastText::supervised(fasttext::Model&, fasttext::real, const std::vector<int>&, const std::vector<int>&)’ is deprecated: supervised is being deprecated. [-Wdeprecated-declarations]
supervised(model, lr, line, labels);
^
src/fasttext.cc:338:6: note: declared here
void FastText::supervised(
^
src/fasttext.cc:653:7: warning: ‘void fasttext::FastText::cbow(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: cbow is being deprecated. [-Wdeprecated-declarations]
cbow(model, lr, line);
^
src/fasttext.cc:355:6: note: declared here
void FastText::cbow(Model& model, real lr, const std::vector<int32_t>& line) {
^
src/fasttext.cc:653:27: warning: ‘void fasttext::FastText::cbow(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: cbow is being deprecated. [-Wdeprecated-declarations]
cbow(model, lr, line);
^
src/fasttext.cc:355:6: note: declared here
void FastText::cbow(Model& model, real lr, const std::vector<int32_t>& line) {
^
src/fasttext.cc:656:7: warning: ‘void fasttext::FastText::skipgram(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: skipgram is being deprecated. [-Wdeprecated-declarations]
skipgram(model, lr, line);
^
src/fasttext.cc:371:6: note: declared here
void FastText::skipgram(
^
src/fasttext.cc:656:31: warning: ‘void fasttext::FastText::skipgram(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: skipgram is being deprecated. [-Wdeprecated-declarations]
skipgram(model, lr, line);
^
src/fasttext.cc:371:6: note: declared here
void FastText::skipgram(
^
c++ -pthread -std=c++0x -march=native -O3 -funroll-loops args.o dictionary.o productquantizer.o matrix.o qmatrix.o vector.o model.o utils.o meter.o fasttext.o src/main.cc -o fasttext
I don't know what is causing the error. As far as I have figure, these are depreciation warnings and make is treating them errors. Is there anyway to suppress this behaviour of make?
Or is there any other way to install fasttext?
I read from somewhere and tried make -i but it is also giving the same error.
Thanks in advance!
I had the same issue in version v0.9.1. They are just warnings. My binary still compiled with just the warnings.
./fasttext

Build Tensorflow on RPi3 with Bazel: C++ compilation of rule '#boringssl//:crypto' failed

Trying to run tensorflow on Raspberry PI 3B.
Following the Guide on: https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/GUIDE.md#3-build-bazel
Everything goes fine until the following step:
pi#raspberrypi:~/tf/tensorflow $ bazel build -c opt --jobs 1 --copt="-mfpu=neon-vfpv4" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package
gcc is 4.8,
bazel is 5.4
Raspbian 9 (Stretch)
ERROR:
/home/pi/.cache/bazel/_bazel_pi/477..6d/external/boringssl/BUILD:115:1:
C++ compilation of rule '#boringssl//:crypto' failed (Exit 1): gcc
failed: error executing command
Here is what follows after the error-message:
(cd /home/pi/.cache/bazel/_bazel_pi/477..6d/execroot/org_tensorflow && \
exec env - \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games \
PWD=/proc/self/cwd \
PYTHON_BIN_PATH=/usr/bin/python \
PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \
TF_NEED_CUDA=0 \
TF_NEED_OPENCL=0 \
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 ' -D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-
sections -fdata-sections '-mfpu=neon-vfpv4' -funsafe-math-optimizations -ftree-vectorize -fomit-frame-pointer -MD -MF bazel-out/local-opt/bin/external/boringssl/_objs/crypto/external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.pic.d -fPIC -iquote external/boringssl -iquote bazel-out/local-opt/genfiles/external/boringssl -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -isystem external/boringssl/src/include -isystem bazel-out/local-opt/genfiles/external/boringssl/src/include -isystem external/bazel_tools/tools/cpp/gcc3 -DOPENSSL_NO_ASM -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c -o bazel-out/local-opt/bin/external/boringssl/_objs/crypto/external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.pic.o).
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c: In function 'gcm_siv_crypt':
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:616:3:
error: 'for' loop initial declarations are only allowed in C99 mode
for (size_t done = 0; done < in_len;) {
^
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:616:3: note: use option -std=c99 or -std=gnu99 to compile your code
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:626:5:
error: 'for' loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i < todo; i++) {
^
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c: In function 'gcm_siv_polyval':
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:673:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i < EVP_AEAD_AES_GCM_SIV_NONCE_LEN; i++) {
^
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c: In function 'gcm_siv_keys':
external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:703:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i < blocks_needed; i++) {
^
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 69.995s, Critical Path: 1.36s
Found several different issues for this but nothing worked so far.
I think it could be the gcc version.

Error message during g++ compiling an installation file

The environments are Cent OS 6.7, boost-1.6.2, gcc-6.2.0
I have tried to install a software, but I got some errors.
Are theses errors come from g++ ? or boost?
I can't understand these messages.. because I have never been use g++..
Here is starting line.
[root#cms CASMcode-0.2.0]# scons install
scons: Reading SConscript files ...
rm /usr/local/include/casm
scons: done reading SConscript files.
scons: Building targets ...
Install directory: "include/casm" as "/usr/local/include/casm"
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/version/version.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude src/casm/version/version.cc
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/clex/ConfigIOStrucScore.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude -I/usr/local/boost_1_62_0/include src/casm/clex/ConfigIOStrucScore.cc
In file included from include/casm/external/Eigen/Core:263:0,
from include/casm/external/Eigen/Dense:1,
from include/casm/CASM_global_definitions.hh:13,
from include/casm/casm_io/EigenDataStream.hh:3,
from src/casm/clex/ConfigIOStrucScore.cc:3:
Error message appear here.
In file included from include/casm/casm_io/DataFormatterTools.hh:1291:0,
from include/casm/casm_io/DataFormatter_impl.hh:3,
from include/casm/casm_io/DataFormatter.hh:757,
from include/casm/clex/ConfigIO.hh:4,
from src/casm/clex/ConfigIOStrucScore.cc:6:
include/casm/casm_io/DataFormatterTools_impl.hh: In member function 'bool CASM::DataFormatterOperator<ValueType, ArgType, DataObject>::parse_args(const string&)':
include/casm/casm_io/DataFormatterTools_impl.hh:33:33: error: invalid initialization of reference of type 'const wstring& {aka const std::__cxx11::basic_string<wchar_t>&}' from expression of type 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
val = std::stod(ttag);
^
And here
In file included from include/casm/clex/PrimClex.hh:14:0,
from include/casm/clex/ConfigIOStrucScore.hh:6,
from src/casm/clex/ConfigIOStrucScore.cc:7:
include/casm/clex/ChemicalReference.hh: In member function 'void CASM::ChemicalReferencePrinter::print(const std::vector<CASM::ChemicalReferenceState>&)':
include/casm/clex/ChemicalReference.hh:366:27: error: 'round' is not a member of 'std'
if(almost_equal(std::round(num), num, 1e-14)) {
^~~

OpenCV 2.4.7 build on MacOS (Maverick + Xcode 5.01 + CUDA 5.5)

I couldn't build opencv with cuda support on Mavericks:
When using cmake -G "Unix Makefiles" -DWITH_CUDA=ON ..
i got error:
-- Configuring incomplete, errors occurred!
Any workaround on this?
(Similar error when using macport too)
CMakeError.log
Determining size of off64_t failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec3929617441/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec3929617441.dir/build.make CMakeFiles/cmTryCompileExec3929617441.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3929617441.dir/OFF64_T.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec3929617441.dir/OFF64_T.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:19:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 10000)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:20:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 1000)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:21:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 100)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:22:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 10)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:23:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + (SIZE % 10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
5 errors generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec3929617441.dir/OFF64_T.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3929617441/fast] Error 2
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:
#include <sys/types.h>
#include <stdint.h>
#include <stddef.h>
#undef KEY
#if defined(__i386)
# define KEY '_','_','i','3','8','6'
#elif defined(__x86_64)
# define KEY '_','_','x','8','6','_','6','4'
#elif defined(__ppc__)
# define KEY '_','_','p','p','c','_','_'
#elif defined(__ppc64__)
# define KEY '_','_','p','p','c','6','4','_','_'
#endif
#define SIZE (sizeof(off64_t))
char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
('0' + ((SIZE / 10000)%10)),
('0' + ((SIZE / 1000)%10)),
('0' + ((SIZE / 100)%10)),
('0' + ((SIZE / 10)%10)),
('0' + (SIZE % 10)),
']',
#ifdef KEY
' ','k','e','y','[', KEY, ']',
#endif
'\0'};
#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
int require = 0;
require += info_size[argc];
(void)argv;
return require;
}
Determining if the include file io.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec647810530/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec647810530.dir/build.make CMakeFiles/cmTryCompileExec647810530.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec647810530.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec647810530.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'io.h' file not found
#include <io.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec647810530.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec647810530/fast] Error 2
Determining if the function jbg_newlen exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec4172827471/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec4172827471.dir/build.make CMakeFiles/cmTryCompileExec4172827471.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec4172827471.dir/CheckFunctionExists.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -DCHECK_FUNCTION_EXISTS=jbg_newlen -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec4172827471.dir/CheckFunctionExists.c.o -c /opt/local/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec4172827471
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec4172827471.dir/link.txt --verbose=1
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -DCHECK_FUNCTION_EXISTS=jbg_newlen -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTryCompileExec4172827471.dir/CheckFunctionExists.c.o -o cmTryCompileExec4172827471
Undefined symbols for architecture x86_64:
"_jbg_newlen", referenced from:
_main in CheckFunctionExists.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [cmTryCompileExec4172827471] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec4172827471/fast] Error 2
Determining if the include file linux/videodev.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec70111243/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec70111243.dir/build.make CMakeFiles/cmTryCompileExec70111243.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec70111243.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec70111243.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'linux/videodev.h' file not found
#include <linux/videodev.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec70111243.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec70111243/fast] Error 2
Determining if the include file linux/videodev2.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec661389614/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec661389614.dir/build.make CMakeFiles/cmTryCompileExec661389614.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec661389614.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec661389614.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'linux/videodev2.h' file not found
#include <linux/videodev2.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec661389614.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec661389614/fast] Error 2
Determining if the include file sys/videoio.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec741892054/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec741892054.dir/build.make CMakeFiles/cmTryCompileExec741892054.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec741892054.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec741892054.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'sys/videoio.h' file not found
#include <sys/videoio.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec741892054.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec741892054/fast] Error 2
Determining if the include file libavformat/avformat.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec2161613468/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec2161613468.dir/build.make CMakeFiles/cmTryCompileExec2161613468.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2161613468.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec2161613468.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'libavformat/avformat.h' file not found
#include <libavformat/avformat.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec2161613468.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec2161613468/fast] Error 2
Determining if the include file ffmpeg/avformat.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec188285781/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec188285781.dir/build.make CMakeFiles/cmTryCompileExec188285781.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec188285781.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec188285781.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'ffmpeg/avformat.h' file not found
#include <ffmpeg/avformat.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec188285781.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec188285781/fast] Error 2
Here's how I compiled OpenCV 2.4.8 on OSX Mavericks 10.9.1 using Xcode 5.0.2 and CUDA 5.5:
open CMake to set the project, and to the basic configuration
in latest Xcode (I think >= 5) there's no more the gcc compiler, deprecated in favor of clang, so go to the CUDA options of the CMAKE project and change CUDA_HOST_COMPILER to use "/usr/bin/clang". Luckily CUDA 5.5 supports clang and not only gcc
Apparently CUDA 5.5 supports only the older libstdc++ library and not the more modern libc++, so update CUDA_NVCC_FLAGS to tell mvcc to pass tell the nativa compilar to use this older library. Add "-Xcompiler -stdlib=libstdc++; -Xlinker -stdlib=libstdc++"
Tell also the C++ compiler that compiles the rest of the library to use libstdc++: show the advanced options of CMAKE and go to CMAKE to add "-stdlib=libstdc++" to both CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS
For anyone coming here later who may be trying to install from this tutorial. I ran into this problem because my OPENCV_EXTRA_MODULES_PATH was pointing to the wrong directory. I had mine in ~/src/, and not just ~/

Resources