how to build OpenBR? - qt

When i build OpenBR on windows and when i type following code on VS2015 x86 x64 Cross Tools Command Prompt as mentioned in A hacker's guide to building, editing, and running OpenBR :
cmake -G "CodeBlocks - NMake Makefiles" -DCMAKE_PREFIX_PATH="H:/opencv-2.4.11/build/install;H:/Qt/Qt‌​5.8/5.8/msvc2015_6‌​4" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release ..
i get this error :
H:\openbr\build-msvc2015>cmake -G "CodeBlocks - NMake Makefiles" -DCMAKE_PREFIX_
PATH="H:/opencv-2.4.11/build/install;H:/Qt/Qt5.8/5.8/msvc2015_64" -DC
MAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=
Release ..
-- The C compiler identification is MSVC 19.0.23506.0
-- The CXX compiler identification is MSVC 19.0.23506.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- OpenCV ARCH: x64
-- OpenCV RUNTIME:
-- OpenCV STATIC: OFF
CMake Warning at H:/opencv-2.4.11/build-msvc2015/install/OpenCVConfig.cmake:161
(message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:88 (find_package)
CMake Error at CMakeLists.txt:88 (find_package):
Found package configuration file:
H:/opencv-2.4.11/build-msvc2015/install/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
See also "C:/openbr/build-msvc2015/CMakeFiles/CMakeOutput.log".
what's problem?

Try to edit OpenCVConfig.cmake file (H:/opencv-2.4.11/build-msvc2015/install/OpenCVConfig.cmake). And set OpenCV_RUNTIME to VC14:
elseif(MSVC_VERSION EQUAL 1800)
set(OpenCV_RUNTIME vc12)
elseif(MSVC_VERSION EQUAL 1900)
set(OpenCV_RUNTIME vc14)
endif()

Related

Qt 5.12: Failed to find "GL/gl.h" in "/usr/include/libdrm"

I have a freshly installed Ubuntu 18.04.3 system (NVIDIA) with only Qt SDK 5.12.5, build-essential, git, and CMake installed. I'm trying to build a Qt project by opening the main CMakeLists.txt in Qt Creator:
Check for working CXX compiler: /usr/bin/g++
Check for working CXX compiler: /usr/bin/g++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at /home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "GL/gl.h" in "/usr/include/libdrm".
Call Stack (most recent call first):
/home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:174 (include)
/home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:89 (find_package)
CMakeLists.txt:89 (find_package)
What should I still install?
Note: I haven't installed Qt from repositories at all. Only via the official online installer.
You need mesa packages.
mesa-common-dev
libglu1-mesa-dev
$ sudo apt install mesa-common-dev libglu1-mesa-dev
And Try.
If anybody using Fedora/RHEL finds this question, mesa packages are named differently here.
mesa-libGL
mesa-libGL-devel
$ sudo dnf install mesa-libGL mesa-libGL-devel
Source: https://access.redhat.com/solutions/56301
In OpenSuse Leap mesa packages are named differently too.
Use:
sudo zypper install Mesa-libGL-devel
to solve it.
I tried it with OpenSuse Leap 15.2 and 15.3.
For centos 7
sudo yum install libGL-devel

How to fix C++ compiler is not able to compile github repo in R

I use Rtools c++ compiler to compile a github repo via cmake, and error says that C++ compiler Rtools/mingw_64/bin/g++.exe is not able to compile a simple test program.
devtools::install_github("tractatus/wholebrain", args='--no-multiarch')
.....
.....
-- The CXX compiler identification is GNU 4.9.3
-- The C compiler identification is GNU 4.9.3
-- Check for working CXX compiler: C:/Rtools/mingw_64/bin/g++.exe
-- Check for working CXX compiler: C:/Rtools/mingw_64/bin/g++.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"C:/Rtools/mingw_64/bin/g++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Windows/Temp/RtmpuqHViQ/R.INSTALL5c036fc6900/ROpenCVLite/src/opencv-4.0.1/build64/CMakeFiles/CMakeTmp
Run Build Command:"C:/Rtools/bin/make.exe" "cmTC_96862/fast"
/Rtools/bin/make -f CMakeFiles/cmTC_96862.dir/build.make CMakeFiles/cmTC_96862.dir/build
make: /bin/sh: Command not found
make: *** [Makefile:121: cmTC_96862/fast] Error 127
and I try to install cmake in another version and rtools, but it seemly not work. So, what's the problem for this?

Configure error with Qt, MinGW, CMake: Qt version not found

I have a problem building an application from Qt Creator; from the configure step, I get this error:
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1382 (message):
Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:13 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
If I configure it from the command line, everything is file:
cmake -G "MinGW Makefiles" ..\ProjectDir
In the paths environment variable Qt is present (src, bin and lib paths).
Platform:
Windows 7
MinGW/GCC 4.4
CMake 2.8.11
Qt 4.8.5
Qt Creator 2.8.1
When you want to develop a CMake based project with Qt Creator, you should not execute CMake manually before. Qt Creator generates a Code::Blocks project from your source to work with CMake, so if you generate with -G "MinGW Makefiles" it will not work.
Instead, you could try the following steps:
In Qt Creator, Open Project > Select the top level CMakeLists.txt
Set a build directory somewhere close to the CMakeLists.txt or in its parent folder, then click on Next
Select your generator (Combination of a Qt version and a compiler)
[optional] set some CMake arguments
Click on Execute CMake, then Finish
Your project should now be opened in Qt Creator and ready for development

Problems with Qt 4.8.5 and MinGW/GCC 4.8.1

I just made a clean install of the following tools on Windows 7:
MinGW / GCC 4.8.1
Qt 4.8.5
Qt Creator 2.8.1
In the PATH there is: C:\Qt\4.8.5\bin;C:\Qt\4.8.5\include;C:\Qt\4.8.5\lib;C:\MinGW\bin;
1) I read the warning about the fact that Qt 4.8 needs GCC 4.6. I ignored it, using GCC 4.8.1. So this could be an issue.
2) I successfully installed Qt Creator. I successfully built the default Qt GUI application. When launched I get the error: "The program has unexpectedly finished." Debugging I get a segmentation fault before entering main(), in the qatomic_i386.h file, in the QBasicAtomicInt::deref() member function.
If I build a cmake based console application, everything is fine.
3) If I build a previous Qt cmake based project (either from the command line or from Qt Creator), this is what I get (out of tree build):
The first time I run cmake:
MyPrj-build>cmake -G "MinGW Makefiles" ..\MyPrj
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeMinGWFindMake.cmake:20 (message):
sh.exe was found in your PATH, here:
C:/Program Files (x86)/Git/bin/sh.exe
For MinGW make to work correctly sh.exe must NOT be in your path.
Run cmake from a shell that does not have sh.exe in your PATH.
If you want to use a UNIX shell, then use MSYS Makefiles.
Call Stack (most recent call first):
CMakeLists.txt:6 (PROJECT)
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:S:/MyPrj/MyPrj-build/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:S:/MyPrj/MyPrj-build/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
The second time:
S:\MyPrj\MyPrj-build>cmake -G "MinGW Makefiles" ..\MyPrj
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1382 (message):
Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:12 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
Is it normal to have these different behaviours in the first and second cmake run?
Why cannot the system find Qt4?
Are these three issues dependent on each other?
How did you "install" your Qt? The only way of "installing" it in your case is to build it from the sources. Generally, you need to use the same compiler to compile Qt as you use to compile your Qt-using project. Some C++ compiler version mismatches might work, but you've just shown that your combination doesn't.

How can I install QT on Lion 10.7.3 with XCode 4.3 installed?

I'm having problems installing QT on my MacBook with Lion 10.7.3 and XCode 4.3.1 installed. I tried to install with brew, and got a compiler error. Below is the end of the error, and the "brew doctor" output. It seems to be using the wrong version of gcc... although I just installed the latest XCode. Any ideas? I'm trying to install QT, so I can run headless browser tests with capybara-webkit. (I also tried with --install-from-source and got the same error.)
gstroup$ brew install qt
....
kernel/qcocoaview_mac.mm:1386:61: error: cannot initialize a parameter of type 'NSString *' with an lvalue of type 'const NSString *'
return [[[NSAttributedString alloc] initWithString:tmpString] autorelease];
^~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:28:34: note: passing argument to parameter 'str' here
- (id)initWithString:(NSString )str;
^
2 errors generated.
make[2]: [.obj/release-shared/qcocoaview_mac.o] Error 1
make[1]: [release] Error 2
make: ** [sub-gui-make_default-ordered] Error 2
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/qt.rb#L76
==> Environment
/usr/bin/gcc
HOMEBREW_VERSION: 0.8
HEAD: 64e489663add868db679cca2186ff8d7796e5d9e
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit dunno
OS X: 10.7.3
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 4.3.1
GCC-4.0: N/A
GCC-4.2: build 401 (5664 or newer recommended)
LLVM: build 2336
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/cc => /usr/bin/clang
CXX: /usr/bin/c++ => /usr/bin/clang
LD: /usr/bin/cc => /usr/bin/clang
CFLAGS: -O3 -w -pipe
CXXFLAGS: -O3 -w -pipe -fvisibility=hidden
MAKEFLAGS: -j8
Error: Failed executing: make
Please report this bug: https://github.com/mxcl/homebrew/wiki/new-issue
Also try:
brew doctor to check your setup for common problems.
brew missing to check installed packages for missing deps.
gstroup$ brew doctor
/usr/bin/gcc
Your gcc 4.2.x version is older than the recommended version. It may be advisable
to upgrade to the latest release of Xcode.
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
/usr/bin is in your PATH before Homebrew's bin. This means that system-
provided programs will be used before Homebrew-provided ones. This is an
issue if you install, for instance, Python.
Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your $PATH.
Some brews install binaries to sbin instead of bin, but Homebrew's
sbin was not found in your path.
Consider editing your .bashrc to add:
/usr/local/sbin
to $PATH.
/usr/bin/gcc
gstroup$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Xcode 4.3.x switched away from gcc as the compiler. Now Apple uses llvm. This maybe the root of your issue. There is a Github project https://github.com/kennethreitz/osx-gcc-installer/downloads that will let you download a gcc compiler.
You may have to prefix your brew command with env CC=/usr/bin/gcc to specify the gcc compiler.

Resources