Building the Boost library to run natively on Intel(R) Xeon Phi(tm) Coprocessor

This article provides instructions to custom build the Boost library to run in native mode on Intel(R) Xeon Phi(tm) Coprocessor, as well as verify the build is working properly.   The instructions are written assuming you have a copy of the Intel(R) C++ Compiler installed on your system.

The Boost library version used here is 1.49 (and has also been verified for version 1.48). The instructions are based on the “Getting Started on UNIX Variants” guide.Please refer to this guide for help on additional configuration options. provides free peer-reviewed portable C++ source libraries.

Steps to build Boost library for Intel(R) Xeon Phi(tm) Coprocessor:

  1. Download boost_1_49_0.tar.gz from
  2. In the directory where you want to put the Boost installation, uncompress the downloaded Boost distribution:  tar zxvf boost_1_49_0.tar.gz
  3. Change your current directory to the Boost root directory (created by the above command):  cd boost_1_49_0
  4. Setup the Intel compiler build environment to prepare for cross-compiling targeting Intel Xeon Phi Coprocessor:  source /opt/intel/composerxe_mic/bin/ intel64 
  5. Run the Boost bootstrap script :./
  6. Run bjam with Intel toolset selected: ./bjam toolset=intel --disable-icu --without-iostreams cflags="-mmic" cxxflags="-mmic" linkflags="-mmic"


Please refer to the  Intel compiler reference manual for additional relevant compiler/linker flags that may be used.

The above steps will build static and shared non-debug multi-threaded variants of the libraries. To build all variants, pass the additional option, “--build-type=complete”.


Steps to verify the Boost build and run it on the MIC platform:

 To verify the build process and demonstrate linking with the Boost library, the Boost.Regex based example from step #6 of the “Getting Started on UNIX Variants” guide is used. Note that this example does not provide comprehensive coverage on Boost usage but it is used here for sanity check only

  1. Copy the aforementioned example into a file called "boot_test.cpp"
  2. Build the test-program to run in native-mode on Intel Xeon Phi Coprocessor: icpc -mmic -vec-report2 -I . boost_test.cpp ./stage/lib/libboost_regex.a -o boost_test 
  3. Copy the test program’s binary to the coprocesor:  sudo scp boost_test 
  4. Log onto the coprocessor and change directory to /tmp: sudo ssh root@
  5. cd /tmp
  6. Create an input file to be processed by the test program:  (example): cat test.txt

To: George Shmidlap

From: Rita Marlowe

Subject: Will Success Spoil Rock Hunter?


See subject.

Lastly, run the test program with the aforementioned input file: ./boost_test < test.txt

If this runs successfully, it should return:   "Will Success Spoil Rock Hunter?"

For more complete information about compiler optimizations, see our Optimization Notice.


Ekaterina T.'s picture

Dear support!
Is there any new advices for building new version of the Boost library (1.61.0) for Intel Xeon Phi 7110?

Thank you for your time!


Jared H.'s picture


  1. Copy the aforementioned example into a file called "boot_test.cpp"

instead of

  1. Copy the aforementioned example into a file called "boost_test.cpp"
Daniel S.'s picture

It seems not working with windows. When I tried to use /Qmic instead of -mmic and icl instead of icpc, I always get link error with boost libs. Can anyone help me with this? Thanks!

David Y.'s picture

I can't seem to get this to work with boost 1.55. I am using icc 14.03. Is there something I'm doing wrong? It only seems to build successfully if I build it statically.


Andrey Tikhonov's picture

Cool! Thanks for information. Are there already any tests to feel the difference?

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.