6

I want to install the boost libraries on Ubuntu 12.04 so I ran:

sudo apt-get install libboost-all-dev

but now searching for a folder named "boost" I cannot seem to find where the files have been installed? Do I have to run some sort of bjam command now or something? I am expecting to see some sort of boost folder hierarchy and then all the header and source files for the boost libraries?

  • 1
    Check ` /usr/local/boost_x_xx_x` – Mitch Jun 16 '13 at 5:55
  • 3
    try dpkg -L <package-name> – Olu Smith Feb 19 '14 at 15:48
  • Look for it at <code>/usr/include/c++/4.8/boost</code>. – Blu Cell Sep 15 '14 at 9:24
  • Do you have an Ubuntu system where Boost headers provided by the official Boost packages for Ubuntu are located there? That's not where they usually go. – Eliah Kagan Sep 15 '14 at 10:25
6

Boost header files are in /usr/include/boost.

When you install libboost-all-dev, a number of other specific packages are installed as dependencies.

These packages' also provide libraries and headers through an indirect mechanism. They declare packages with version numbers in their names as dependencies, and those packages are the ones that actually contain the library binaries and header files.

For example, libboost-dev is one of the packages installed as a dependency of libboost-all-dev.

libboost-dev declares just one package as a dependency. In 12.04, this package is libboost1.46-dev

libboost1.46-dev has dependencies too but its main purpose is to provide files directly. You can see these in its file list.

Boost header files have a .hpp extension. (Note that just .h is common for most other C++ libraries.) Many .hpp files are listed in libboost1.46 -dev's file list:

/usr/include/boost/accumulators/accumulators.hpp
/usr/include/boost/accumulators/accumulators_fwd.hpp
/usr/include/boost/accumulators/framework/accumulator_base.hpp
/usr/include/boost/accumulators/framework/accumulator_concept.hpp
  ....
/usr/include/boost/algorithm/minmax.hpp
/usr/include/boost/algorithm/minmax_element.hpp
/usr/include/boost/algorithm/string.hpp
/usr/include/boost/algorithm/string/case_conv.hpp
  ....
/usr/include/boost/aligned_storage.hpp
/usr/include/boost/any.hpp
/usr/include/boost/archive/add_facet.hpp
/usr/include/boost/archive/archive_exception.hpp
/usr/include/boost/archive/basic_archive.hpp
  ....

...and so forth.

You'll notice all those files are inside /usr/include/boost.


To find this information, I used packages.ubuntu.com, the online Ubuntu packages database.

People interested in finding specific information about what files are provided by Boost packages in their Ubuntu release, what packages provide them, and where they will be located on disk once installed can find that there.

Or, to get you started, here's a query that shows the libboost-all-dev package entries for all currently supported Ubuntu releases (and several others).

I got that by searching under Search package directories, changing Distribution to "any," and using libboost-all-dev as the search keyword.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.