how to turn on multi threading BOOST_DISABLE_THREADS - c++

Im trying to use boots 1.67.0 in visual studio on windows to compile the boost thread example but im getting a error that i can not find the issue to. I think the error may be i am missing a #define but im not sure how i can work it out. boost seams to be working fine in till i start using threading. when i downloaded boost i have not run bjam iv just used added the directory to my include and linker setting. Dose any one know how to resolve this ?
the error im getting in VS is:
c:\librarys\boost_1_67_0\boost\config\requires_threads.hpp(29): fatal error C1189: #error: "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
**EDIT 2*
I have now built the library as it was pointed out to me that to use threads in boost i needed to so i opened bjam and ran the following command "bjam -a --build-type=complete threading=multi" but i still get the error. do i need to use pre-compiled headers in my settings?

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.

How do i install socket.io c++ client library

I am trying to use socket.io c++ client implementation.I have never used an external library before with c++ so im confused.
This is the library i am trying to use:
https://github.com/socketio/socket.io-client-cpp
So i followed this instructions:
https://github.com/socketio/socket.io-client-cpp/blob/master/INSTALL.md
Installed boost and cmake as its stated and i guess it is fine.
My problem is with the 4th step and the rest of it.
If i run
make install
console throws:
make: *** No rule to make target 'install'. Stop.
current dir looks like:
To be honest i didnt understand what is 5th step, and the installation process in general.How should i include this library in my main.cpp so that i can use it ? What are those visual studio project files generated ?
Edit:
If i open INSTALL visual studio project file and build INSTALL project from solution explorer,i get this error:
Edit2:
After updating websocketpp library now i get this error after build:
if you are having lots of issues this is how i solved mine:
boost 1.7.0 was not working for me.I installed boost 1.65.0
after that update websocketpp library
go to C:\socket.io-client-cpp\.git\modules\lib\websocketpp directory with command line and type
git pull origin master
so after changing boost version to 1.65.0 and updating websocketpp finally it built succesfully.

Strange errors on Windows with Asio

I have a cross-platform project that uses the boostless version of Asio. On OSX I use autotools to build the library then include it on my project:
exec_program(COMMAND "./autogen.sh" WORKING_DIRECTORY ${asio_SOURCE_DIR}/asio)
exec_program(COMMAND "./configure --without-boost" WORKING_DIRECTORY ${asio_SOURCE_DIR}/asio)
I could not find instructions for Windows and upon running CMake notices that Asio would generate a Visual Studio file so I fenced the instructions above on to be run on Unix platforms only.
But now I'm getting strange errors on Windows:
asio\include\generic\basic_endpoint.hpp(71): error c2039: 'protocol' is not a member of 'std::basic_string<chr, std::char_traits<<char>, std::allocation<char>>'
I also had an instance of asio::local::stream_protocol::endpoint that I had to change to asio::generic::stream_protocol::endpoint.
All of this code compiled and ran perfectly well on OSX.
Any idea what's going on?
Right, this was a dumb one. I'm compiling on Windows where Unix sockets don't exist.
Ah-to-the-duh.

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.

Compiling log4cplus using MinGW

I have:
- OS: WIndows 7
- MinGW, gcc 4.8.0.
- MSYS 7.2
- Dowloaded log4cplus-1.1.1 from it's website .
./configure - done well.
But at "make" I receive error with message "undefined reference Mutex::Mutex(Mutex::type)". I searched for ctors for that class inside code, it can be found at:
log4cplus-1.1.1\include\log4cplus\thread\syncprims-pub-impl.h
log4cplus-1.1.1\include\log4cplus\thread\impl\syncprims-pthreads.h
log4cplus-1.1.1\include\log4cplus\thread\impl\syncprims-win32.h
But I don't know how to order comlier use any of them. I checked in MakeFile, they included as include files, I added to config.cxx define WIN32, that still don't work.
How to order my compiler compile log4cplus correctly?
Please try the patch attached to ticket #282. This should be fixed on 1.1.x branch already.