Author Topic: codeblocks build on linux  (Read 4652 times)

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 96
codeblocks build on linux
« on: May 09, 2017, 06:22:15 am »
Hey,

I am trying to build codeblocks. I got 2 different ways to build the same.

1:  ./bootstrap ; ./configure ; make ; make install

2: ./bootstrap ; ./configure ; make dist ; cp codeblocks.spec ~/rpmbuild/BUILD/SPEC ; mv codeblocks.tar.bz2 ~/rpmbuild/SOURCES/ ; rpmbuild -ba codeblocks.spec ; rpm -Uvh --force ~/rpmbuild/RPMS/x86_64/codeblocks.rpm ~/rpmbuild/RPMS/x86_64/codeblocks-libs.rpm

I am new to linux. And I can't figure out the differences between the two after installation.
I know in 1st case we are just installing codeblocks while in 2nd case we are also packaging codeblocks. But whats the use of packaging?

Besides, building codeblocks in this way is taking 2-3 hours to build. Is it the general amount of time taken by codeblocks every time to build?

Also is there any way to debug the changes I made in source code ? (by building codeblocks in the same manner as listed above)
I am struck in the build system of codeblocks on linux.

Note: I am using codeblocks 16.01 src code; Linux fedora OS

Offline sodev

  • Regular
  • ***
  • Posts: 498
Re: codeblocks build on linux
« Reply #1 on: May 09, 2017, 08:42:14 am »
No, both ways are not doing the same.

The first one does a local install on the system, usually it gets put into /usr/local while the second one builds a package and installs it with the package management system of your os, in your case this should be rpm. Usually in the second case it should be installed under /usr. The package management system takes care of all dependencies and conflicts that may arise.

On your development machine usually all the dependencies are resolved and you just use make install, its faster and has less overhead than using rpm. You build a package if you want to install it on a different machine, basically this is setup.exe on linux.

Now your build times are pretty insane, maybe dont compile on a toaster ;D. Beside that, i dont know how these two build ways interact with each other, maybe switching between both always requires a full rebuild. Just do a regular build, after the initial build the following ones should be incremental and much faster. Oh and you do bootstrap and configure only once. Maybe you need to run configure again after you added or removed files, but not if you just made changes.

About debugging, run the program and see if it works? Use command line options to enable extra debug options? Check the configure script if it offers parameters to make a debug build?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: codeblocks build on linux
« Reply #2 on: May 09, 2017, 09:29:54 am »
You build a package if you want to install it on a different machine, basically this is setup.exe on linux.
This is not true - packages are useful because they can be fully uninstalled and so you can install newer version without chances of old files been left on disk.
Make uninstall is broken, so if someone would use make install for his/her main installation tool make sure you use a non-default --prefix and before make install do rf -rf <prefix>.

@anandamu16: If you want to debug codeblocks you can use both the make installed one (pass --enable-debug to configure) or you can build codeblocks from codeblocks. The latter is what most of us use.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: codeblocks build on linux
« Reply #3 on: May 09, 2017, 11:16:57 am »
ok thanks
Quote
2: ./bootstrap ; ./configure ; make dist ; cp codeblocks.spec ~/rpmbuild/BUILD/SPEC ; mv codeblocks.tar.bz2 ~/rpmbuild/SOURCES/ ; rpmbuild -ba codeblocks.spec ; rpm -Uvh --force ~/rpmbuild/RPMS/x86_64/codeblocks.rpm ~/rpmbuild/RPMS/x86_64/codeblocks-libs.rpm
On an avg, how much time should it take to complete all these steps ? Mine is more than 2 hours and I could not work like that.

Moreover, If I am even making a slight change, and try to build like the above mentioned 2nd method, Codeblocks build again takes 2-3 hours. It seems, anyhow it deletes all files generated before and start a fresh build. Any way to overcome this.?

At this point of time, I am more focused towards reducing the time for build. Kindly help

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: codeblocks build on linux
« Reply #4 on: May 09, 2017, 09:25:36 pm »
Yes, it is doing full rebuilds, because it needs to make reliable packages. rpmbuild is not intended for fast iteration times!
Just use codeblocks to build codeblocks. When you're ready with your changes you can make a package for more extensive testing.

For the record: On my works i7 5820 it is less than 10 minutes (I've not measured). On my home c2q 6600 @ 3.2ghz it is taking 20+ minutes. But I guess this is because there I build wx3 builds which are slower.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: codeblocks build on linux
« Reply #5 on: May 10, 2017, 09:27:45 am »
ok. Thanks. It seems I have to use a better machine

Also, I was recently working on scriptedwizard plugin and added a customized wizard (let's called it 'xyz').

codeblocks/src/plugins/scriptedwizard/wizard               added folder "xyz" including files required as well as makefile.in

codeblocks/                                                               register the names in configure.ac file


The problem is after installation my folder "xyz" is reflecting into installation directories (/usr/share/axcodeblocks/templates/wizard) but when I open codeblocks, project wizard is not visible. Any idea why is this problem?

P.S I have modified configure.script, restart codeblocks still not working