Cmake doesn't find boost windows - c++

I'm trying to run this code:
https://github.com/snukky/news-translit-nmt
I've installed boost and got the following messages:
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
C:\Program Files\boost\boost_1_67_0
The following directory should be added to linker library paths:
C:\Program Files\boost\boost_1_67_0\stage\lib
By the comment of #kenba I've added the following environment variables:
Try 1
When I try to run the following cmd:
cmake .. -DCMAKE_BUILD_TYPE=Release
I get:
-- Could NOT find Boost (missing: timer iostreams filesystem system chrono) (found version "1.67.0")
CMake Error at CMakeLists.txt:290 (message):
Cannot find Boost libraries. Terminating.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring incomplete, errors occurred!
See also "D:/ThesisResources/previous_works/news-translit-nmt-master/tools/marian-dev/build/CMakeFiles/CMakeOutput.log".
Try 2
When I try to give a custom boost by this ref
https://marian-nmt.github.io/docs/#custom-boost:
I run the following cmd:
cmake .. -DBOOST_ROOT="C:\Program Files\boost\boost_1_67_0"
I get the same error.
I've also tried working with Linux WSL (But problems with CUDA installation overthere, their team is working on it), Linux VirtualBox (Not enough resources), and Ubuntu 17.10 I have installed (But Cuda requires Ubuntu 16.04 / 18.04)
What am I missing here? I'm trying any suggestion, stuck on it for a few days. Thanks!
Edit:
I reinstalled Ubuntu 16.04 and the problem was solved. Still don't know how to solve it in windows, but i'll continue use Ubuntu 16.04.

I had this problem earlier while trying to build the Windows version of Marian NMT (the same component that you're having trouble with). I can't remember the exact steps to solve the problem, but the root cause is that the Marian NMT build for Windows does not work with newer versions of Boost, since the source code uses some deprecated calling conventions for timer and chrono libraries (maybe some others as well).
The error message kind of confirms this: it can't find Boost, but on the other hand it says it finds your version 1.67.0. The solution is to use an older version of boost, I've confirmed that it works with 1.60.0.
If you just require a Marian NMT decoder that works in Windows, a project I work on has released a plugin for the Trados Studio translation tool, which contains a compiled marian-decoder executable for Windows: https://object.pouta.csc.fi/fiskmo/TradosStudio/FiskmoTranslationProvider.sdlplugin. You can access the executable by unzipping the sdlplugin file, the StartMtPipe.bat shows how to use the decoder.

Related

CMake error in CLion after updating CMake

I am relatively new to coding in C++ and using CMake. I have been writing code using CLion IDE on ubuntu 16.04. I had written a library, with an older version of CMake (I believe it was version 3.4) which came bundled with CLion and for an unrelated reason needed to update to version 3.15. Which I assume I must have done incorrectly.
When reloading Cmake projects that previously ran fine, I get the following error message:
Found Qt4: /usr/bin/qmake (found version "4.8.7")
CMake Error at cmake-build-debug/_deps/eigen-src/cmake/language_support.cmake:33 (file):
file failed to open for writing (Permission denied):
/home/majed/CLionProjects/TwoLink_manip/cmake-build-debug/language_tests/Fortran/CMakeLists.txt
Call Stack (most recent call first):
cmake-build-debug/_deps/eigen-src/test/CMakeLists.txt:19 (workaround_9220)
I have looked through a numeber of Cmake questions which I thought could be related to my issue but none of them seemed to address this specific issue. I am not very familiar with the Cmake installation and setup and simply followed a youtube tutorial to install the latest release(cmake-3.15.5-Linux-x86_64.sh)from the cmake.org site.
I should point out that CMake does work when I run ROS packages from the terminal which is why I am apprehensive about re-installing everything. I am assuming the issue is related to where the cmake file is installed but not sure how to fix this issue with CLion. I would appreciate any and all suggestions.
I have also tried to export CMAKE_ROOT to the locaton of the new cmake folder but it doesn't really have any effect.

installing OpenCV with Code::Blocks / CMake

I am fairly new to C++ in general (though I am getting used to the basics), but now I am trying to add OpenCV to my projects to access some of the basic image processing features. I have read the documentation so I have a pretty good idea where to start, but I am really stuck with the installation.
I am working with Code::Blocks 16.01, and I have downloaded both CMake 3.4.3 and OpenCV 3.0.0 and 3.1.0. OpenCV has been extracted to "c:\opencv", and I have attempted to finish the build with CMake (using the directions from the OpenCV documentation as well as from several older posts from this site). I am selecting "Codeblocks - MinGW Makefiles" from the list of generators, though I have selected from all of the "Codeblocks" options at one point or another.
Anyway, whenever I try to configure or generate I receive the following error: "The program can't start because libintl-8.dll is missing from your computer." So yeah, I am stuck.
It is worth noting that many, if not all, of the posts I have found refer to a directory named "\x86\mingw\lib", however I cannot find "mingw" in any of the OpenCV downloads (and the most recent is missing "x86" as well) - so none of these posts have been particularly useful to me (for example):
How to compile a program using OpenCV 2.4.3 with Code::Blocks?
Put the path to all the MinGW dll files in your pc's path variable. Check your Code::Blocks installation directory ( C:\Program Files (x86)\CodeBlocks\MinGW\bin ) if it does not exist, you'd have to download and install MinGW separately. You'd have to add the MinGW .dll files to the path environment.

Error occurred when building NaoQI C++ SDK example project helloworld on Windows VS2010

I'm trying to install NaoQI C++ SDK on Windows following the instructions in http://doc.aldebaran.com/2-1/dev/cpp/install_guide.html.
I got stuck in Part E. Step.3, when running qibuild make. At first, it gave error messages similar to this question: https://community.aldebaran.com/en/forum/error-occurred-when-building-prodect-hellworld-1176.
After I added add_definitions("-DNOMINMAX") to CmakeLists.txt as suggested, the error message becomes:
LINK : fatal error LNK1104: cannot open file 'c:\NaoQi\Devtool\naoqi-sdk\lib\boost_signals-vc100-mt-gd-1_50.lib'
I cannot find any file called boost_signals-vc100-mt-gd-1_50.lib in naoqi sdk. I guess it should be compiled automatically when running qibuild configure or qibuild make but somehow it didn't.
The SDK version is naoqi-sdk-2.0.2.53-win32-vs2010, and OS is Windows 8.1(x64).
With Visual Studio 2010, CMake 2.8.10, qibuild 3.6.2 and Python 2.7.8.
I don't know if it makes any difference, but when running "qibuild configure", I'm getting following messages:
— Looking for include file pthread.h
— Looking for include file pthread.h – not found
I checked PTHREAD_INCLUDE_DIRS which is c:/NaoQi/Devtool/naoqi-sdk/include and pthread.h is under this path.
Solved it!
If anybody wants to know, here is how I solve it.
Compile your own boost library and copy them into naoqi-sdk/lib.
Open the VisualStudio solution file and change the configuration to release mode.
The Windows version SDK doesn't have debug version ALCOMMON, ALPROXY and ALVALUE libraries. That's why the debug mode doesn't work.

Could NOT find Boost in ubuntu machine?

I have already installed BOOST in my brand new Ubuntu 12.04 machine. And when I do like this -
cmake .
I always get the below exception saying -
Could NOT find Boost
I am not sure what wrong I am doing here. I have one of my ubuntu instance working fine and I am trying the same thing on my new Ubuntu instance which I have got.. So I am not sure what wrong I am doing here and how the same thing works fine in my other ubuntu instance.
root#dbx1245:/export/home/test/libcql# cmake .
-- Could NOT find Boost
WANT_LIB64 unset; assuming normal library directory names
Will install libraries to /usr/local/lib
-- Configuring done
-- Generating done
-- Build files have been written to: /export/home/test/libcql
Can anyone help me with this?
I am running Ubuntu 12.04. I have seen other article as well on the stackoverflow but I am not able to solve this issue.
I already have boost installed by the way.
I also encountered this error - boost was correctly installed as suggested in this answer.
I solved it by setting
set(BOOST_INCLUDEDIR /usr/include)
just before
find_package(Boost)
I was using CMake 3.1.3 for testing (via ppa:george-edison55/cmake-3.x)

build problems with Qt and opencv on Windows

I would like to create a gui application with Qt, using opencv on Windows XP. I used both Qt and opencv before, but never together. Long story short, I'm unable to get opencv work with Qt.
As on all the forums I searched there are just little pieces of information scattered around, usually with no answer, I summarize here all the steps I've taken.
Downloaded the Qt SDK (4.6.3) for Windows, and used it for some time, successfully.
Downloaded the opencv 2.3.1 megapack for Windows, complete with binaries. I managed to compile my Qt project including opencv successfully, but any opencv function call resulted in a crash. I read on some forums that the binaries in the Windows megapack don't support Qt, and I have to build opencv myself
I downloaded the latest version of CMake (2.8).
I downloaded the source of opencv from here: http://code.opencv.org/svn/opencv/branches/2.3/
I downloaded the source for the version of Qt I had (4.6.3)
I found my old version of visual Studio 2005
I created a VS2005 project with CMake, checking the support for Qt. (WITH_QT checked)
I built opencv in VS2005. It created most of the libraries, but not all. Highgui was among the failed ones. The problem: Qt\4.6.3\src\corelib\global\qconfig.h was not found. There was no qconfig.h at all in the source I downloaded! I found some templates qconfig-large.h, qconfig-small.h etc., so I renamed one of them to qconfig.h. Now I got a screen full of linker errors.
I downloaded the latest Qt source instead (4.8.1). Now there is a source file qbenchmark.h that includes QtTest/qbenchmarkmetric.h which cannot be found.
I gave up, and tried MinGW.
I downloaded the latest MinGW (2011.11.18)
I set CMake to generate a MinGW makefile, but I got the following error:
.
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-g++.cmake:1 (INCLUDE):
include could not find load file:
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-gcc.cmake
Call Stack (most recent call first):
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:59 (INCLUDE)
True, there is a Windows-g++.cmake file in the Modules/Platform directory, but it references Windows-gcc.cmake which does not exist!
Is there anyone who managed to build opencv with Qt support on Windows, and if yes, how?
Edit:
The problem is definitely with the Qt source. I managed to generate a MinGW makefile, and the build went all OK until it stopped in src/testlib/qtestsystem.h because there was an include for QtCore/qelapsedtimer.h which file is in a completely different directory! Does Qt release incomplete sources, or did I do something wrong?
Edit2
My torment continues. I cleaned everything and started anew. This time without even trying Visual Studio.
I downloaded the latest Qt libs with source (4.8.1)
I downloaded the latest MinGW (2011.11.18)
With CMake I successfully created a Makefile, and built it with MinGW. I got some shiny new libs (libopencv_core231, etv.). I was very happy, but how wrong I was to celebrate that soon!!
I downloaded the latest Qt SDK (strangely, it was 4.8.0, so I set Qt Creator to use the 4.8.1) and created a test program without opencv to see if it works. It worked!
I tried using opencv, just reading and displaying an image. It didn't work. exited with code -1073741511
I tried running the .exe directly, outside of Qt Creator. It complained of a missing libstdc++-6.dll
I did a search for it, and found on in my MinGW install (c:\mingw\bin, 958 KB), and one in my Qt install (c:\qt\mingw\bin, 793 KB) - this mingw came bundled with Qt.
I tried both, by copying them in the same folder where my .exe is, but neither worked. I got "The procedure entry point _ZNSt9exceptionD2Ev could not be located in the dynamic link library libstdc++-6.dll." with both. This was in debug, so I tried release, and I got a similar error, with some other entry point not found.
I searched the forums, and I found suggestions that I should link libstdc++ statically. I inserted -static-libgcc -static-libstdc++ at the lines QMAKE_LFLAGS = and QMAKE_LFLAGS_DEBUG = in the file c:\Qt\mkspecs\win32-g++\qmake.conf. This had no effect at all, even after restarting Qt Creator and rebuilding. If I don't copy the libstdc++-6.dll, it still requires it.
Of course, my simple test program without opencv runs from the exe without needing any libstdc++-6.dll, so that means my opencv build is responsible? I wanted to build opencv anew, but I cannot find any CMake settings referring to libstdc++ !
It might be a clue:
When using one of the libstdc++-6.dll files, the error about a missing entrypoint mentions QtGui4.dll. I have a debug build, so it should be QtGui*d*4.dll, shouldn't it? Are there different libstdc++s for debug and release? Either way, I tried to build release, but it didn't work either, same error
Is there no single person on this planet who tried using Qt with QtCreator and opencv 2.3 together on Windows xp, and succeeded? From searching all the forums and Qt archives, I could not find anyone. I'm ready to do the development in Linux, but I'll need a Windows release sooner or later anyway.
I'm trying to resist the temptation of the dark side, which whispers into my ears to forget Qt, MinGW, g++, opencv and try to hack together something in Visual Basic. Oh, the horrors!
Just FYI, I went basically through the same nightmare of combining Qt and OpenCV. This was my experience:
I downloaded the Qt SDK 4.7.4 with Qt Creator 2.4.1 and installed it, no problem.
I downloaded and installed OpenCV 2.4.2 and not knowing that it already came with MinGW...
I downloaded the MinGW compiler which of course had a different version than the one which came already with Qt
This completely messed up my CMake, even when I explicitly told CMake to use the Qt gcc.exe and g++.exe it also used some stuff from my freshly installed MinGW. Probably because I eagerly added every directory to my PATH variable. What a fool I was!
CMake was not able to generate any useful files, so I gave up and installed the OpenCV superpack, hoping this would make things easier.
6.I spent hours wondering, why Qt and OpenCV from the superpack didnt work properly together. I never quite understood. I had the same errors that other users describe here, like console programs crashing as soon as some OpenCV was included. The strange thing is, that I could start the executable manually from FileExplorer (I added all .dlls you could think of to the project folder: opencv_core242.dll, opencv_highgui242.dll, QtCore4.dll, QtGui4.dll and so on...) BUT I could not launch my little test program from within the Qt Creator environment.
I analysed if there was a problem with my DLLs using depends.exe and found out that even though I configured everything to be in DEBUG using the MinGW compiler, my program still tried to use QtCore4.dll and not QtCore4d.dll... So my best guess was, that it was mixing debug and release version.
I gave up using the superpack and again tried to use CMAKE first and then build OpenCV using the Qt MinGW version AND making sure to setup everything for Debug mode and enable the QT option. But no luck with that so far
I stopped using MinGW and switched over to MSVC2010, which works better. However I am still not able to debug the program since the MSVC2010 debugger engine seems to be missing. I dont really know how to manually add this but I am still working on it
So what I can definitely tell is that using Qt and OpenCV for somebody who has little experience is far from trivial!
You should build OpenCV from source, as you already did, it is no hassle. Note that recent versions of OpenCV can be built with and w/o Qt. Highgui optionally uses Qt! It is your choice if you build with or without Qt.
I used Qt libraries together with OpenCV for long time now. I never went for the SDK, instead I used the libs which are built for corresponding VS version. See here: http://qt.nokia.com/downloads/downloads#qt-lib
You can have it for VS2008 and VS2010, but earlier versions are also available built for VS2005. Old versions of Visual Studio suck so hard, why use them anyway.
Then I never had problems pulling it together in a CMake project. It goes along the lines of:
find_package(OpenCV)
find_package(Qt4 ${VOLE_MINIMUM_QT_VERSION} COMPONENTS QtCore QtGui)
find_package(Qt4 ${VOLE_MINIMUM_QT_VERSION} COMPONENTS QtOpenGL)
...
qt4_wrap_cpp(moc_sources ${vole_module_moc_sources})
qt4_wrap_ui(uic_sources ${vole_module_ui_sources})
qt4_add_resources(rcc_sources ${vole_module_rcc_sources})
You know, the usual stuff.
Five man weeks later you may probably get it run under Windows, while under GNU/Linux it is three commands in the shell.
You might have an easier time configuring Qt Creator with OpenCV. This post shows how to achieve that, step-by-step! It displays several screenshots to aid in the process too.