Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

llvmpy on Ubuntu 14.04

Tags:

python

llvm

I am trying to install llvmpy on ubuntu 14.04.

uname -a 
Linux -esktop 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty

sudo pip install llvmpy fails. The end of the output is

Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/llvmpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7HvRcB-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/llvmpy
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)

I have llvm version 3.4 installed. The full output is at http://paste.ubuntu.com/8074574/ .

like image 745
graffe Avatar asked Aug 17 '14 21:08

graffe


People also ask

Does Ubuntu come with LLVM?

LLVM toolset is available in the official package repository of Ubuntu 22.04 LTS. So, you can easily install it with the APT package manager.

Where is LLVM installed?

The binaries for LLVM tools are placed in ~/llvm/build/bin . These tools are used to run the LLVM passes. To make it easy to run the tools, it is a good idea to add the path to the binaries to the bash PATH variable so that you can invoke the tools from any directory.


1 Answers

llvmpy requires llvm 3.3 at the moment. This is available, but not the default on Ubuntu 14.04 (which defaults to the newer llvm 3.4). First, install llvm3.3:

sudo apt-get install llvm-3.3 llvm-3.3-runtime

Then, we need to tell pip to use the older llvm.

sudo sh -c "LLVM_CONFIG_PATH=/usr/bin/llvm-config-3.3 pip install llvmpy"

The above should also work for python3 using pip3

like image 159
Scott Ritchie Avatar answered Oct 10 '22 03:10

Scott Ritchie