Вы находитесь на странице: 1из 2

BOOST README (for CN purposes).

At the time of writing, we use the following boost libs: DateTime Threads ---------INSTALLING BOOST-------------------------------------------------------In linux, you need to compile and make boost seperate. All the files you need are in the shared directory of the repo. Follow these steps: Goto to repo/trunk/shared/sw/boost_1_42_0/ and execute sh bootstrap.sh --with-libraries=thread

NOTE: if the above command fails to build (permission denied), run the following commands: 1. chmod 744 bootstrap.sh 2. chmod 744 tools/jam/src/build.sh 3. sh bootstrap.sh --with-libraries=thread

Next, execute: ./bjam --with-system --with-thread --with-date_time This installs the libraries in the correct spot, i.e. /repo/trunk/shared/sw/boost_1_42_0/stage/lib To use boost thread, link the following libraries in your makefile: -lboost_thread and -lpthread You will also need to add -static to your linker step to link boost statically. You will also need to add the boost root directory to your include path and your library path.

If you're running gcc less than 4.X, you will need to add -pthread to your compi le step. In windows, we don't actually reference the boost that's committed to the repo, instead we assume you installed it on the computer to: c:\program files\boost\boost_1_42 If you are compiling in VS2005 or V2008 using the BootPro installer. We also assume

you have installed the multithreaded debug and release libraries. The installer is available here: http://www.boostpro.com/download/boost_1_42_set up.exe From there, just add the lib include path and h files, and you're golden! For VS2010, the Installer libraries are not updated (yet). Do the followin for 2010: 1) Download Boost: 1.42 http://sourceforge.net/projects/boost/files/boost/1.42.0/boost_1_42_0.zip/downlo ad 2) Extract boost to c:\program files\boost\boost_1_42 You may need to rename a the directory that the zip file has to the one above. C:\Program Files\boost\boost_1_42 should have bootstrap.bat in it. Move folders until this is the case. 3) Run bootsrap.bat in C:\Program Files\boost\boost_1_42 from the command prompt 4) run .\bjam 5) Copy all files from C:\Program Files\boost\boost_1_42\stage\lib to C:\Program Files\boost\boost_1_42\lib Done! -----------------------------------------------------------------------------------------MODIFICATIONS TO BOOST-------------------------------------------------In the file boost_1_42_0\libs\thread\src\pthread\thread.cpp at line 185 the line int const res = pthread_create(&thread_info->thread_handle, 0, &thread_p roxy, thread_info.get()); was replaced with // [DIAMOND] Addded code to set the stack size to 50 MB size_t mystacksize; pthread_attr_t attr1; pthread_attr_init(&attr1); //attr1 is a global variable mystacksize =52428800; pthread_attr_setstacksize (&attr1, mystacksize); int const res = pthread_create(&thread_info->thread_handle, &attr1, &thr ead_proxy, thread_info.get()); //[DIAMOND] End of change This sets the soft stacksize limits for boost threads to be 50MB instead of 8MB ---------------------------------------------------------------------------------

Вам также может понравиться