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?

4
  • 1
    Check ` /usr/local/boost_x_xx_x`
    – Mitch
    Jun 16, 2013 at 5:55
  • 3
    try dpkg -L <package-name>
    – Zuko
    Feb 19, 2014 at 15:48
  • Look for it at <code>/usr/include/c++/4.8/boost</code>.
    – Mokhtar
    Sep 15, 2014 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. Sep 15, 2014 at 10:25

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .