How to use libviso2? - c++

I try to run visual odometry examples. I install libviso2 from here. I have matlab 2011b. I use ubuntu 14.04.
Readme of libviso2 says that for c++ installation :
- sudo apt-get install libpng12-dev
- sudo apt-get install libpng++-dev
Linux:
1) Move to libviso2 root directory
2) Type 'cmake .'
3) Type 'make'
4) Run './viso2 path/to/sequence/2010_03_09_drive_0019'
I run libviso2 succesfully on terminal. Next step, I tried to run matlab wrappers and demos. Readme says that about matlab wrappers :
In the MATLAB directory of libviso, simply run 'make.m' to generate the mex wrappers.
(Run mex -setup before to choose your desired compiler)
Now try to run the demo*.m files!
Firstly, I run make.m.The output is below :
../src/triangle.cpp:1552:27: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
printtri.orient);
^
../src/triangle.cpp:1561:42: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ [-Wformat=]
printvertex[0], printvertex[1]);
^
../src/triangle.cpp:1568:42: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ [-Wformat=]
printvertex[0], printvertex[1]);
Then I run mex -setup. I try to run a example demo, but I get an error. The error message is below :
MATLAB/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by
/MATLAB/bin/libviso2/matlab/visualOdometryMonoMex.mexa64)
How can I solve this error?

I think it's because Matlab changed for a 64 bit API. so add '-compatibleArrayDims' to mex file. I did this and it works. Hope it works for you as well.

Related

Can't able to static compile QT 6.4.0 using Mingw

When I was trying to compile QT 6.4.0 static with Mingw I had and error with fxc, after spending time found it was an error because it couldn't able to find fxc.exe so I added fxc to path from windows kits (10), after adding it fixed that error but now I'm getting different errors.
Configure: configure.bat -release -static -static-runtime -no-pch -optimize-size -opengl desktop -platform win32-g++ -prefix "C:\qt\6.4.0static\qt-static" -skip webengine -nomake tools -nomake tests -nomake examples
My OS: Windows 11 Pro (21H2).
For more log details: Pastebin
qsgd3d12engine.cpp: In member function 'D3D12_CPU_DESCRIPTOR_HANDLE QSGD3D12CPUDescriptorHeapManager::allocate(D3D12_DESCRIPTOR_HEAP_TYPE)':
qsgd3d12engine.cpp:121:41: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare]
121 | for (int bucket = 0; bucket < _countof(heap.freeMap); ++bucket)
| ^
qsgd3d12engine.cpp:157:23: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare]
157 | for (int i = 1; i < _countof(heap.freeMap); ++i)
| ^
qsgd3d12engine.cpp: In function 'void getHardwareAdapter(IDXGIFactory1*, IDXGIAdapter1**)':
qsgd3d12engine.cpp:224:83: error: expected primary-expression before ')' token
224 | HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr);
| ^
qsgd3d12engine.cpp:224:63: error: '_uuidof' was not declared in this scope
224 | HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr);
| ^~~~~~~
In file included from C:/msys64/mingw64/include/winbase.h:2811,
from C:/msys64/mingw64/include/windows.h:70,
from C:/Qt/dev/Qt/src/qtbase/src/corelib/global/qt_windows.h:64,
from C:\Qt\dev\Qt\src\qtbase\include/QtCore/qt_windows.h:1,
from C:/Qt/dev/Qt/src/qtbase/src/gui/opengl/qopengl.h:49,
from C:\Qt\dev\Qt\src\qtbase\include/QtGui/qopengl.h:1,
from C:/Qt/dev/Qt/src/qtdeclarative/src/quick/scenegraph/coreapi/qsggeometry.h:44,
from ..\..\..\..\include\QtQuick/qsggeometry.h:1,
from qsgd3d12engine_p.h:57,
from qsgd3d12engine.cpp:40:
qsgd3d12engine.cpp:241:80: error: expected primary-expression before ')' token
241 | if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr))) {
| ^
qsgd3d12engine.cpp:241:60: error: '_uuidof' was not declared in this scope
241 | if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr))) {
| ^~~~~~~
EDIT: Fixed the issues, check the marked answer for more details.
To fix __uuidof error with mingw follow the steps from this link:
https://forum.qt.io/topic/128587/build-failure-_uuidof-was-not-declared-in-this-scope/7
To fix QT DirectX issue follow this steps:
Download Windows SDK from https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/. (I downloaded SDK for windows 11 (my OS)).
open this file pathToQTSource\qtdeclarative\plugins\scenegraph\d3d12\qsgd3d12engine.cpp in your preferred editor and add this line #include <d3d12sdklayers.h> at include section and save it.
That's it.
To fix another error I've faced while compiling mfvideorenderercontrol.cpp:
Goto pathToQtSource\qtmultimedia\src\plugins\wmf\player\mfvideorendercontrol.cpp and change the access modifier from protected to public of void customEvent(QEvent *event) function (declared at class PresentEvent).
Thanks to #thedemons for helping me to fix the issue.

Creating Onion Omega Cross-Compiling environment on Ubuntu

Trying to setup development environment on Ubuntu 20.10 according official manual:
https://docs.onion.io/omega2-docs/cross-compiling.html
Got error below while running make command:
/usr/include/asm-generic/int-ll64.h:31:42: error: conflicting types for '__u64'
31 | __extension__ typedef unsigned long long __u64;
| ^~~~~
In file included from <command-line>:
././include/compiler.h:69:18: note: previous declaration of '__u64' was here
69 | typedef uint64_t __u64;
| ^~~~~
Why I'm getting this? I did all steps in right way. How to fix that?
Im not sure why this issue has come up however, you can reference:
OpenWRT Compile Error
OpenWRT Build Error
The solution is to modify the a file in your buid_dir
build_dir/host/u-boot-2018.03/include/compiler.h
Remove/Comment out line 69 which contains:
typedef uint64_t __u64;

'half' is not a member of 'Eigen'

Task :
I am trying to build TensorFlow Library with bazel using OpenCL in order to run the operations on GPU without enabling GPU of Tensorflow (without CUDA/NVIDIA).
Basically want to run on mobile GPU with the help of Android NDK and the built opencl-tensorflow library)
Steps Taken:
Replace the eigen_archive libray in /home/ashok/.cache/bazel/_bazel_ashok/337a0d8d7fbaddcaa8098e349718a6d6/external with 'eigen-opencl' library of https://bitbucket.org/benoitsteiner/eigen-opencl and build TensorFlow using bazel.
Issues Faced: 'half' is not a member of 'Eigen'
INFO: Found 1 target...
ERROR: /home/ashok/Ashok/tensorflow-1.0.1/tensorflow/core/BUILD:814:1: C++ compilation of rule '//tensorflow/core:android_tensorflow_lib_lite' failed (Exit 1)
In file included from ./tensorflow/core/framework/allocator.h:25:0,
from ./tensorflow/core/framework/op_kernel.h:22,
from ./tensorflow/core/util/guarded_philox_random.h:19,
from tensorflow/core/util/guarded_philox_random.cc:16:
./tensorflow/core/framework/type_traits.h:69:52: error: 'half' is not a member of 'Eigen'
std::is_trivial::value || std::is_same<T, Eigen::half>::value ||
^
./tensorflow/core/framework/type_traits.h:69:52: error: 'half' is not a member of 'Eigen'
./tensorflow/core/framework/type_traits.h:69:63: error: template argument 2 is invalid
std::is_trivial::value || std::is_same<T, Eigen::half>::value ||
^
Target //tensorflow/examples/android:tensorflow_demo failed to build
Please help in resolving the issue
Use https://bitbucket.org/benoitsteiner/opencl instead of https://bitbucket.org/benoitsteiner/eigen-opencl as it is the most updated repository

wurfl nginx build errors

I am getting build errors when trying to build Nginx with Wurfl. I am running in a Centos7 VM, combining nginx with other modules and specifying other flags doesn't seem to be causing any problems for me. However when I try to bundle with the wurfl module it fails. It gives errors such as:
-o objs/addon/src/ngx_http_wurfl_module.o \
../src/ngx_http_wurfl_module.c
../src/ngx_http_wurfl_module.c:63:5: error: unknown type name ‘wurfl_useragent_priority’
wurfl_useragent_priority useragent_priority;
^
../src/ngx_http_wurfl_module.c:86:15: error: ‘WURFL_UPDATER_FREQ_DAILY’ undeclared here (not in a function)
{"DAILY", WURFL_UPDATER_FREQ_DAILY},
^
../src/ngx_http_wurfl_module.c:86:5: error: missing initializer for field ‘value’ of ‘nginx_wurfl_updater_frequency_t {aka const struct <anonymous>}’ [-Werror=missing-field-initializers]
{"DAILY", WURFL_UPDATER_FREQ_DAILY},
^
../src/ngx_http_wurfl_module.c:82:15: note: ‘value’ declared here
const int value;
^
../src/ngx_http_wurfl_module.c:87:16: error: ‘WURFL_UPDATER_FREQ_WEEKLY’ undeclared here (not in a function)
{"WEEKLY", WURFL_UPDATER_FREQ_WEEKLY},
^
../src/ngx_http_wurfl_module.c:87:5: error: missing initializer for field ‘value’ of ‘nginx_wurfl_updater_frequency_t {aka const struct <anonymous>}’ [-Werror=missing-field-initializers]
{"WEEKLY", WURFL_UPDATER_FREQ_WEEKLY},
^
../src/ngx_http_wurfl_module.c:82:15: note: ‘value’ declared here
const int value;
^
In file included from src/core/ngx_core.h:58:0,
from ../src/ngx_http_wurfl_module.c:22:
../src/ngx_http_wurfl_module.c: In function ‘ngx_http_wurfl_init_main_conf’:
../src/ngx_http_wurfl_module.c:694:93: error: implicit declaration of function ‘wurfl_get_api_version’ [-Werror=implicit-function-declaration]
ngx_log_error(NGX_LOG_NOTICE, cf->log, 0, "WURFL: Engine created - API version %s", wurfl_get_api_version()
I am trying to build with the latest stable nginx, and a pulled wurfl from yesterday, and gcc 5.3.1. I am more or less using the generic build script provided by WURFL.
Anyone have any thoughts?
So there are a couple of components to the WURFL module and it looks like the issue could be a mismatch on the different components. I would make sure that your libwurfl and wurfl infuze version numbers are the same (the latest version is 1.8.4). Check out the first section of the documentation for more information on how to install libwurfl.
Next I would make sure that your nginx.conf file is appropriate for the version of wurfl you are using. There have been some big changes in the last few versionsof wurfl that may affect how it performs. You can check the documentation for an example configuration file for the latest version of wurfl. If you are using an older version, you can check the readme provided with the release.
If fixing these doesn't help, let me know what infuze version number you are working with so I can try to replicate your issue.

error: invalid argument '-std=gnu99' not allowed with 'C++/ObjC++'

I am trying to compile C library called DevIL on OSX Maverick with Clang.I ran configure file then 'make' .I am getting the following error:
error: invalid argument '-std=gnu99' not allowed with 'C++/ObjC++'
Does it mean I am trying to compile C code with C++ compiler?How can I tell Clang to compile it as C lib?
My standard answer to such problems is to use MacPorts. Once MacPorts is installed, it's as simple as:
$ sudo port install libdevil