Author Topic: Instructions for compilation on Debian Unstable  (Read 6914 times)

juliensorel

  • Guest
Instructions for compilation on Debian Unstable
« on: December 05, 2005, 08:01:13 pm »
I've had several problems installing Code::Blocks. Ubuntu .deb package didn't work, rpm's with alien failed, and when compiling from source autoconf and automake threw several errors (as Code::Blocks does not follow the usual rules for building from source, and its BUILD file is not helpful at all), the main compilation file was not executable and had DOS crlf, etc.

So, these are the steps to be followed to get this working (I think these instructions should be added to the BUILD file):

Previously:

1. Make sure you have the latest autoconf, automake and libtool ( 'apt-get update; apt-get install autoconf automake libtool' could do it if your sources are Internet repositories).
2. Run 'apt-get install sysutils'. You will need it for dos2unix.
3. Become root ( 'su -' ).

WXWIDGETS INSTALLATION

1. Download wxGTK-2.6.2.tar.gz from www.wxwidgets.org. No debian package seemed to provide the Code::Blocks required wx-config.
2. Run 'tar -xvzf wxGTK-2.6.2.tar.gz' (from a console, standing in the same directory as the file...)
3. Run 'cd wxGTK-2.6.2'
4. Run './configure --prefix=/usr' (if you don't want to compile the samples, check ./configure --help). I use that prefix so I don't have to use /usr/local/bin|lib. Disclaimer: if you set the prefix to /usr, compiled files could get overwritten by apt-get, as /usr/bin|lib is its territory. If you don't, you'll have to modify PATH and LD_LIBRARY_PATH before attempting Code::Blocks installation. Your choice...
5. Run 'make' and get a cup of tea. Later, go get a cup of coffee. Drink them slowly.
6. Run 'make install'

CODE::BLOCKS INSTALLATION

1. Download codeblocks-1.0rc2.tgz from www.codeblocks.org
2. Run 'tar -xvzf codeblocks-1.0rc2.tgz'
3. Run 'cd codeblocks-1.0rc2'
4. 'bootstrap' needs to be executed. Its permissions are wrong. Even if they were right, the line    have DOS terminators and you won't get much from this. As it is not the only file with this problem, run:
   'find . -type f -and -not -name "*.cpp" -and -not -name "*.h" -and -not -name "*.png" -and -not -name "*.bmp" | sed "s/.*/\"\\0\"/" | xargs dos2unix'
in a single line. WARNING: make sure you are in the right directory. You could mess your whole Linux box with this command...
5. Run 'sh bootstrap'. Some warnings could appear.
6. Run './configure --prefix=/usr'. As stated before, you can leave the prefix behind. If this command failed, you are missing some crucial Debian package. 'apt-get' and the packages section in www.debian.org are your friends.
7. Run 'make'. Check if there is some coffee left.
8. Run 'make install'.
9. Drop root privileges (Ctrl-D, if you made a 'su'), and run 'codeblocks'. Have fun !

takeshimiya

  • Guest
Re: Instructions for compilation on Debian Unstable
« Reply #1 on: December 05, 2005, 08:24:20 pm »
The wxWidgets compilation step is not requiered.

All debian (and most other distros) includes all the necesary packages for wxWidgets.
The wx-config util is in the wx-common package.

What do you refer that it doesn't follow usual rules for building from source (aside from the CRLF mistakes in RC2)?

Question: the boostrap file isn't usually called autogen in linux programs or I'm confusing it?

juliensorel

  • Guest
Re: Instructions for compilation on Debian Unstable
« Reply #2 on: December 06, 2005, 05:29:18 am »
Hi,

I couldn't find wx-config on wx-common for Debian unstable, nor with the Debian search for package contents:

$ dpkg -L wx-common
/.
/usr
/usr/share
/usr/share/aclocal
/usr/share/aclocal/wxwin.m4
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/wx-config.1.gz
/usr/share/man/man1/wxrc-tools.1.gz
/usr/share/doc
/usr/share/doc/wx-common
/usr/share/doc/wx-common/copyright
/usr/share/doc/wx-common/changelog.gz
/usr/bin
/usr/bin/wxrc
/usr/share/man/man1/wxrc.1.gz

There's a man page but wx-config is missing (don't know why). It could be present on Debian stable, however.

About the rules, I meant the following:
1. The package wasn't ready for ./configure && make && make install (as source code usually is)
2. Even if the user knew about autotools, autoconf && automake && ./configure... doesn't work either

I think the boostrap file is a hack to make crosscompilation possible. However, I think it is not necessary as a correct configure.in should be able to do the job. I've compiled a lot of packages and I've never seen this file. To make things worse, the BUILD file tells nothing about it, it has no execution permissions and has no extension. It is very easy to overlook (is this the word?) it, as I did, and I lost a whole hour browsing the forums to get a lead. I've seen autogen, but it is not present here. Again, my guess is that this file was created by some developer who knew a lot of autoconf and automake but chose a somewhat dirty hack instead of getting configure.in right for many platforms. It is only a guess, however. I'm no autotools guru so I may be missing something here.

Anyway, my point is that it is very easy to get trapped here, so the source tgz should at least have this file with only \n (it will work on Windows too, I promise), execution permissions (tar files keep them correctly) an a better BUILD file (at the very least). My post to the forums was intended to help Debian users, but it will only help those that can afford the bet of searching the forums.

Please excuse my english.

Yours,

Fernando del Valle
Mar del Plata, Argentina




willkn

  • Guest
Re: Instructions for compilation on Debian Unstable
« Reply #3 on: December 14, 2005, 06:02:02 am »
Just got codeblocks built and running on my Knoppix distro, thanks to the instructions in the wiki and from juliensorel above. However, I didn't need to do the 'find/sed/dos2unix' operation that juliensorel mentioned. Instead, I found that I only needed fix the files in the base directory and all of the Makefile.am files in the tree, by doing a 'find . -name "*.am" > fix-crlfs' and then adding the 'dos2unix' explicitly in front of the found files.

Also, I had to do 'export ACLOCAL_FLAGS="-I (my_local_path)/wxwidgets/share/aclocal"' instead of what the wiki instructions said, perhaps because I built wxwidgets and codeblocks in my home directory, which I do because I don't like to do 'make install' as root.

Reading the GNU Autotools book also helped me understand some of the problems with the bootstrap files. I'm finally moving into GNU/Linux development after being trapped for years in Windows hell because of my dependence on the Visual C++ IDE. I think an incredible job has been done in creating CodeBlocks as the first truly workable cross-platform C++ IDE/Debugger. I suspect it may finally enable a  large number of other trapped Windows developers to enter the greater open source world.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Instructions for compilation on Debian Unstable
« Reply #4 on: December 14, 2005, 09:12:48 am »
I'm finally moving into GNU/Linux development after being trapped for years in Windows hell because of my dependence on the Visual C++ IDE. I think an incredible job has been done in creating CodeBlocks as the first truly workable cross-platform C++ IDE/Debugger. I suspect it may finally enable a  large number of other trapped Windows developers to enter the greater open source world.

Freedom to the trapped developers!  :lol:
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Instructions for compilation on Debian Unstable
« Reply #5 on: December 14, 2005, 05:09:58 pm »
Finally! The prophecy is starting to be fulfilled! The exodus has begun. *rumble* :lol: