Cannot compile moses due to old boost version - c++

I tried to compile moses(one of the statistical machine translation system) following the steps
specified here
I don't have root privileges so I used wget to installed newer version of boost. As the documentation above says, I tried to compile moses with the following command.
./bjam --with-boost=~/bin/boost_1_55_0 -j8
But it failed, getting following error.
You have Boost 104100. This package requires Boost at least 104400 (and preferably newer).
I am not familiar with bjam but my guess is that bjam is referencing the older version of boost even though I specified the location of new version of boost. How can I handle this problem?

Related

Cmake doesn't find boost windows

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.

Building boost 1.61.0 with MinGW 5.3.0

Has anyone had any success in building boost 1.61.0 for Mingw? I've Googled for this, and all the suggestions that apparently worked well in the past result in errors now. It doesn't help that boost's "Getting Started on Windows" page is a poorly structured, incomplete mess that seems to have been getting only the most rudimentary updates for a while now (there are even a couple of dead links in there). I somehow managed to build boost 1.58 for an older MinGW version, but that was quite a while ago and I foolishly neglected to write down the individual steps required to make it work. :-\
Ok, I did get it to work, but apparently the bug in the boost build system discussed here is still in boost 1.61. I worked around that by skipping the libraries that run into this problem and only building the ones that I need. Here's what worked for me.
Download and unzip boost_1_61_0.7z to D:\Dev\Libs\boost\boost_1_61_0
Extend PATH variable to contain bin folder that contains MinGW g++.exe, and make sure no other g++.exe instances appear in PATH before this one (that actually tripped me up the first time, because several programs I've installed come packaged with their own g++ version).
Open cmd window.
Run cd D:\Dev\Libs\boost\boost_1_61_0\tools\build
Run .\bootstrap.bat (if you skip this, step 6 will fail with 'Unknown toolset: mingw' ... WTF???)
Run .\bootstrap.bat mingw
Run .\b2.exe install toolset=gcc --prefix=D:\Dev\Libs\boost\boost_1_61_0\b2_for_mingw
Run cd D:\Dev\Libs\boost\boost_1_61_0
Run set PATH=%PATH%;D:\Dev\Libs\boost\boost_1_61_0\b2_for_mingw\bin
Run b2 toolset=gcc --build-type=complete stage --with-filesystem --with-system (since I only need the filesystem and system libraries).
EDIT: For boost 1.64, step 5 must be skipped entirely, and in step 6 gcc needs to be specified instead of mingw, as pointed out in the comments by user fest.
The answer from #antred worked pretty well. Only changes I needed to do to compile boost 1.67.0 is follows:
Instead of step 5 and 6 run .\bootstrap.bat gcc
At step 10 run b2 --build-dir="C:\Program Files\boost_1_67_0\build" --prefix="C:\Program Files\boost" toolset=gcc install

Can I use biicode for C++ on ubuntu 14.04 with Cmake 2.8.12.2?

I just downloaded biicode and tried to follow the getting started instructions but received an error about the Cmake 3.0 or higher being required.
However, ubuntu 14.4 uses "cmake version 2.8.12.2"
Is there a way to use biicode with 2.8 or am I stuck installing the newer version of CMake?
TIA!
No, biicode requires cmake > 3.0. There is a setup command that helps installing it:
$ bii setup:cpp
This will install CMake >3.0 in /home/user/biicode_env, and add it to the path, so it doesnt interfere/overwrite your current 2.8 installation. Biicode needs that executing "cmake" in the console actually uses 3.0, so it should be first in the path. You can manage it very easily in two different ways, with a symbolic link (/usr/bin) that you redirect as needed or adding/removing an entry in the path before executing biicode.
This is a different thing, but I woiuld like to say that I have migrated existing projects from cmake 2.8 to 3.0 without any problems, and 3.0 runs great and has useful new features. So I would recommend regular cmake users to upgrade if possible.
No, there isn't any way to change this requirement because internal biicode CMake has features, like the use of INTERFACE libraries, which are only available on CMake 3.0 or later. However, don't worry about upgrading CMake version, this one always keeps a exhaustive compatibility with older versions ;)

Install boost 1.42 on Mint 17 Thread disabled

This is related to this question: Can't install Vision Workbench.
I need to install boost1.42 in order to compile Vision workbench. I have downloaded the 1.42 package http://sourceforge.net/projects/boost/files/boost/1.42.0/ and extracted it. First I run ./bootstrap.sh --prefix=/home/myname/ and then ./bjam install. Everything works fine except for
error: #error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
So the thread package is not installed correctly and that means I cannot generate a make-file for Vision Workbench.
Does anyone have an idea of how to solve it?
/ Erik
As per the instructions http://www.boost.org/doc/libs/1_42_0/more/getting_started/unix-variants.html
$ cd ~/boost_1_42_0
$ bjam --build-dir=/tmp/build-boost toolset=gcc stage
should build static and shared non-debug multi-threaded variants of the libraries. To build all variants, pass the additional option, “--build-type=complete”.
If this doesn't work for you, then potentially your toolset is not being detected correctly (try specifying it). This is not unlikely since Boost 1.42.0 is really old, and probably could never know about the compiler version you're using.
As an aside, the BOOST_DISABLE_THREADS is known to make no difference for recent boost version.

How do I install the boost library to my MinGW compiler?

I'm compiling from the command line using g++ on a Windows MinGW installation. How do I get boost...conceptually or if it is easy...what do I need to download and install?
I know this is an old question but for future reference for anybody coming to this page try this website,
http://nuwen.net/mingw.html
They have done all the hard work so you don't have to. The most recent distribution on this page has boost 1_52_0 (which is the latest version on the boost website as I'm writing this) including the separately compiled libraries (e.g. boost thread, boost regex etc) which I beleive you're asking for
I spent hours searching for a good solution for Boost 1.54. If you already have MinGW and you're just looking for instructions on compiling the binary boost libraries, try this:
From your boost_X_XX_X directory, go to
.\tools\build\src\engine
and type:
build.bat mingw
This will create a folder called bin.ntx86 or bin.ntx86_64 depending on your architecture. Add this directory to your PATH environment variable.
Return to your boost_X_XX_X directory and type:
bjam toolset=gcc
This worked for me on my system. I'd be interested to know if other systems have trouble with these instructions.
However there would have been a simpler, yet identical way; your steps until the bjam call are automatically done by bootstrap.bat:
C:\boost_1_52_0> bootstrap.bat mingw
Building Boost.Build engine
...
C:\boost_1_52_0> b2 toolset=gcc
Reference: https://stackoverflow.com/a/13257930/2171309
Thanx to Neal Kruis. This worked for me. I have Qt 5.4 with mingw 4.9 installed. I downloaded boost 1.59. Go to "...\boost_1_59_0\tools\build\src\engine\" folder
set PATH=%PATH%;c:\Qt\Qt5.4.0\Tools\mingw491_32\bin
build.bat mingw
go to "...\boost_1_59_0\" folder, change boost path accordingly
set PATH=%PATH%;c:\boost_1_59_0\tools\build\src\engine\bin.ntx86
bjam toolset=gcc