How can I install boost multiprecision library in ubuntu - c++

I installed boost library in my ubuntu 12.04 machine using the following command:
sudo apt-get install libboost-all-dev
But when I checked /usr/include/boost, I don't see header files for multiprecision package (cpp_dec_float.hpp). Do I need to install it separately?

Boost.Multiprecission is present in Boost 1.53 onwards.
http://www.boost.org/doc/libs/1_53_0/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html
If you install libboost-all-dev metapackage from precise repository by dependncy you get libboost-dev and by dependncy you also get libboost1.46-dev which is unfortunately too old.
http://packages.ubuntu.com/precise/libboost-all-dev
http://packages.ubuntu.com/precise/libboost-dev
http://packages.ubuntu.com/precise/libboost1.46-dev
You might try your luck with some PPA repository.
E. g. this one:
https://launchpad.net/~apokluda/+archive/ubuntu/boost1.53
and install the package following this tutorial.
https://charmie11.wordpress.com/2013/10/27/install-boost-1-53-on-ubuntu-by-package-manager/

Related

Install A Specific Version of Boost With Homebrew on Mac

I am trying to install an older version of Boost on my Mac using Homebrew.
I am using:
brew install boost#1.53
And receiving error:
Error: No available formula with the name "boost#1.53"
I have performed:
brew search boost
And I can see that I have all versions back to 1.55 installed.
Is there a way round this, how can I install 1.53?
Git clone the boost code, checkout the version that you want and compile.

How to install previous version (4.4.7) of gcc/g++ via apt-get in ubuntu 14.04?

Due to legacy issues I have to install the gcc/g++ version 4.4.7 in my current Ubuntu-gnome 14.04 32 bit virtual machine.
The default update via apt-get install is the 4.8.2 which is a "no go" work for this project.
I've removed it (apt-get remove) . The downloaded and tried to install the 4.4.7 source but it requires to many dependencies.
Via apt-get install I've tried doing:
sudo apt-get install gcc-4.4
The download/install is quite fast and when checkign gcc version it give indication that no gcc is installed to run the
sudo apt-get install gcc
If I do this I'll get the 4.8version.
All above also applies to g++.
I compiled the code with the following flag which solved the problem:
g++-4.4.7
It compiles for a specific version. (in this case 4.4.7)
To install a specific version use sudo apt-get install package=version. Or use synaptic package manager which allows you to install specific versions.

Install boost version 1.40

I am using a server running with Ubuntu 12.04
I want to install the boost libraries in it. I know
sudo apt-get install libboost-all-dev
will make the work done, but it installs the latest version version 1.52 or above.
But I need to install the particular version 1.40 as there is a problem in a simulator which I am using for my academic purpose. What is the particular command for that so that I can install the boost libraries along with the other requirements for it like the linking files
Thanks in advance
Quick answer: sudo apt-get install libboost-dev= 1.40.0.1
If it doesn't work, continue reading.
The apt-get does support installing a particular version of a package as long as it is in an archive that apt knows about. From the apt-get manpage:
A specific version of a package can be selected for installation by following the
package name with an equals and the version of the package to select. This will
cause that version to be located and selected for install. Alternatively a specific
distribution can be selected by following the package name with a slash and the version of
the distribution or the Archive name (stable, frozen, unstable).
For e.g. if you wanted to install apache 2.20 for Ubuntu, you would do something like:
sudo apt-get install apache2=2.2.20-1ubuntu1
Note that you may need to do some dependency resolution on your own in this case, but if there are any problems apt-get will tell you what is causing them. For e.g.(on 11.04)
sudo apt-get install apache2=2.2.20-1ubuntu1 \
apache2.2-common=2.2.20-1ubuntu1 \
apache2.2-bin=2.2.20-1ubuntu1 \
apache2-mpm-worker=2.2.20-1ubuntu1
Note: You must first check if build 1.40 is still available. For that use:
aptitude search libboost
If aptitude search command don't give you sufficient results, try sudo aptitude update and then run aptitude search again.
You might have to investigate whether debs from earlier Ubuntu versions can be installed. i.e. remove the current package, download the debs and try installing them. But there could be dependency on older versions of the standard library.If so, you can probably try downloading the source from launchpad.
As a last resort, download from boost.org and build it - painfully!
EDIT: I see you have asked the same question on ubuntu forums and it seems that you have 1.48 as the default. You might have to build the library itself. Can you try this apt-get
sudo apt-get install libboost1.40-all-dev=1.40.0-4ubuntu4
If this doesn't work, you will have to build it and install it yourself. You can download the source from
Download source (1.40.0): libboost 1.40.0 source files
After it's installed, run the following command to hold your installed version, preventing the package manager from automatically updating it in the future:
sudo echo "[packagename] hold" | sudo dpkg --set-selections
Source:How to Downgrade Packages on Ubuntu
Generally you download sources, build it (some parts are not just headers like filesystem on Windows). Then you can select which subset of libraries you want to install (you can make compact version with only what you need). Then by invoking bootstrap script you build it to another directory this subset of libraries you want and then you invoke install.
Here is a pretty good description how to do it: http://ubuntuforums.org/showthread.php?t=1180792

Compiling all of the boost libraries on Unix?

I used one of the ubuntu package manager commands to install all of the boost libraries. I think the command was
sudo install something libboost
I am aware that some of the boost libraries need to be compiled separately (or something similar). How do I go about doing this so that I can use them along with the regular libraries?
sudo apt-get install libboost-all-dev

How do you install Boost on MacOS?

How do you install Boost on MacOS?
Right now I can't find bjam for the Mac.
You can get the latest version of Boost by using Homebrew.
brew install boost.
Download MacPorts, and run the following command:
sudo port install boost
Just get the source, and compile Boost yourself; it has become very easy. Here is an example for the current version of Boost on the current macOS as of this writing:
Download the the .tar.gz from https://www.boost.org/users/download/#live
Unpack and go into the directory:tar -xzf boost_1_50_0.tar.gz
cd boost_1_50_0
Configure (and build bjam):
./bootstrap.sh --prefix=/some/dir/you/would/like/to/prefix
Build:
./b2
Install:./b2 install
Depending on the prefix you choose in Step 3, you might need to sudo Step 5, if the script tries copy files to a protected location.
Unless your compiler is different than the one supplied with the Mac XCode Dev tools, just follow the instructions in section 5.1 of Getting Started Guide for Unix Variants. The configuration and building of the latest source couldn't be easier, and it took all about about 1 minute to configure and 10 minutes to compile.
Install both of them using homebrew separately.
brew install boost
brew install bjam
Fink appears to have a full set of Boost packages...
With fink installed and running just do
fink install boost1.35.nopython
at the terminal and accept the dependencies it insists on. Or use
fink list boost
to get a list of different packages that are availible.
Install Xcode from the mac app store.
Then use the command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
the above will install homebrew and allow you to use brew in terminal
then just use command :
brew install boost
which would then install the boost libraries to <your macusername>/usr/local/Cellar/boost
In order to avoid troubles compiling third party libraries that need boost installed in your system, run this:
sudo port install boost +universal
Try +universal
One thing to note: in order for that to make a difference you need to have built python with +universal, if you haven't or you're not sure you can just rebuild python +universal. This applies to both brew as well as macports.
$ brew reinstall python
$ brew install boost
OR
$ sudo port -f uninstall python
$ sudo port install python +universal
$ sudo port install boost +universal
you can download bjam for OSX (or any other OS) here
If you are too lazy like me:
conda install -c conda-forge boost