How to install SublimeClang on Archlinux

SublimeClang is a cool and useful extension for SublimeText which enables IDE features for C++ programmers.
Here are the installation instructions for Linux from their github page.

There are two problems with the installation on Archlinux.

Problem A

SublimeText looks for Python 2.6. Archlinux has Python 3 and Python 2.7,

Solution

Step 1

Install python26 from AUR.

Step 2

Create a symlink to the new Python 2.6 installation in the right place for SublimeText to find, as root (sorry, I don’t know how to solve it without creating a symlink as root).

ln -s /lib/python2.6/ /opt/sublime-text/lib/python2.6

Problem B

When trying to build libcache the build environment won’t find libclang.so and will try to build it and fail.

Solution

Copy the file to a place where it will be found.

cp /usr/lib/llvm/libclang.so ~/.config/sublime-text-2/Packages/SublimeClang

Now clean the build environment if needed and run the cmake and make commands as written in the instructions.

It should work now. Tested on Archlinux 64 bit.

2 thoughts on “How to install SublimeClang on Archlinux

  1. hey – need help with this…

    still having problems with it..
    cp /usr/lib/llvm/libclang.so ~/.config/sublime-text-2/Packages/SublimeClang
    returns
    cannot stat ‘/usr/lib/llvm/libclang.so’: No such file or directory

    i found libclang.so in /usr/lib/

    copied it to the folder of sublimeclang
    and tried to run cmake ..

    the output:
    $ cmake ..
    — The C compiler identification is GNU 4.8.2
    — The CXX compiler identification is GNU 4.8.2
    — Check for working C compiler: /usr/bin/cc
    — Check for working C compiler: /usr/bin/cc — works
    — Detecting C compiler ABI info
    — Detecting C compiler ABI info – done
    — Check for working CXX compiler: /usr/bin/c++
    — Check for working CXX compiler: /usr/bin/c++ — works
    — Detecting CXX compiler ABI info
    — Detecting CXX compiler ABI info – done
    — Performing Test TR1_MEMORY
    — Performing Test TR1_MEMORY – Success
    — Looking for clang_getExpansionLocation
    — Looking for clang_getExpansionLocation – not found
    — Looking for clang_getExpansionLocation
    — Looking for clang_getExpansionLocation – found
    — Configuring done
    — Generating done

    please help…

    • Sorry but I didn’t use it with cmake. I don’t think it’s related to SublimeClang.

Leave a Reply

Your email address will not be published. Required fields are marked *