User forums > General (but related to Code::Blocks)

Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back

(1/7) > >>

Feneck91:
After 3 days to be able to compile Code::Blocks from scratch under ubuntu, I let here my experience...
STEP by STEP for neebies like me (under linux) !


--- Quote --------------------------------------------
| Installing and upgrading Cobe::Blocks |
-----------------------------------------

------------------------
 Linux (done on Ubuntu)
------------------------

STEP 1: INSTALLING
-------------------
1> Run Ubuntu Sofwate Center
2> In seach, type "codeblocks" and select "Code::Blocks IDE" item and clic "Install" button.
3> Clic "More Info" button and select "add-ons":
3.1> The GNU Debugger (gdb)
3.2> Contrib plugins for Code::Blocks IDE (codeblocks-contrib)
3.3> DO NOT SELECT: "wxWidgets Cross-platform C++ GUI Toolkit (GTK+ development) (libwxgtk2.8-dev)"
3.3> DO NOT SELECT: "wxWidgets Cross-platform C++ GUI Toolkit (common support files) (wx-common)"
4> Apply changes

Code::Blocks is now installed.

STEP 2: UPDATING
-----------------
To compile Code::Blocks we need
- GCC compiler (Is installed by default into Ubuntu install, else you need to install it).
- Code::Blocks itself
- wxWidgets library (I have choose to compile it by myself because if new wxWidgets version is published this help will be always correct, and you can choose to compile Code::Blocks with wxWidgets version upper than 2.8.x (2.8.12 when I writting these lines), 2.9 or 3.0 (not published yet) if you want).
- SVN tp get Code::Blocks sources from SVN repository.
- Lot of libraries to compile Code::Blocks plugins

1> Install SVN tool, I have choosen RabbitVCS (but you can choose any other), visit the following link and download your deb file to install it:
    - RabbitCVS official web site: http://rabbitvcs.org/
    - Download RabbitCVS deb file: http://wiki.rabbitvcs.org/wiki/download
  For ubuntu, type commands on terminal:
    - sudo add-apt-repository ppa:rabbitvcs/ppa
    - sudo apt-get update
    - sudo apt-get install rabbitvcs-core rabbitvcs-nautilus rabbitvcs-thunar rabbitvcs-gedit rabbitvcs-cli
2> Reboot to be able to use context menu of RabbitVCS.
3> Create Folder "CodeBlocksIDE", right clic into this folder and select "RabbitVCS SVN > Checkout..."
4> Type into URL field "svn://svn.berlios.de/codeblocks/trunk", destination update automatically with "your folder"/codeblocks folder, clic "OK" button.
    - All source code of Code::Blocks is checked out
5> Download BOOST library. Download wxWidgets (2.8.12) when I'm writting these lines.
    - Link: http://www.boost.org/
6> Install libgtk, type on termnal: "sudo apt-get install libgtk2.0-dev"
7> Download and compile wxWidgets
7.1> Download wxWidgets. Download wxWidgets (2.8.12) when I'm writting these lines.
        - Link: http://www.wxwidgets.org/downloads/
        - Choose: wxAll - all wxWidgets ports (other formats: bz2, zip)
7.2> Run commands:
        cd wxWidgets-2.8.12
        mkdir build_gtk2_shared_monolithic_unicode
        cd build_gtk2_shared_monolithic_unicode
        ../configure --prefix=/usr --enable-xrc --enable-monolithic --enable-unicode --enable-official_build --enable-optimise
        make
        sudo make install
        sudo ldconfig
     You can also make a batch file to make automatically 7.x steps:
        #--------------------------------------------------------------------------------------------------
        #!/bin/bash
        mkdir wxwidgets
        cd wxwidgets
        wget http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.8.12.tar.bz2
        tar xjf wxWidgets-2.8.12.tar.bz2
        cd wxWidgets-2.8.12
        mkdir build_gtk2_shared_monolithic_unicode
        cd build_gtk2_shared_monolithic_unicode
        ../configure --prefix=/usr --enable-xrc --enable-monolithic --enable-unicode --enable-official_build --enable-optimise
        make
        sudo make install
        sudo ldconfig
        wx-config --list
        cd ../..
        #--------------------------------------------------------------------------------------------------
8> Build Code::Blocks
8.1> Build Code::Blocks core
        - Run Code::Blocks and load project: "your folder"/codeblocks/src/CodeBlocks-unix.cbp
        - Menu: Build>Build Workspace
        - Menu: File>Close Workspace
8.2>  Build Code::Blocks plugins
8.2.1> Download libraries: plugins need libraries to be able to compile
     You can also make a batch file to make automatically 8.2.1.x steps:
        #--------------------------------------------------------------------------------------------------
        #!/bin/bash
        #
        #---------------------
        # Needed by libfam-dev
        sudo apt-get install libfam0
        #---------------------
        # File Manager Plugin needs FAM
        sudo apt-get install libfam-dev
        #---------------------
        # NassiShneiderman Plugin needs BOOST
        sudo apt-get install libboost-thread-dev
        #---------------------
        # wxSpellChecker Plugin needs hunspell
        sudo apt-get install libhunspell-dev
        #--------------------------------------------------------------------------------------------------

8.2.1.a) File Manager Plugin needs FAM so we need to install it. In directorymonitor.cpp:
            This line doesn't compile: #include <fam.h> //USES EITHER GAMIN OR FAM (IDENTICAL FILE MONITORING APIS)
          To install it, type command on terminal:
              sudo apt-get install libfam0                <---- Needed by libfam-dev          
              sudo apt-get install libfam-dev
8.2.1.b) NassiShneiderman Plugin needs BOOST so we need to install it. In CParser.cpp:
            These lines doesn't compile: #include <boost/spirit/include/classic.hpp>
                                         #include <boost/spirit/include/classic_core.hpp>
                                         #include <boost/spirit/include/classic_symbols.hpp>
                                         #include <boost/spirit/include/classic_confix.hpp>
          To install it, type command on terminal:
              sudo apt-get install libboost-thread-dev
8.2.1.c) wxSpellChecker Plugin needs hunspell so we need to install it. In hunspellInterface.cpp:
            These lines doesn't compile: #include "hunspell/hunspell.hxx"
          To install it, type command on terminal:
              sudo apt-get install libhunspell-dev
8.2.2> Compiles plugins
        - Run Code::Blocks (if not already done) and load project: "your folder"/codeblocks/src/ContribPlugins-unix.workspace
        - Menu: Build>Build Workspace
        - Menu: File>Close Workspace
9> Run "your folder"/codeblocks/src/update
10> It is done, to run code::blocks from this build, run "your folder"/codeblocks/src/output/run.sh

You can copy the output everywhere and run Code::Blocks with this run.
--- End quote ---

When running SpellChecker is not correctly configure, seems to missing some language files
Any idea ?
libFileManager cannot be loaded too.

MortenMacFly:

--- Quote from: Feneck91 on August 14, 2011, 11:14:57 pm ---When running SpellChecker is not correctly configure, seems to missing some language files
Any idea ?

--- End quote ---
The language files are not provided, as they are too large. You can (however) download / use the once of OpenOffice/LibreOffice etc.. Look inside the folder:
[C::B_SVN]\src\plugins\contrib\SpellChecker\dictionaries\
...for a "readme.txt" and read yourself through it. This will provide you with more information.

Jenna:
I suggest any newbies not to follow the above instructions, unless you really know what you do.

Use the official wxWidgets development packages provided by ubuntu.

Using your own wxWidgets packages only makes sense, if you want to contribute porting C::B to them.
wx 2.8.xx should work out of the box,  wx >= 2.9 does not work with C::B at the moment !!

Not only newbies will probably run in trouble, if they install their own packages into the systems folders. Using folders below the users home-directory works quite fine.
You can break your entire system, if you mix selfcompiled binaries (wx2.8.12 in this example) with officially provided packages of the (more or less) same sources.
Package maintainer often patch the official sources to fit the systems need or policies, overwriting the official binaries with your own can be dangerous.

The uninstall mecahnism of software created with automake (make uninstall) can lead to unexpected behaviour.
If you really want to install into system-folders, you should create packages, that can be removed cleanly.
Either create real packages (debian/ubuntu, rpm or whatever your distro provides) or use checkinstall to create packages on the fly.

If you do it as the OP suggested, you will most likely not get support in this forum, if the problems are related to the self-build stuff.

By the way, boost is also part of debian/ubuntu and all other major distros and the possible problems you can get if you do not use these packages are the same as with wxWidgets.

Be warned !

Feneck91:
Ok jens, no problem with it. If I remove point 7 (building own 2.8.x wxWidgets) and modify points :

--- Quote ---3.3> SELECT: "wxWidgets Cross-platform C++ GUI Toolkit (GTK+ development) (libwxgtk2.8-dev)"
3.4> SELECT: "wxWidgets Cross-platform C++ GUI Toolkit (common support files) (wx-common)"
--- End quote ---
Is this like good for you ?

I didn't write all to bother you. Just:

* I'm linux newbie and I have taken 3 days to compile my own Code::Blocks on linux from SVN like I do in Windows platform.
* Looking the Code::Blocks wiki, a lot of plugins doesn't compile.
* I'll need wxWidgets for my project (2.9.2) and would know how to build it.
* For boost,I just create a new ubuntu installation, and without sudo apt-get install libboost-thread-dev NassiShneiderman cannot compile. Perhaps another command line to install Boost ?
* And I would like to have the last Code::Blocks version without using Nightly Build.
And it's funny, plugins are not all the same from linux and windows, some are not exists into windows platform.
libFileManager cannot be loaded.... I don't know why, certainly a missing library.
Sorry for this post, you looks angry, but it was done to help user as I could, if you want you can delete it.

Best regards.

Jenna:
Here is my "short" version of what should be enough to build and install C::B from sources in debian/ubuntu.
It should work similar for the most major-distros, but the package names and the package-manager commands are slightly different.

On debian (and ubuntu and other derivates of debian) you need at least the following packages:

gcc, g++, make, automake, libtool, libwxgtk2.8-dev, wx-common, zip, libbz2-dev, zlib1g-dev and libstdc++6-4.x-dev (the exact version depends on your compiler, x can be 3, 4, 5 or 6 at the moment).
Install them by using
--- Code: ---sudo apt-get install gcc g++ make automake libtool libwxgtk2.8-dev wx-common zip libbz2-dev zlib1g-dev libstdc++6-4.6-dev
--- End code ---

For some plugins you need additional development packages:
libgtk2.0-dev for codenippets and mousesap,
libgamin-dev for filemanager,
libboost1.40-dev or libboost-dev >= 1.40 (depending on your distribution) for the nassi-shneiderman plugin,
libhunspell-dev for the spellchecker-plugin.

To fetch the svn-sources you also have to install subversion:
Create a folder where you want the C::B sources, change directory (cd) to it and call:

--- Code: ---svn co svn://svn.berlios.de/codeblocks/trunk .
--- End code ---
then run
./bootstrap
./configure --prefix=[/where/codeblocks/should/be/installed/to] --with-contrib-plugins=all
make
make install

Instead of all for contrib-plugins, you can chose only some of them, or exclude some of them, see ./configure --help for details.

Normally there is no need to do anything with ldconfig, because the (re)linking should be done correctly by the installation process.

Now you can run C::B with /where/codeblocks/should/be/installed/to/bin/codeblocks.

There should be no need to compile any packages on your own (except of C::B of course).

But if you want to avoid this also, just install C::B from my repo.
You do not need the most of the packages above in this case of course.

Navigation

[0] Message Index

[#] Next page

Go to full version