GrabDuck

CodeLite, an open source, cross platform C/C++ IDE | Developers / Linux

:


To build CodeLite on you computer you will need these packages:

  • wxWidgets 3.0 or later
  • The gtk development package: often called libgtk2.0-dev or wxGTK-devel or similar
  • pkg-config (which usually comes with the gtk dev package)
  • The build-essential package (or the relevant bit of it: g++, make etc)
  • git
  • cmake

Use the following command to install the prerequisites for Ubuntu 14.04 / 14.10 / 15.04 / 15.10:


sudo apt-get install     \
        libwxgtk3.0-dev  \
        libgtk2.0-dev    \
        pkg-config       \
        build-essential  \
        git              \
        cmake            \
        libsqlite3-dev   \
        libssh-dev       \
        libedit-dev      \
        libhunspell-dev  \
        libclang-3.5-dev \
        clang-format-3.5 \
        xterm \
        liblldb-3.5-dev  

If your OS supports a higher version of libClang/libLLDB - use them, as long they use the same version (e.g. libclang-3.6-dev liblldb-3.6-dev)

Most modern and up to date Linux distros offer wxWidgets 3.0.X via their package manager which you can use for building CodeLite.

If your distro does not offer wxWidgets 3.0.X or later and you don't know how to build (or you're just lazy ...) you can download
and install a wxWidgets package from CodeLite's repository.

On Debian, use the following command to install the dependencies:


 sudo apt-get install libgtk2.0-dev \
                      pkg-config \
                      build-essential \
                      git \
                      cmake \
                      libsqlite3-dev \
                      libssh-dev \
                      libedit-dev \
                      libhunspell-dev \
                      xterm \
                      libclang-dev

If apt-get asks you for advice, press Y and ENTER.


When you have all required packages, you need to get codelite source code from git.

Run the following command in a terminal:


 git clone https://github.com/eranif/codelite.git

This will create a directory codelite which will contain the latest version of the CodeLite source code


The following assumes that you have wxWidgets installed in /usr/lib or similar. If you have a 'local' install elsewhere that isn't in your $PATH, you will need to point to it: see the tip at the end of the Debug section below.

Release


Compiling CodeLite in release mode is pretty straightforward.
Type the following commands from your terminal:


 cd codelite
 mkdir build-release
 cd build-release
 cmake -DCMAKE_BUILD_TYPE=Release .. -DCOPY_WX_LIBS=1
 make -j4
 sudo make install

CMake does not provide a sudo make uninstall target, if you wish to uninstall a self compiled CodeLite, use this command:
sudo xargs rm < install_manifest.txt

(If you aren't on a sudo-using distro, use su for the 'make install' step.)

CodeLite will be installed into the following folders:

  • /usr/bin - all binaries (scripts + executables)
  • /usr/lib/codelite - codelite's plugins + shared libraries
  • /usr/share/codelite - configurations, images and other misc files required by codelite

Debug (SKIP THIS IF YOU DON'T NEED DEBUG BUILDS OF CODELITE)


To compile CodeLite in debug mode it is recommended to install it somewhere inside your $HOME directory,
for example, in /home/<USER>/root

Now you need to tell cmake to compile CodeLite and install it under /home/<USER>/root:


 cd codelite
 mkdir build-debug
 cd build-debug
 cmake -G "Unix Makefiles" -DCOPY_WX_LIBS=1 -DCMAKE_BUILD_TYPE=Debug -DPREFIX=/home/<USERNAME>/root ..
 make -j4
 make install

Note that you don't need to be superuser for the 'make install' step as you are installing under your home dir.
Note 2: the -DPREFIX=/home/<USERNAME>/root installs CodeLite into the folder /home/<USERNAME>/root/bin/codelite and the plugins will go into /home/<USERNAME>/root/lib/codelite

You can now run CodeLite by typing from the command line:

 home/<USERNAME>/root/bin/codelite

To compile CodeLite using a different wxWidgets build, run cmake similar to this:
PATH=/path/to/my/other/wx/build:$PATH cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
Note: of course, you can change the cmake arguments to fit your needs...


cmake argument Example Mandatory? Comment
-DCMAKE_BUILD_TYPE=<Release|Debug|DebugFull> -DCMAKE_BUILD_TYPE=Release Yes Build configuration type for release|debug+optimisation|debug without optimisation
-DPREFIX="<some-prefix>" -DPREFIX=/home/eran/CL No Install codelite into a different directory. Default is set to /usr
-DENABLE_CLANG=1|0 -DENABLE_CLANG=1 No Build codelite with clang code completion support? Default is 1 (with clang)
-DMAKE_DEB=1|0 -DMAKE_DEB=1 No When set, a new make target is created by cmake, called package. Running make package thereafter will generate a .deb file for installation
-DWITH_PCH=1|0 -DWITH_PCH=1 No Support pre-compiled headers in the build
-DWITH_MYSQL=1|0 -DWITH_MYSQL=1 No Compiles Database Explorer plugin with MySQL support
-DGTK_USE_NATIVEBOOK=1|0 -DGTK_USE_NATIVEBOOK=0 No Under GTK, use the native book editor instead of the generic one. Default is set to 0