c++: error: unrecognized command line option ‘-std=gnu++14’ - c++

I try to build the fblualib. However, when running build.sh I get the following error:
-- Found Folly: /usr/local/include
-- Found Torch7 in /home/dmus/torch/install
-- Found Folly: /usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dmus/fblualib/fblualib/build
[ 25%] Building CXX object CMakeFiles/fblualib.dir/LuaUtils.cpp.o
c++: error: unrecognized command line option ‘-std=gnu++14’
make[2]: *** [CMakeFiles/fblualib.dir/LuaUtils.cpp.o] Error 1
make[1]: *** [CMakeFiles/fblualib.dir/all] Error 2
make: *** [all] Error 2
g++ --version outputs g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4. I see related questions, however I do not see how to fix this.

You need to upgrade your g++ (At least to version 4.9.*).
Once upgrade is done, try compiling using g++ -std=c++14 file.cpp or g++ -std=c++1y file.cpp.

Related

Failing to compile a c++ application under MacOS Catalina 10.15

Note: For how I solved the problem, please look at the end of the post.
Yesterday, I have updated to MacOS Catalina 10.15 and since then I am trying to compile this c++ application (a fork of the nori educational ray tracer), but for some reason CMake fails to find the pthread library. Here is the output after running CMake:
$ cmake ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- Performing Test HAS_CPP11_FLAG
-- Performing Test HAS_CPP11_FLAG - Success
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- Performing Test HAVE_GCC_INLINE_ASM_AVX
-- Performing Test HAVE_GCC_INLINE_ASM_AVX - Failed
-- Performing Test HAVE_SYSCONF_NPROCESSORS_ONLN
-- Performing Test HAVE_SYSCONF_NPROCESSORS_ONLN - Failed
-- TBB: NOT using libc++.
-- Looking for pthread.h
-- Looking for pthread.h - not found
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/Applications/CMake.app/Contents/share/cmake-3.15/Modules/FindThreads.cmake:220 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
ext/nanogui/ext/glfw/CMakeLists.txt:60 (find_package)
-- Configuring incomplete, errors occurred!
See also "/Users/harry/dev/nori/build/CMakeFiles/CMakeOutput.log".
See also "/Users/harry/dev/nori/build/CMakeFiles/CMakeError.log".
And following is the CMakeError.log:
Performing C++ SOURCE FILE Test HAVE_GCC_INLINE_ASM_AVX failed with the following output:
Change Dir: /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_1e411/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_1e411.dir/build.make CMakeFiles/cmTC_1e411.dir/build
Building CXX object CMakeFiles/cmTC_1e411.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++14 -fvisibility=hidden -Wno-switch -Wno-tautological-compare -Wno-deprecated-register -DHAVE_GCC_INLINE_ASM_AVX -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -o CMakeFiles/cmTC_1e411.dir/src.cxx.o -c /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: invalid version number in '-mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk'
clang: warning: using sysroot for 'DriverKit' but targeting 'MacOSX' [-Wincompatible-sysroot]
make[1]: *** [CMakeFiles/cmTC_1e411.dir/src.cxx.o] Error 1
make: *** [cmTC_1e411/fast] Error 2
Source file was:
int main()
{
#if defined(__GNUC__) && defined(__SSE2__)
int n = 0;
int eax = 0;
int edx = 0;
__asm__(
"xgetbv ;"
"vzeroupper "
: "=a"(eax), "=d"(edx) : "c"(n) : );
#else
#error No GCC style inline asm supported for AVX instructions
#endif
}
Performing C++ SOURCE FILE Test HAVE_SYSCONF_NPROCESSORS_ONLN failed with the following output:
Change Dir: /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_db06f/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_db06f.dir/build.make CMakeFiles/cmTC_db06f.dir/build
Building CXX object CMakeFiles/cmTC_db06f.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++14 -fvisibility=hidden -Wno-switch -Wno-tautological-compare -Wno-deprecated-register -DHAVE_SYSCONF_NPROCESSORS_ONLN -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -o CMakeFiles/cmTC_db06f.dir/src.cxx.o -c /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: invalid version number in '-mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk'
clang: warning: using sysroot for 'DriverKit' but targeting 'MacOSX' [-Wincompatible-sysroot]
make[1]: *** [CMakeFiles/cmTC_db06f.dir/src.cxx.o] Error 1
make: *** [cmTC_db06f/fast] Error 2
Source file was:
#include <unistd.h>
int main()
{
sysconf(_SC_NPROCESSORS_ONLN);
}
Performing C++ SOURCE FILE Test HAS_LIBCPP failed with the following output:
Change Dir: /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_4098b/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_4098b.dir/build.make CMakeFiles/cmTC_4098b.dir/build
Building CXX object CMakeFiles/cmTC_4098b.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++14 -fvisibility=hidden -DHAS_LIBCPP -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -o CMakeFiles/cmTC_4098b.dir/src.cxx.o -c /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: invalid version number in '-mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk'
clang: warning: using sysroot for 'DriverKit' but targeting 'MacOSX' [-Wincompatible-sysroot]
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
make[1]: *** [CMakeFiles/cmTC_4098b.dir/src.cxx.o] Error 1
make: *** [cmTC_4098b/fast] Error 2
...and run output:
Return value: 1
Source file was:
#include <iostream>
int main(int argc, char **argv) { std::cout << "test"; return 0; }
Performing C++ SOURCE FILE Test SUPPORTS_STDCXX11 failed with the following output:
Change Dir: /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_74f47/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_74f47.dir/build.make CMakeFiles/cmTC_74f47.dir/build
Building CXX object CMakeFiles/cmTC_74f47.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++14 -fvisibility=hidden -DSUPPORTS_STDCXX11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -std=c++11 -o CMakeFiles/cmTC_74f47.dir/src.cxx.o -c /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: invalid version number in '-mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk'
clang: warning: using sysroot for 'DriverKit' but targeting 'MacOSX' [-Wincompatible-sysroot]
make[1]: *** [CMakeFiles/cmTC_74f47.dir/src.cxx.o] Error 1
make: *** [cmTC_74f47/fast] Error 2
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test SUPPORTS_MRTM failed with the following output:
Change Dir: /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_60b35/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_60b35.dir/build.make CMakeFiles/cmTC_60b35.dir/build
Building CXX object CMakeFiles/cmTC_60b35.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++14 -fvisibility=hidden -DSUPPORTS_MRTM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -mrtm -Werror -o CMakeFiles/cmTC_60b35.dir/src.cxx.o -c /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp/src.cxx
clang: error: invalid version number in '-mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk'
clang: error: using sysroot for 'DriverKit' but targeting 'MacOSX' [-Werror,-Wincompatible-sysroot]
make[1]: *** [CMakeFiles/cmTC_60b35.dir/src.cxx.o] Error 1
make: *** [cmTC_60b35/fast] Error 2
Source file was:
int main() { return 0; }
Determining if the include file pthread.h exists failed with the following output:
Change Dir: /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_b4d5d/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b4d5d.dir/build.make CMakeFiles/cmTC_b4d5d.dir/build
Building C object CMakeFiles/cmTC_b4d5d.dir/CheckIncludeFile.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wno-deprecated-declarations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk -o CMakeFiles/cmTC_b4d5d.dir/CheckIncludeFile.c.o -c /Users/harry/dev/nori/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
clang: error: invalid version number in '-mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk'
clang: warning: using sysroot for 'DriverKit' but targeting 'MacOSX' [-Wincompatible-sysroot]
make[1]: *** [CMakeFiles/cmTC_b4d5d.dir/CheckIncludeFile.c.o] Error 1
make: *** [cmTC_b4d5d/fast] Error 2
The nori ray tracer expects XCode along with the command line tools installed on a MacOS machine. I have Xcode version 11.1 and the corresponding command line tools.
As far as I can see from the CMakeError.log file, clang produces an error, because of an invalid version number of mmacosx-version-min.
clang: error: invalid version number in '-mmacosx-version-min=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/DriverKit19.0.sdk'
I have researched a while trying to find clues on the topic, but failed to find something that solves my problem. The version of clang I have, is the one installed with Xcode: Apple clang version 11.0.0.
I am open to hear any suggestion and provide any additional information on my configuration you may find useful to pinpoint the issue.
P.S.: I forgot to mention, that back when I first started working on this project, I had a similar issue on MacOS Mojave here. And I was able to fix it by installing the SDK headers as noted in this post:
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Working solution: Installing an older version of XCode (10.2.1 works well for me) and redirecting to it (making it the active developer directory with xcode-select -s [path-to-old-xcode]) turns out to solve my problem. The solution was proposed by Aaron19960821 from GitHub. See here.

Installing LibTorch on OSX: unsupported option fopenmp

I'm trying to follow the instructions (here https://pytorch.org/cppdocs/installing.html) to install LibTorch on OSX. I was all going well up until the "make" command, which returned
Scanning dependencies of target example-app
[ 50%] Building CXX object CMakeFiles/example-app.dir/example-app.cpp.o
clang: error: unsupported option '-fopenmp'
make[2]: *** [CMakeFiles/example-app.dir/example-app.cpp.o] Error 1
make[1]: *** [CMakeFiles/example-app.dir/all] Error 2
make: *** [all] Error 2
Any ideas how I can fix this issue?
By the way, in the earlier cmake step, it seems like the compiler Cmake found was the default system compiler on Mac:
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works

WebAssembly demo guide fails due missing files

Following step by step the Developer's Guide it fails for me on MAC.
http://webassembly.org/getting-started/developers-guide/
I have a clean mac installation 10.11.6 (15G31) and here is the log.
Mac-MBP:emsdk_portable wasm$ ./emsdk activate clang-incoming-64bit emscripten-incoming-64bit sdk-incoming-64bit
Writing .emscripten configuration file to user home directory /Users/wasm/
The Emscripten configuration file /Users/wasm/.emscripten has been rewritten with the following contents:
import os
LLVM_ROOT='/Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin'
NODE_JS='/Users/wasm/repo/webassembly/emsdk_portable/node/4.1.1_64bit/bin/node'
EMSCRIPTEN_ROOT='/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming'
EMSCRIPTEN_NATIVE_OPTIMIZER='/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming_64bit_optimizer/optimizer'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/var/folders/wk/mngy_vmn0xs6j32tm53vvg7m0000gn/T'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
To conveniently access the selected set of tools from the command line, consider adding the following directories to PATH, or call 'source ./emsdk_env.sh' to do this for you.
/Users/wasm/repo/webassembly/emsdk_portable:/Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin:/Users/wasm/repo/webassembly/emsdk_portable/node/4.1.1_64bit/bin:/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming
Mac-MBP:emsdk_portable wasm$ source ./emsdk_env.sh
Adding directories to PATH:
PATH += /Users/wasm/repo/webassembly/emsdk_portable
PATH += /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin
PATH += /Users/wasm/repo/webassembly/emsdk_portable/node/4.1.1_64bit/bin
PATH += /Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming
Setting environment variables:
EM_CONFIG = /Users/wasm/.emscripten
EMSCRIPTEN = /Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming
Mac-MBP:emsdk_portable wasm$ cd ..
Mac-MBP:webassembly wasm$ emmc --version
-bash: emmc: command not found
Mac-MBP:webassembly wasm$ emcc --version
INFO:root:generating system asset: is_vanilla.txt... (this will be cached in "/Users/wasm/.emscripten_cache/is_vanilla.txt" for subsequent builds)
INFO:root: - ok
emcc (Emscripten gcc/clang-like replacement) 1.36.14 (commit ca2685c89546ce5f7c01e1bc769b7d2a401093dc)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Mac-MBP:webassembly wasm$
Mac-MBP:webassembly wasm$ mkdir hello
Mac-MBP:webassembly wasm$ cd hello
Mac-MBP:hello wasm$ echo '#include ' > hello.c
Mac-MBP:hello wasm$ echo 'int main(int argc, char ** argv) {' >> hello.c
Mac-MBP:hello wasm$ echo 'printf("Hello, world!\n");' >> hello.c
Mac-MBP:hello wasm$ echo '}' >> hello.c
Mac-MBP:hello wasm$ emcc hello.c -s WASM=1 -o hello.html
INFO:root:(Emscripten: Running sanity checks)
WARNING:root:retrieving port: binaryen from https://github.com/WebAssembly/binaryen/archive/version_21.zip
WARNING:root:unpacking port: binaryen
INFO:root:generating port: binaryen_tag_version_21.txt... (this will be cached in "/Users/wasm/.emscripten_cache/asmjs/binaryen_tag_version_21.txt" for subsequent builds)
INFO:root:building port: binaryen
-- The C compiler identification is Clang 3.9.0
-- The CXX compiler identification is Clang 3.9.0
-- Check for working C compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang
-- Check for working C compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang++
-- Check for working CXX compiler: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Building with -std=c++11
-- Building with -msse2
-- Building with -mfpmath=sse
-- Building with -Wall
-- Building with -Werror
-- Building with -Wextra
-- Building with -Wno-unused-parameter
-- Building with -fno-omit-frame-pointer
-- Building with -fPIC
-- Building with -O2
-- Building with -UNDEBUG
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
binaryen
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21
Scanning dependencies of target wasm
Scanning dependencies of target asmjs
Scanning dependencies of target support
Scanning dependencies of target passes
[ 1%] Building CXX object src/support/CMakeFiles/support.dir/archive.cpp.o
[ 2%] Building CXX object src/asmjs/CMakeFiles/asmjs.dir/asm_v_wasm.cpp.o
[ 4%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm.cpp.o
In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/support/archive.cpp:17:
/Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/support/archive.h:27:10: fatal error: 'cstdint' file not found
In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/asmjs/asm_v_wasm.cpp:17:
In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/asm_v_wasm.h:20:
/Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/mixed_arena.h:20:10: fatal error: 'atomic' file not found
#include
^
#include
^
In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm/wasm.cpp:17:
/Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm.h:46:10: fatal error: 'cassert' file not found
#include
^
[ 5%] Building CXX object src/passes/CMakeFiles/passes.dir/pass.cpp.o
/Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/passes/pass.cpp:17:10: fatal error: 'chrono' file not found
#include
^
1 error generated.
1 error generated.
make[2]: *** [src/support/CMakeFiles/support.dir/archive.cpp.o] Error 1
make[1]: *** [src/support/CMakeFiles/support.dir/all] Error 2make[2]:
*** [src/asmjs/CMakeFiles/asmjs.dir/asm_v_wasm.cpp.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [src/asmjs/CMakeFiles/asmjs.dir/all] Error 2
[ 8%] Building CXX object src/passes/CMakeFiles/passes.dir/CoalesceLocals.cpp.o
[ 8%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o
1 error generated.
make[2]: *** [src/wasm/CMakeFiles/wasm.dir/wasm.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm/wasm-binary.cpp:17:
/Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm-binary.h:24:10: fatal error: 'cassert' file not found
#include
^
/Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/passes/CoalesceLocals.cpp:25:10: fatal error: 'algorithm' file not found
#include
^
[ 10%] Building CXX object src/passes/CMakeFiles/passes.dir/CodePushing.cpp.o
1 error generated.
make[2]: *** [src/passes/CMakeFiles/passes.dir/pass.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/passes/CodePushing.cpp:22:
/Users/wasm/.emscripten_ports/binaryen/binaryen-version_21/src/wasm.h:46:10: fatal error: 'cassert' file not found
#include
^
1 error generated.
make[2]: *** [src/passes/CMakeFiles/passes.dir/CoalesceLocals.cpp.o] Error 1
1 error generated.
make[2]: *** [src/passes/CMakeFiles/passes.dir/CodePushing.cpp.o] Error 1
make[1]: *** [src/passes/CMakeFiles/passes.dir/all] Error 2
1 error generated.
make[2]: *** [src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o] Error 1
make[1]: *** [src/wasm/CMakeFiles/wasm.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc", line 13, in
emcc.run()
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc.py", line 1334, in run
compile_source_file(i, input_file)
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc.py", line 1323, in compile_source_file
args = get_bitcode_args([input_file]) + ['-emit-llvm', '-c', '-o', output_file]
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc.py", line 1306, in get_bitcode_args
args = system_libs.process_args(args, shared.Settings)
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/system_libs.py", line 636, in process_args
args = port.process_args(Ports, args, settings, shared)
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/ports/binaryen.py", line 34, in process_args
get(ports, settings, shared)
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/ports/binaryen.py", line 29, in get
return [shared.Cache.get('binaryen_tag_' + TAG, create, what='port', extension='.txt')]
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/cache.py", line 95, in get
temp = creator()
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/ports/binaryen.py", line 24, in create
ports.build_native(os.path.join(ports.get_dir(), 'binaryen', 'binaryen-' + TAG))
File "/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/tools/system_libs.py", line 607, in build_native
subprocess.check_call(['cmake', '--build', '.'] + make_args, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--', '-j', '4']' returned non-zero exit status 2
Mac-MBP:hello wasm$ emcc hello.c -s WASM=1 -o hello.htmlc
Mac-MBP:hello wasm$ whi
which while
Mac-MBP:hello wasm$ whi
which while
Mac-MBP:hello wasm$ which emcc
/Users/wasm/repo/webassembly/emsdk_portable/emscripten/incoming/emcc
Mac-MBP:hello wasm$
Mac-MBP:hello wasm$ clang -v
clang version 3.9.0 (https://github.com/kripken/emscripten-fastcomp-clang/ b6ea91778b2b30e6746f2a5f2baba463948729a4) (https://github.com/kripken/emscripten-fastcomp/ dfcb07a871addf339ffac17e606e16e97e8c5f71) (emscripten 1.36.14 : 1.36.14)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Users/wasm/repo/webassembly/emsdk_portable/clang/fastcomp/build_incoming_64/bin
Mac-MBP:hello wasm$
Looks like you're hitting this bug.
The following was suggested to resolve the issue:
Download binaryen.
Install it using cmake . && make
Download EMCC SDK
Install platform specific requirements
Install EMCC compiler following the instructions
To verify everything installed run emcc -v

Error while building OpenCV 3.1.0 with extra modules on OS X Mavericks

I am a beginner in OpenCV, using OpenCV 3.1.0 (downloaded from OpenCV.org) with Mac OS X 10.9.5.
I was trying to run a code which needs contrib.hpp, then I found the extra modules from Github. There is a command from the page:
$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>
$ make -j5
Everything was successful before I did make, it shows an error of no matching function for call to 'calibrateCamera' :
[ 92%] Building CXX object modules/aruco/CMakeFiles/opencv_aruco.dir/src/aruco.cpp.o
/Users/Youko/downloads/opencv_contrib-master/modules/aruco/src/aruco.cpp:1583:12: error:
no matching function for call to 'calibrateCamera'
return calibrateCamera(processedObjectPoints, processedImagePoints, ...
^~~~~~~~~~~~~~~
/Users/Youko/downloads/opencv-3.1.0/modules/calib3d/include/opencv2/calib3d.hpp:844:21: note:
candidate function not viable: requires at most 9 arguments, but 12 were
provided
CV_EXPORTS_W double calibrateCamera( InputArrayOfArrays objectPoints,
^
1 error generated.
make[2]: *** [modules/aruco/CMakeFiles/opencv_aruco.dir/src/aruco.cpp.o] Error 1
make[1]: *** [modules/aruco/CMakeFiles/opencv_aruco.dir/all] Error 2
make: *** [all] Error 2
In the case of I wanna keep the version of Mac OSX, I was thinking of change the version of OpenCV, so I've downloaded OpenCV from Github, and tried to install the OpenCV with following command (it was the same way as how I've installed OpenCV 3.1.0 successfully):
$ cd <opencv_source_directory>
$ mkdir release
$ cd release
$ cmake -G "Unix Makefiles" ..
$ make
$ sudo make install
But there is another problem when I tried make:
[ 44%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o
[ 44%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_avfoundation_mac.mm.o
[ 44%] Linking CXX shared library ../../lib/libopencv_videoio.dylib
ld: framework not found CoreImage
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopencv_videoio.3.1.0.dylib] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2
I thought maybe there was something wrong with cmake, so I tried the following command as well but the same error occurred with make:
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
I've googled for the problem and it seems like I must need the QuartzCore, but most of people said it should be included in the Xcode (I am using Xcode 6.2 btw). I tried both ways to figure it out but I still have no idea why I can't build the extra modules. (I think the most weird problem is that I cannot install OpenCV cloned from Github, but I just wanna show I tried this way but it wasn't successful FYI.)
I'd be most grateful for any help and suggestions!

W10 + Clion, set up error

I am trying to set up Clion on my pc. I tried both Clion and mingw and I get the same error when I point to the tool chain location. I install and uninstall all the required packages for both following the instructions and I can't get it working.
Anyone else has run into this set up issue?
This is the error I am getting:
Error:The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_4ce80/fast"
/usr/bin/make -f CMakeFiles/cmTC_4ce80.dir/build.make CMakeFiles/cmTC_4ce80.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_4ce80.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_4ce80.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_4ce80.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_4ce80.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_4ce80.dir/testCXXCompiler.cxx.o -o cmTC_4ce80.exe -Wl,--out-implib,libcmTC_4ce80.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_4ce80.dir/build.make:98: cmTC_4ce80.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_4ce80/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration Debug
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_4526e/fast"
/usr/bin/make -f CMakeFiles/cmTC_4526e.dir/build.make CMakeFiles/cmTC_4526e.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_4526e.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_4526e.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_4526e.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_4526e.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_4526e.dir/testCXXCompiler.cxx.o -o cmTC_4526e.exe -Wl,--out-implib,libcmTC_4526e.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_4526e.dir/build.make:98: cmTC_4526e.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_4526e/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration Release
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_0c461/fast"
/usr/bin/make -f CMakeFiles/cmTC_0c461.dir/build.make CMakeFiles/cmTC_0c461.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0c461.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_0c461.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_0c461.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_0c461.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_0c461.dir/testCXXCompiler.cxx.o -o cmTC_0c461.exe -Wl,--out-implib,libcmTC_0c461.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_0c461.dir/build.make:98: cmTC_0c461.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_0c461/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration RelWithDebInfo
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_0238e/fast"
/usr/bin/make -f CMakeFiles/cmTC_0238e.dir/build.make CMakeFiles/cmTC_0238e.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0238e.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_0238e.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_0238e.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_0238e.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_0238e.dir/testCXXCompiler.cxx.o -o cmTC_0238e.exe -Wl,--out-implib,libcmTC_0238e.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_0238e.dir/build.make:98: cmTC_0238e.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_0238e/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration MinSizeRel
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_7f6fc/fast"
/usr/bin/make -f CMakeFiles/cmTC_7f6fc.dir/build.make CMakeFiles/cmTC_7f6fc.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_7f6fc.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_7f6fc.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_7f6fc.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_7f6fc.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_7f6fc.dir/testCXXCompiler.cxx.o -o cmTC_7f6fc.exe -Wl,--out-implib,libcmTC_7f6fc.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_7f6fc.dir/build.make:98: cmTC_7f6fc.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_7f6fc/fast] Error 2
CMake will not be able to correctly generate this project.
Cygwin's C++ compiler (or probably linker) can't find cyglto_plugin.dll which can be part of several Cygwin packages. I'm not sure how Clion works - whether it requires Cygwin to be installed or brings it in its own installer. If it requires that user installs Cygwin - verify that you have installed appropriate package and that mentioned DLL is in place.
I removed all the packages and reinstalled them. I think when you have the options to download it allows you to download multiple versions. Which is what i did and then it causes a conflict. issue was resolved.