OpenCV __int128 error when compiling for 64 bit - opencv

I tried to compile opencv for x86_64 and arm64-v8a, but it threw error below:
In file included
from D:\AndroidSDK\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\include/bits/stl_algo.h:59:0,
from D:\AndroidSDK\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\include/algorithm:62,
from D:\TMP\C++\OpenCV-Source\opencv-3.4.3\modules\core\include/opencv2/core/base.hpp:55,
from D:\TMP\C++\OpenCV-Source\opencv-3.4.3\modules\core\include/opencv2/core.hpp:54,
from D:\TMP\C++\OpenCV-Source\opencv-3.4.3\modules\core\include/opencv2/core/utility.hpp:56,
from D:\TMP\C++\OpenCV-Source\opencv-3.4.3\modules\core\src\precomp.hpp:49,
from D:\TMP\C++\OpenCV-Source\opencv-3.4.3\modules\core\src\algorithm.cpp:43:
D:\AndroidSDK\android-ndk-r17b\sources\cxx-stl\gnu-
libstdc++\4.9\include/cstdlib:178:10: error: expected unqualified-id before
'__int128'
inline __int128
D:\AndroidSDK\android-ndk-r17b\sysroot\usr\include\aarch64-linux-
android/asm/sigcontext.h:40:3: error: '__uint128_t' does not name a type
__uint128_t vregs[32];
How to solve it?

It seems to be a problem with the stl library. You could try changing the stl in CMAKE to c++ static:
Flag: ANDROID_STL Value: c++_static

Related

LLVM ERROR: Error parsing inline asm, unexpected token

I am new to LLVM and clang. I am working on a tool that uses LLVM/clang in the backend as a compiler. With the recent changes in LLVM tool, I have started getting following error:
<inline asm>:1:13: error: unexpected token in argument list
lock addb 2$2, 1048576
^
LLVM ERROR: Error parsing inline asm
I do not have any idea how to resolve this. Any input is appreciated.

Caffe build fail: Makefile:591: recipe for target '.build_release/src/caffe/util/io.o' failed

Hello I' ve got issue on caffe installation. I did everything in accordance to the instruction https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-Installation-Guide (for CPU version)
On command make all I've got the following output:
CXX src/caffe/util/io.cpp
In file included from /usr/local/include/opencv2/core.hpp:52:0,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/cvdef.h:421:4: error: #error "OpenCV 4.x+ requires enabled C++11 support"
# error "OpenCV 4.x+ requires enabled C++11 support"
^
In file included from /usr/include/c++/5/array:35:0,
from /usr/local/include/opencv2/core/cvdef.h:426,
from /usr/local/include/opencv2/core.hpp:52,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^
In file included from /usr/local/include/opencv2/core/base.hpp:58:0,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/cvstd.hpp:389:12: error: expected ‘,’ or ‘...’ before ‘&&’ token
Ptr(Ptr&& o);
^
/usr/local/include/opencv2/core/cvstd.hpp:389:16: error: invalid constructor; you probably meant ‘cv::Ptr<T> (const cv::Ptr<T>&)’
Ptr(Ptr&& o);
^
/usr/local/include/opencv2/core/cvstd.hpp:390:25: error: expected ‘,’ or ‘...’ before ‘&&’ token
Ptr& operator = (Ptr&& o);
^
In file included from /usr/local/include/opencv2/core/cvstd.hpp:1033:0,
from /usr/local/include/opencv2/core/base.hpp:58,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/ptr.inl.hpp:256:16: error: expected ‘,’ or ‘...’ before ‘&&’ token
Ptr<T>::Ptr(Ptr&& o) : owner(o.owner), stored(o.stored)
^
/usr/local/include/opencv2/core/ptr.inl.hpp:256:1: error: prototype for ‘cv::Ptr<T>::Ptr(cv::Ptr<T>)’ does not match any in class ‘cv::Ptr<T>’
Ptr<T>::Ptr(Ptr&& o) : owner(o.owner), stored(o.stored)
^
In file included from /usr/local/include/opencv2/core/base.hpp:58:0,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/cvstd.hpp:319:5: error: candidates are: template<class T> template<class Y> cv::Ptr<T>::Ptr(const cv::Ptr<Y>&, T*)
Ptr(const Ptr<Y>& o, T* p);
Here is also a lot of text in output but I cannot upload it because of limit on number of characters
Makefile:591: recipe for target '.build_release/src/caffe/util/io.o' failed
make: *** [.build_release/src/caffe/util/io.o] Error 1
Can somebody help me with this problem?
OS: Ubuntu 16.04
cmake version 3.5.1
Cuda version: 10.0.130
The problem was in 4th version of OpenCV. Caffe dosen't work with it. When I installed 3rd version everything was ok.

Can't build OpenCV 3.1 on Windows (using MinGW)

I need to build OpenCV from source, because I want to make modifications to it. So using pre-built binaries is not an option for me. I'm doing this on Windows 8. I do not have MS Visual Studio, and I don't want to use it.
Here is how I reproduce the build error:
I git clone https://github.com/opencv/opencv
I use CMake 3.7.1, press Configure, then press Generate. It seems to work (no errors). I named the output folder opencv/release.
I go to the opencv/release folder, and type mingw32-make.
Eventually, after compiling for a while, it displays the following error message:
Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj
modules\core\src\parallel.cpp:135:43: error: operator '&&' has no right operand
modules\core\src\parallel.cpp: In function 'void cv::parallel_for_(const cv::Range&, const cv::ParallelLoopBody&, double)':
modules\core\src\parallel.cpp:311:52: error: 'parallel_for_pthreads' was not declared in this scope parallel_for_pthreads(range, body, nstripes);
^
modules\core\src\parallel.cpp: In function 'int cv::getNumThreads()':
modules\core\src\parallel.cpp:370:50: error: 'parallel_pthreads_get_threads_num' was not declared in this scope return parallel_pthreads_get_threads_num();
^
modules\core\src\parallel.cpp: In function 'void cv::setNumThreads(int)':
modules\core\src\parallel.cpp:431:46: error: 'parallel_pthreads_set_threads_num' was not declared in this scope parallel_pthreads_set_threads_num(threads);
^
modules\core\CMakeFiles\opencv_core.dir\build.make:990: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj' failed mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj] Error 1
Note: I tried to compile both with and without TPP (in the CMake config), and I get the same error message.
Also, I read the other similar questions on StackOverflow and the answers do not help.

armv7 is successful but compile for arm64 throws Implicit Function declaration error

Have to compile security library (create static library) for IOS.
Below is the makefile snippet:
SDK_ROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk
#CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc
CC=llvm-gcc
TARGET=security
ARCH=arm64
Now on changing the ARCH=armv7, compilation is successful but for ARCH=arm64
Compiling the same code gives error as below:
crypto.c:580:18: error: implicit declaration of function 'aes_hardware_cbc' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
The above error can be resolved on adding declaration of the function in header file
But I wanted to know how architecture changes brings on Implicit Function Declaration errors or , change warning to errors.
Machine Details:
MAC OS: 10.11 EL Captain
Iphone SDK: iPhoneOS9.0.sdk
Compiler: llvm-gcc (/usr/bin)

Error trying to install rinku gem on mac

I'm having trouble installing the rinku gem version '1.7.3' on Mavericks. I followed the advice of another post that suggested to install apple-gcc42 but that didn't help. I've also tried searching google and stack overflow but couldn't find this exact issue. Here is the error:
Building native extensions. This could take a while...
ERROR: Error installing rinku:
ERROR: Failed to build gem native extension.
/Users/home/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling autolink.c
In file included from autolink.c:17:
buffer.h:23:20: error: stdint.h: No such file or directory
In file included from autolink.c:17:
buffer.h:41: error: expected specifier-qualifier-list before 'uint8_t'
In file included from autolink.c:18:
autolink.h:31: warning: type defaults to 'int' in declaration of 'uint8_t'
autolink.h:31: error: expected ';', ',' or ')' before '*' token
autolink.h:35: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:39: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:43: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c:20:20: error: string.h: No such file or directory
autolink.c:21:20: error: stdlib.h: No such file or directory
autolink.c:22:19: error: stdio.h: No such file or directory
autolink.c:23:19: error: ctype.h: No such file or directory
autolink.c:30: warning: type defaults to 'int' in declaration of 'uint8_t'
... Had to leave out some of the error because it won't let me post this without a lower code to text ratio.
autolink.c: At top level:
autolink.c:256: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c: In function 'sd_autolink__url':
autolink.c:263: error: 'data' undeclared (first use in this function)
autolink.c:266: warning: implicit declaration of function 'isalpha'
autolink.c:269: warning: implicit declaration of function 'sd_autolink_issafe'
autolink.c:272: warning: incompatible implicit declaration of built-in function 'strlen'
make: *** [autolink.o] Error 1
make failed, exit code 2
this ended up fixing it for 1.9.3
xcode-select --install

Resources