How can i download and install llvm on Ubuntu 18.04? - llvm

I have llvm-6.0 and i=I don't know how to download and install llvm-7.0 on Ubuntu 18.04? Can I install it from terminal or I download from a site?

There are basically two ways to install LLVM on your Ubuntu 18.04 machine:
Source
Binary
Considering your question, it seems you would like to have a binary version of LLVM. Therefore you can install LLVM from your Ubuntu 18.04 terminal as following:
First of all, you should update packages as following:
sudo apt-get update
However, for custom LLVM i.e. in your case LLVM 7:
sudo apt-get install -y llvm-7
sudo apt-get install -y llvm-7 llvm-7-dev llvm-7-tools clang-7
Do you want some LLVM-7 examples?
sudo apt-get -y install llvm-7-examples
Do you want to remove LLVM-6?
sudo apt-get purge llvm-6.0 clang-6.0
sudo add-apt-repository --remove ppa:kxstudio-team/builds
For default LLVM installation you should run following (not for your case):
sudo apt install llvm
For detail packages please check LLVM Ubuntu nightly packages
However, currently the last version of LLVM is LLVM 13.0. 1. It is better to install the latest version.

Related

How to install python-mysqldb for Python 2.7 in Ubuntu 20.04 (Focal Fossa)?

I've tried "apt-get install python-mysqldb" which results in:
root#ps1svr:~# apt-get install python-mysqldb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-mysqldb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-mysqldb' has no installation candidate
Note: "apt-get install python3-mysqldb" works, however I have a lot of code written for Python 2.x which no longer runs, and this is causing enough problems that I'm probably going to have to reinstall Ubuntu 18.04
Also you can just add the Ubuntu 18.04 repositoery to install the python-mysqldb package:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
sudo apt update
sudo apt install -y python-mysqldb
This will download, build and install it for all users, using pip
sudo apt install libmysqlclient-dev python2.7-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python2.7 get-pip.py
sudo wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -O /usr/include/mysql/my_config.h
sudo pip2 install MySQL-python
Answer found from MySQLdb install error - _mysql.c:44:23: error: my_config.h: No such file or directory

Getting Boost 1.68 working on Ubuntu 18.04

I want to use Boost 1.68 on Ubuntu 18.04. I noticed the Boost/libboost package available on Ubuntu is only 1.65, so I found a resource that suggested the following:
sudo apt-get remove libboost-all-dev
sudo add-apt-repository ppa:mhier/libboost-latest
sudo apt update
sudo apt install libboost1.68
However, after running this I no longer have the boost include files in my /usr/include directory. If I do sudo apt-get install libboost-all-dev, it seems I can only add 1.65.1
Is there a way I can get boost and the include files from 1.68 to run on Ubuntu 18.04?
I'm still relatively new to Linux/ubuntu so perhaps I'm overlooking something simple? Thanks for your assistance.
By installing libboost1.68 you only install Boost library files. Header files are at libboost1.68-dev:
sudo apt install libboost1.68-dev

How do I install babel.messages module in Ubuntu?

I am trying to install using
sudo apt-get install babel.messages
but getting error:
ImportError: No module named babel.messages
Please let me know how to install in Ubuntu 16.04
Try that with using this command:
# pip install babel
It will work well
For Ubuntu versions older than 17.04, you can install python-babel from the Ubuntu repositories by running the following command in terminal:
sudo apt-get install python-babel
For Ubuntu versions from 17.04 and also on older versions you can install it via pip, the Python package manager as:
pip install babel
If you don't have pip installed yet, you can install it as:
sudo apt install python-pip

Debian Stretch and Jessie 32-bit libraries

For those looking for the answer, there it's, as it's not clear on other websites.
This is required at least by the Intel compiler. Maybe it helps also for other software.
Just run those commands in your terminal.
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential gcc-multilib rpm libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
Or as root remove the "sudo" from them.

Uninstall boost and install another version

I've installed the boost libraries on Linux Mint 12 using the command sudo apt-get install libboost-dev libboost-doc, which installs the default version available in the repositories. However, the project I have to do needs the 1.44 version of boost. How do I uninstall the default (current) version 1.46 and install 1.44?
I couldn't find the documentation on the boost website to install boost from the .tar.gz package.
Boost can installed by two ways
Deb package
wget and install manually
In some case we might have installed by both type which can cause version error. Lets see how to uninstall both.
sudo apt-get update
# to uninstall deb version
sudo apt-get -y --purge remove libboost-all-dev libboost-doc libboost-dev
# to uninstall the version which we installed from source
sudo rm -f /usr/lib/libboost_*
Then we need to install other dependencies if they are not met
sudo apt-get -y install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev
Lets download the boost version which we need from the link. I am downloading the 1.54 version. Then untar and install it.
# go to home folder
cd
wget http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
tar -zxvf boost_1_54_0.tar.gz
cd boost_1_54_0
# get the no of cpucores to make faster
cpuCores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | awk '{print $NF}'`
echo "Available CPU cores: "$cpuCores
./bootstrap.sh # this will generate ./b2
sudo ./b2 --with=all -j $cpuCores install
Now let's check the installed version
cat /usr/local/include/boost/version.hpp | grep "BOOST_LIB_VERSION"
You will see something like below
// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
#define BOOST_LIB_VERSION "1_54"
Version 1.54 of boost is installed
That's it, it worked for me. Let me know if you face any issues.
You can uninstall with
apt-get --purge remove libboost-dev libboost-doc
Download the package you need from boost website, extract and follow "getting started" instructions found inside index.html in the extracted directory.
Tested working Ubuntu 20.04 Use my script to uninstall your older version of boost in ubuntu 20.04 and follow rams instructions above
#!/bin/bash
sudo apt-get -y --purge remove libboost-all-dev libboost-doc libboost-dev
echo "clear boost dir"
sudo rm -r /usr/local/lib/libboost*
sudo rm -r /usr/local/include/boost
sudo rm -r /usr/local/lib/cmake/*
sudo rm -f /usr/lib/libboost_*
sudo rm -r /usr/include/boost
Downgrade your boost version. I'm not familiar with Mint, but assuming it is deb-based, you can do:
apt-cache show libboost-dev
to see all installable version and install a specific version with
sudo apt-get install libboost-dev=1.42.0.1
There are also convenience packages for the major boost versions:
sudo apt-get install libboost1.44-dev
As #savamane wrote you can uninstall it with
apt-get --purge remove libboost-dev libboost-doc
Another suggestion to install the .deb packages as suggested here. (Download the one fitted for your architecture though).
For still supported distros, you can simply search for the package at the distributions at http://packages.ubuntu.com/. For example libboost-system1.46.1 can be found in under the precise -> Libraries tab.
For unsupported distros, there is still a chance to find them at
http://archive.ubuntu.com/. For example can libboost-all-dev_1.40.0.1_amd64.deb be found in
http://archive.ubuntu.com/ubuntu/pool/universe/b/boost-defaults/.
This is how you install a specific Boost version:
cd boost_1_54_0/
./bootstrap.sh --with-libraries=atomic,date_time,exception,filesystem,iostreams,locale,program_options,regex,signals,system,test,thread,timer,log
sudo ./b2 install