Install boost version 1.40 - c++

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

Related

How to install libpq-fe.h?

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

How to add the Audio/Video Property tab to Caja?

By default Caja does not come with the Audio/Video Properties tab that is present in Nautilus since... a very long time.
How can this tab be added?
gnome-mplayer includes an extension for caja since version 1.0.9-2:
https://code.google.com/p/gnome-mplayer/source/checkout
However, the version of gnome-mplayer-1.0.9-2 that comes from the Ubuntu repositories does not include the caja extension:
/usr/lib/caja/extensions-2.0/libgnome-mplayer-caja-properties-page.so
OR (for amd64):
/usr/lib/x86_64-linux-gnu/caja/extensions-2.0/libgnome-mplayer-caja-properties-page.so
I suspect that the reason is that when the .DEB was compiled, caja was not installed and thus not detected.
Therefore the only solution is to compile from source or use a deb compiled by someone else:
https://www.dropbox.com/s/x340ym3xeyhuosu/gnome-mplayer_1.0.9.2-2_amd64.deb?dl=1
https://www.dropbox.com/s/qm6nkgkaebddtrj/gnome-mplayer_1.0.9-1_i386.deb?dl=1
STEPS to compile:
Install dependencies:
Run the following as root:
apt-get build-dep gnome-mplayer
apt-get install make automake
apt-get install svn
apt-get install libcaja-extension-dev
Download source code with svn:
svn checkout http://gnome-mplayer.googlecode.com/svn/trunk/ gnome-mplayer
Compile
The make might complain that it cannot find automake-1.13 when you have automake-1.14
In order to resolve this run the following in the source folder:
aclocal
automake
./configure
make
after this all you need to do is to run:
make install OR checkinstall
Finally you might need to also install mplayer if you don't already have it.
Restart caja by logout/login or killall caja
Now you should have the property tab.
If you don't, check if you can open a movie with gnome-mplayer.
Let me know if you encounter any issues!
UPDATE: referenced dropbox package now installs the dependencies

Unable to locate package GLFW on Linux Mint

I have been trying to install GLFW and GLFW3, using Terminal to install
sudo apt-get install GLFW
sudo apt-get install GLFW3
Whenever I do so, I get results such as
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package glfw3
I have been trying to install GLFW for two hours now, and I'm getting a bit impatient. Also I'm very new to Linux (Mint), so I apologize if I'm doing something stupid...
EDIT:
No matter what I try, my program encounters
/home/myusername/Desktop/basic_window.cpp:11:21: fatal error: GL/glfw.h: No such file or directory
#include <GL/glfw.h>
^
compilation terminated.
Having a frustrating time with this, not sure why this is much more complicated than the other libraries I've installed so far.
I have been trying to install GLFW and GLFW3, using Terminal to install...
On Mint 17, it looks like you need to install libglfw2. So perform a sudo apt-get install libglfw2.
If you plan on developing against it, then install libglfw-dev instead. Notice the lack of a version number.
If interested, perform apt-cache search glfw
In Debian-based systems such as Ubuntu and Mint, library packages typically have names that begin with "lib", and development headers (for compiling new programs that use the library) are in a separate package whose name ends with "-dev".
Ubuntu 14.04 has GLFW 2 packaged as libglfw2 and libglfw-dev. Mint doesn't seem to have those packages, but you can probably use the Ubuntu ones since Mint 17 is based on Ubuntu 14.04.
GLFW 3 isn't in Ubuntu 14.04, but it looks like it'll be in 14.10 (as libglfw3 and libglfw3-dev).
Unless you really need GLFW 3 specifically, you're probably better off sticking with the packaged GLFW 2. Packages get easy automatic upgrades; compiling stuff "by hand" is a good way to end up with lots of cruft in your system with no automatic upgrade or uninstall.
Download GLFW source packages from their website.
Extract the folder glfw-3.0.4 from the tarball
Open console
Navigate to the folder you just extracted and go inside of it using cd
Type cmake . (be sure you include the dot)
If cmake . fails, then type the following as root:
apt-get install cmake
If you don't think you're root then type the following:
sudo apt-get install cmake
If that doesn't work then type the following as root, or add sudo if you're not root:
apt-get install build-essential cmake
Once you have cmake installed, navigate back to the folder and try cmake . again.

problems of installing kde runtime libraries on Linux

I am trying to install kde runtime libraries for kscope on Linux (2.6.18-308.11.1.el5).
http://kscope.sourceforge.net/install.shtml
I have downloaded kde-runtime-4.9.2 from ftp://ftp.kde.org/pub/kde/stable/4.9.2/src/
But, in the downloaded files, I cannot find INSTALL or other help files about how to install it.
Any help will be appreciated.
Thanks,
This is what you can do(assuming you are not on kubuntu):
1) add kubuntu's backports to your existing ppa(to gain access to KDE libraries):
# sudo add-apt-repository ppa:kubuntu-ppa/backports
2) Update the package index:
# sudo apt-get update
3) Install kdebase-runtime deb package:
# sudo apt-get install kdebase-runtime
this should work
cheers
kscope had it's latest release in 2008 and depends on KDE 3 libraries.
kdelibs 4 are incompatible with kdelibs 3. To get it running you need a distribution that still supports kde3. (or compile kde3 all yourself)
I suggest you use an alternative application - like KDevelop (you actually tagged your question with kdevelop)

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