Author Topic: ubuntu C::B questions  (Read 18162 times)

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
ubuntu C::B questions
« on: March 04, 2006, 10:05:13 pm »
Hello,

Yesterday, I have build my first C::B in ubuntu 5.10 :D. It was a bit difficult at the beginning (I am also a ubuntu newbie), but with the precious help of Daniel2000, the C::B wiki turorial and a Pecan's topic, I got it done :D. The version in question is rev2133 (gcc 4.0.2 Linux/unicode).

I have remarked a small problem. In the compiler's settings -->Programs-->Program Files, the Resource compiler label and combo are cut by half. Has someone else remarked this or it is just a local problem?

I have also remarked that the code completion cache has been de-activated and will be later taken out. Could I ask why?

I also would like to ask about building C::B in ubuntu. In Windows, after updating the project, I opened it and compiled C::B. In ubuntu, after updating the project with SVN, should I do

Quote
make unistall
./configure
make
make install

Or it would be simplier with the CodeBlocks-unix.cbp? I ask because make take me more than 1 hours to be completed :roll:.

I have also had problems by using make install, because of permission problems. I had to do sudo -i and then make install. I suppose that doing make unistall will require root rights? To avoid these "problems" should I build C::B by using a root shell?

Thank you very much.

Best wishes,
Michael

Alux

  • Guest
Re: ubuntu C::B questions
« Reply #1 on: March 04, 2006, 10:21:42 pm »
Code: bash
sudo make unistall
./configure
make
sudo make install
should do it - and im not even totaly sure you need to uninstall beforehand (feel free to correct me!)

one hour is quite a long build time in this case i think... what are your system specs?
also - once youve built once updating from svn should only get files that have changed, and make should only recompile files that have changed...

btw, depending on how new to ubuntu/linux you are
www.ubuntuguide.org (though for 5.04) has lots of handy info, and the offial wiki is crammed with helpfull info too
whats more there are a couple of handy apps such as easyubuntu(quite safe i tihnk) and automatix(heard complaints,mainly from people who tried to dist-upgrade after using this) that can install all sorts of goodness automaticly (such as a whole bunch of codecs, new ver of wine, java 1.5 etc)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: ubuntu C::B questions
« Reply #2 on: March 04, 2006, 10:37:11 pm »
Quote
Code
sudo make unistall
make
sudo make install

This should do it. Note that you must uninstall first, or else when linking the app and plugins it uses the libcodeblocks.so previously installed (instead of the one you create with 'make'). Don't know why yet...

And, of course, don't forget that you can build it using codeblocks-unix.cbp ;)
After you build C::B succesfully once using 'configure' and install it, you can build C::B using itself. So everything will be like in windows world (run 'update' afterwards, etc).
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: ubuntu C::B questions
« Reply #3 on: March 04, 2006, 10:37:29 pm »
Code: bash
sudo make unistall
./configure
make
sudo make install
should do it - and im not even totaly sure you need to uninstall beforehand (feel free to correct me!)

Thank you :D. I am not sure that I have to unistall it. May be just when I will have some compilitation/linking issues. I was wrong here. Sorry. Mandrav pointed out that you have to first make unistall.

one hour is quite a long build time in this case i think... what are your system specs?

I have a Desktop with PIII 500 MHz and 512MB RAM. It is not the maximum, but it is only thing I have got from my institute (as secondary computer). And ubuntu works relatively fine (much better than a Windows XP would have been done :)).

also - once youve built once updating from svn should only get files that have changed, and make should only recompile files that have changed...

In this case, I should avoid a make unistall. If not it will re-build all from the beginning.

btw, depending on how new to ubuntu/linux you are
www.ubuntuguide.org (though for 5.04) has lots of handy info, and the offial wiki is crammed with helpfull info too
whats more there are a couple of handy apps such as easyubuntu(quite safe i tihnk) and automatix(heard complaints,mainly from people who tried to dist-upgrade after using this) that can install all sorts of goodness automaticly (such as a whole bunch of codecs, new ver of wine, java 1.5 etc)

Thank your for the info.

Actually, I am fighting with the root's permission. I have my C::B executable in /usr/local/bin, but I cannot do a shortcut to put in my desktop :D.

Best wishes,
Michael
« Last Edit: March 04, 2006, 10:45:40 pm by Michael »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: ubuntu C::B questions
« Reply #4 on: March 04, 2006, 10:42:25 pm »
Quote
Code
sudo make unistall
make
sudo make install

This should do it. Note that you must uninstall first, or else when linking the app and plugins it uses the libcodeblocks.so previously installed (instead of the one you create with 'make'). Don't know why yet...

Ah, Ok. So, I was wrong in my previous post (I will edit it). Thank you for pointing this out :).

And, of course, don't forget that you can build it using codeblocks-unix.cbp ;)
After you build C::B succesfully once using 'configure' and install it, you can build C::B using itself. So everything will be like in windows world (run 'update' afterwards, etc).

I think I will be more comfortable with this solution :D. I have quite never used make and friends, but I suppose that it should not be so difficult to understand and use them.

Best wishes,
Michael

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: ubuntu C::B questions
« Reply #5 on: March 05, 2006, 01:24:22 am »
With any hope you shouldn't have to do a full rebuild every time, make is smart enough to work out the dependencies and only rebuild what is needed based on file changes.  I would also stick with make when building codeblocks (if your are working on CB itself its obviously better to use CB to build itself), especially if you aren't doing a full rebuild.  Make is currently the fastest build system and I doubt that codeblocks custom system is any faster.  I will test this though.  Currently when I do a full rebuild I do the following:

Code
# Gets rid of all created files
make distclean
svn up
# These two are just to make sure I catch any changes to these files
./bootstrap
./configure --prefix=/home/myusername/Apps/codeblocks-svn
make
make install

I have never had to "make uninstall", make just overwrites the old files in my home directory.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: ubuntu C::B questions
« Reply #6 on: March 05, 2006, 01:27:49 am »
Code
# Gets rid of all created files
make distclean
svn up
# These two are just to make sure I catch any changes to these files
./bootstrap
./configure --prefix=/home/myusername/Apps/codeblocks-svn
make
make install

Thank you for your help and explanations :). I will give it a try.

Best wishes,
Michael

takeshimiya

  • Guest
Re: ubuntu C::B questions
« Reply #7 on: March 05, 2006, 01:28:19 am »
I will test this though.
If you're going to test it, just make sure to disable all plugins except the Compiler plugin (CodeCompletion esp. is known to make the build slower).

Or test both cases.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: ubuntu C::B questions
« Reply #8 on: March 05, 2006, 08:50:57 am »
Make is currently the fastest build system and I doubt that codeblocks custom system is any faster.

I would doubt that, but feel free to test it and share your findings with us :)
Be patient!
This bug will be fixed soon...

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: ubuntu C::B questions
« Reply #9 on: March 05, 2006, 09:07:33 am »
I would doubt that, but feel free to test it and share your findings with us :)

Will do, but please see reviews of other build systems here and here.  By presuming that CB build system is slower than make I am not trying to insult codeblocks.  I am just saying that make is currently faster than almost everything else and its a much more mature product and there more likely to be better optimized.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: ubuntu C::B questions
« Reply #10 on: March 05, 2006, 09:17:00 am »
By presuming that CB build system is slower than make I am not trying to insult codeblocks.

I didn't take it as such :)
But I happen to know the inner workings of C::B build system really good. I know the exact differences it has with make. The only bottleneck for C::B is the actual logging. It's logging in a wxTextCtrl whatever this means in terms of speed. But even so, I think it's still faster than running make from the command line.

And don't forget: C::B used to use make too. Guess why it was dropped in favor of the new build system ;) (yes, I had run speed tests).
Be patient!
This bug will be fixed soon...

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: ubuntu C::B questions
« Reply #11 on: March 05, 2006, 09:46:45 am »
Well on my machine for a full build I get the following:

Full Build:
Make: 8:34
CB: 4:28

Code::Blocks is the winner.  That is awsome, why is CB so fast on the full builds?  Are the auto make files inefficient, it does look like they throw a little more info at the compiler.  Are the auto tools scripts use precompiled headers?  I am going to do incremental builds next.

For these after the full build I changed one line in cbeditor.h, and then built them again.
Incremental:
CB: 3:16
Make: Not Done Yet
« Last Edit: March 05, 2006, 09:52:24 am by Game_Ender »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: ubuntu C::B questions
« Reply #12 on: March 05, 2006, 09:56:04 am »
Are the auto make files inefficient, it does look like they throw a little more info at the compiler.  Are the auto tools scripts use precompiled headers?

Yes, they do use precompiled headers (as long as your compiler supports them and you didn't pass --disable-pch in configure).
But, note that the PCH created by C::B cannot be used by make and vice-versa. Maybe you didn't notice it and make didn't use the PCH?
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: ubuntu C::B questions
« Reply #13 on: March 05, 2006, 10:21:59 am »
OK, here are the results:


uname -a
Linux amd64 2.6.12-10-amd64-generic #1 Mon Feb 13 12:14:05 UTC 2006 x86_64 GNU/Linux

Make build:
-----------
make clean
./configure --enable-contrib=no --prefix=/usr
time make

real    9m17.087s
user    6m31.024s
sys     1m19.279s

C::B full rebuild (added "-O2 -ffast-math" in project to match make options):
------------------------------------------------------------------
Process terminated with status 0 (8 minutes, 40 seconds)
0 errors, 19 warnings

C::B full rebuild ("stock" project options):
------------------------------------------------------------------
Process terminated with status 0 (4 minutes, 40 seconds)
0 errors, 8 warnings


As you see, C::B is in fact faster than make but not as much as your tests showed (probably due to the PCH issue I pointed out).
« Last Edit: March 05, 2006, 10:30:46 am by mandrav »
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: ubuntu C::B questions
« Reply #14 on: March 05, 2006, 10:25:58 am »
If you're going to test it, just make sure to disable all plugins except the Compiler plugin (CodeCompletion esp. is known to make the build slower).
Your tips amaze me every day anew... :lol:

Quote from: mandrav
added "-O2 -ffast-math" in project
Good catch :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."