Author Topic: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back  (Read 31028 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #15 on: September 26, 2011, 12:06:49 am »
Quote
To install the actual release version instead of the nightlies using apt or one of its frontends please add the following lines to your /etc/apt/sources.list :

Code
deb http://apt.jenslody.de/ any release
deb-src http://apt.jenslody.de/ any release
This is from the repo's description...
(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!]

BentFX

  • Guest
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #16 on: September 26, 2011, 12:51:47 am »
Quote
To install the actual release version instead of the nightlies using apt or one of its frontends please add the following lines to your /etc/apt/sources.list :

Code
deb http://apt.jenslody.de/ any release
deb-src http://apt.jenslody.de/ any release
This is from the repo's description...

If that was directed at me I'll say it again, NO! Everybody and their cat has a flippin' repo. I don't mean to be disrespectful, but it'll probably be another two years before I update c::b again. I'm not going to have it nag me through update manager till then. as long as it does what I need, I would prefer not to screw with it, and every update is just another chance to break the "does what I need" feature.

And quite certainly, if every update was as difficult as this one I'd never update again. Compiling was easy... Getting it to run was a bit of a trick... Then I posted to the stinking forum... What a headache!


Offline Freem

  • Almost regular
  • **
  • Posts: 219
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #17 on: September 26, 2011, 10:43:26 am »
Ahemmmm... We are speaking about nightly builds, here.
So it is obvious that it can break some features, as they are considered like beta versions. But in facts, it's really uncommon to have more problems with them than with the official and old release.

Compiling have more chances to break something than using an official repo of the project. (yes, jens is an official developper, here) Because you probably (well, only probably) now less things about the code and its dependencies than him.

Offline BentFX

  • Multiple posting newcomer
  • *
  • Posts: 18
    • BentFX
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #18 on: September 26, 2011, 01:10:41 pm »
if (RANT_MODE) {

My original runtime error was...
Quote
codeblocks: symbol lookup error: codeblocks: undefined symbol: _ZTI17wxScrollingDialog
This missing symbol is in libcodeblocks.so.0 I've verified that by dismantling the libcodeblocks0_xxx.deb

Another fun fact... the libcodeblocks postinst and postrm both run ldconfig. Understand that? Install from the deb, it runs ldconfig. The same is also true for libwxsmithlib.so.0, the other library that wasn't found when I first built and installed.

So that brings up the question, if the package manager needs to run ldconfig, why is it so disrespectful if I run it, especially when it sorts out the issue with libraries not being found?

It also brings up the question, as posed elsewhere in this thread, with a twist... If the installer isn't editing /etc/ld.so.conf, why is it running ldconfig? Shouldn't we file a bug report?

This would also bring up another question, from elsewhere in this thread... If the user has parallel installs of c::b and they are all keyed to their individual libraries, does that user not use the package manager? Or more likely is ldconfig being run by the package manager and isn't breaking anything? This is the fact... ldconfig stays within its configured directories. If you put libraries in /usr/lib they may have their symbolic links manipulated. If you have libraries in /some/odball/path/to/your/custom_c::b ldconfig will never touch them.

I point your attention to the Debian Policy Manual section 8.1.1...
Quote
Any package installing shared libraries in one of the default library directories of the dynamic linker (which are currently /usr/lib and /lib) or a directory that is listed in /etc/ld.so.conf[58] must use ldconfig to update the shared library system.
libcodeblocks.so.0 and libwxsmithlib.so.0 are the only two files that go into the base /usr/lib or in the case of "make install" without a --prefix /usr/local/lib. On a recent Ubuntu /usr/local/lib is listed in /etc/ld.so.conf by default and thus is managed by ld.so.

Now a bit more I've found by digging... LD_LIBRARY_PATH has been broken(by design?) in Ubuntu since 9.04 (Ubuntu bug #366728). There is no global LD_LIBRARY_PATH. The man page for ld.so says the library search is three fold, first LD_LIBRARY_PATH(which doesn't exist), then the ld.so.cache, then /lib and /usr/lib. By that it would seem that the libraries in /usr/local/lib would never be found until ldconfig was run to add them to the ld.so.cache. It really seems kinda straight forward. There was no way to make it work except to run ldconfig, or manually move the files, or create symlinks, in a lower directory, and that certainly wouldn't be the correct action.

Next lets have a discussion about /usr/local...

On a new install of Ubuntu /usr/local is just a directory structure, there are no files. If a build is configured with --prefix=/usr/local or in the normal case prefix defaults to /usr/local all installed files will reside within the /usr/local directory structure. This does not mix installed files with system files. At any point in time I can do rm -rf /usr/local and the system will not be broken. If program installations properly respect the --prefix, and in my experience they do, deleting the /usr/local directory won't even leave behind any orphaned files, except the occasional ~/.configs that apt doesn't even clean up. Which begs the question, if I can install to a directory within my home dir, why can't I use /usr/local? It is a single user system, and quite honestly, that's why it's there.

Again lets see what the Debian Policy Manual has to say, section 9.1.2...
Quote
As mandated by the FHS, packages must not place any files in /usr/local.... because /usr/local and its contents are for exclusive use of the local administrator, a package must not rely on the presence or absence of files or directories in /usr/local for normal operation.
That says quite straight up... Installations in /usr/local do not mix with installed packages or system files.

Yes, it is possible to create version struggles with similarly named files in /usr and /usr/local. Yet this is possible with any directories in the search path, on any OS. Unix has two wonderful tools for locating these struggles, "find" and "which." I wish windaz came with such powerful tools right out of the box. As long as installs respect --prefix and packages respect Debian Policy there is no mixing of files! The only conflict will be with similar names, and which is found first.

In summary...

No, what I'm doing isn't wrong! Possibly in your "opinion" I should be doing some things differently, but Debian sides with me! When I add a lib to the ld.so directories I WILL run ldconfig, and /usr/local is mine, to do with as I please! I keep my build dirs and at any point I can ./configure to a new --prefix, make install to a clean dir, and work side by side nautilus windows to pick apart everything it installed. Yes I have been there and done that. Most recently, today with Codeblocks. It really is not that tough. Haven't done it often... kinda enjoy it.

}else{

dpkg-buildpackage is the nuts! You've put a lot of work into the build system. Document it in BUILD!

Also the last example in the man page has a typo. It says...
 
Batch rebuild everything in myproject.cpp:
codeblocks --rebuild myproject.cbp

The first .cpp should be .cbp.

I really don't want to come off as a jerk, but I would like to expose how this whole interaction went from my perspective. Firstly, as I've said before, I don't pile on my system with home built apps. If I did, as I've said, the ldconfig would have been a given, and I never would have been here. Currently I have the newest Blender, Bluefish, OpenMesh and for a bit Codeblocks, in my /usr/local. I do enjoy building code! I've built several LFS systems, and there is a kind of hypnotic state that a newbish such as myself gets into watching a build progress without errors. For the number of people downloading the trunk, and the small group actively doing development on c::b, I don't think I'm the only one that gets a kick out of building source code. And for a drub I like to think I'm OK at figuring out build errors. All that aside...

I built the source but had the errors I mentioned earlier. I was stumped! I found no immediate joy on Google, so I started formatting a post to seek out an answer on the forum. Understand, I'm no flippin Mitnick, but I'm trying to put together a reasonable post with a decent amount of pertinent information about what's failing, and it dawns on me "missing symbols" must be a library thing. I did a quick 2+2 and realised ldd was the tool of choice. I had never used ldd before. I got to the point where I was looking at codeblocks and libwxsmith.so with ldd in a terminal. While at the same time I was looking at the missing libraries in /usr/local/lib, in nautilus. The files were there, with their symbolic links, exactly as they were supposed to be, but were not being found. So I was stumped again! And I started rewriting my post to better illustrate what I had discovered the problem to be. Then it struck me like a bolt... run ldconfig! Problem solved!

I had searched for the exact error message with no luck, but I came back and searched ldconfig to see if I couldn't find others with the same issue. The top page in the search result had a user running ldconfig after each make install, and another user saying don't do that. Truth is, and I think it is obvious given Ubuntu's broken LD_LIBRARY_PATH, ldconfig was the answer on my Ubuntu box. Libraries installed to /usr/local/lib will not be found unless they are found in ld.so.cache.

I didn't know that c::b wouldn't link to wx 2.9. Had I done my homework better I probably would have chosen a binary package... actually probably not... now that I've done the homework dpkg-buildpackage is my prefered c::b build.

I know I'm only far enough up the learning curve to realise I should have worn better shoes, but I do know when I'm being piled on. I said run ldconfig and I stuck by it, and that obviously raised the ire of the powers that be. Yet I've asked repeatedly, what would your fix have been? and get no answer. Instead I get, don't install the source or puppies die. I know the dangers of mucking up /usr, but I've also come to realise the annoyance of adding a sources.list line for every repository I come across. Truth is, I might have added the repo if it was apt.codeblocks.org. I recently went through and cleaned out my sources and mostly I had no idea where they came from. jenslody.de? I won't remember what that was in six months. You guys see c::b as an ongoing project, and give it daily attention, I see it as a tool. If it's there when I need it and it does what I need I'm a happy camp stool. And maybe in a couple years when I decide I need an update, it might be way cool, just like Christmas morning. It's tough to get that "Yeah! that's the (offensive slang) I was talkin 'bout!" feeling when downloading nightlys.

Anyhow, I'm rambling. Part of the title of this thread is "experience feedback." I gotta say... No I won't!

Three times, account deleted and recreated. If my mouth doesn't get me banned, that will.

oBFusCATed said...
Quote
I asked for the explanation why ldconfig is needed, so we can have a reason to add it to the "make install" process.
Quite simply, Debian says use it. .deb packages are already using it. It would simply be enough to add a line to the BUILD file that says "If after doing "sudo make install" you get an error similar to this, run ldconfig. Recent Ubuntu's don't have LD_LIBRARY_PATH and outside of /lib and /usr/lib ld.so.cache is the only way to ensure your library will be found. Mainly, don't think that ldconfig is just for changes to ld.so.conf. It also has to be run when libs are added or removed from those directories in order for ld.so.cache to remain in sync with the installed libraries. Do understand, that I also understand, ldconfig is primarily a Debian thing. Would I run it in Fedora? Not without doing some research. But in Debian it carries the water for the ld.so dynamic library linker.

@Freem... No, I quit talking about nightlys a long time ago. Surely this could break, that could break, it might break right down the middle and I won't know which half to pick. If my new c::b is solid, I aint gonna change it until it does break. This whole debacle was to gain one feature I wanted. Other than that, my old c::b did everything I needed. And yes, Jens has got me beat in so many ways. I hope neither of you take it personal that I choose to not add the repository. Unless this install turns out to be broken bad, I'm not changing it until the same version is available in Ubuntu repos at least.

} // well that sucked. (let the day shift clean it up)
« Last Edit: September 26, 2011, 02:18:11 pm by BentFX »
Whenever I go to Walmart I always request an intrusive pat-down from the greeter. It looks good on his resume, and it makes us all just a little bit safer.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #19 on: September 26, 2011, 02:04:53 pm »
I will not answer to everything you write.
Again, if you read more carefully, you would know what has happened:
Quote from: libcodeblocks0.postinst
#!/bin/sh
set -e
# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
        ldconfig
fi
# End automatically added section

And again, it works fine without ldconfig.
The cause might be, that I always start with full (or relative) path from console or desktop-file.
The libs are definitely relinked (clearly stated in the buildlog and visible with ldd).

About removing the software, you write removing /usr/local should not harm the system. That's of course correct, but as you also write, you have several other installations there, and they would surely break, if you remove the fodler they are in.

One sentence about sources-list, you can add entries and comments, so you do not need to remember "manually" what the entry is for.
The update frequence of the release-component of my repo is very low. Until there is no new release, it will not change.
Not the same for the trunk binaries, of course.
I started with my repo on my home-server, before I became a C::B developper and I called it unofficial therefore.
In the meantime, I am one of the core-developpers of C::B and the server has moved to a (more or less) real server, with a much better performance (and much higher costs), but I decided not to change the repo's title, because it's still not on an official codeblocks.org-server.
But right now (while posting) I changed the title to "(un-)official", because it uses the official sources, with one little change (I have one plugin more to download in the additional-plugins packages).

Thanks for pointing to the typo in BUILD, I try to keep it in mind, that all thes files need some work (the debian/copyright-file needs the most by the way), but I have to do some other annoying work, to earn enough money to feed my family and me and work for C::B in my spare-time (as all other C::B devs do).

Offline BentFX

  • Multiple posting newcomer
  • *
  • Posts: 18
    • BentFX
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #20 on: September 26, 2011, 03:04:34 pm »
I will not answer to everything you write. likewise
And again, it works fine without ldconfig.
And again Debian insists it be used on Debian systems. That is probably why it is added automatically. Yesterday I had real world experience looking at the linker not finding files that were exactly where they belonged. And ldconfig fixed the issue.

Quote
The cause might be, that I always start with full (or relative) path from console or desktop-file.
The libs are definitely relinked (clearly stated in the buildlog and visible with ldd).
Does this break the file? Whether it is added automatically, or not, the fact is the debs are installed with ldconfig. Are the debs broken?

Quote
About removing the software, you write removing /usr/local should not harm the system. That's of course correct, but as you also write, you have several other installations there, and they would surely break, if you remove the fodler they are in.
No! They'd just be gone. My menu items would be broken.

Quote
One sentence about sources-list, you can add entries and comments, so you do not need to remember "manually" what the entry is for.
Didn't realise that option existed. I'll look into it. Seems everybody wants you to add their repo and accept their digital trust file, but nobody wants to add a meaningful comment to their sources entry.

Quote
Thanks for pointing to the typo in BUILD
It's in the man page actually. Could I write a patch? I've never written a patch, and one character in one line of one file seems like the perfect first-timer project. :)

On the ldconfig thing, do what you do. Debian says use it. If you can get by without it that's fine, but on my system if a program fails with "undefined symbols" and the files exist, I'm probably going to run it. and if it fixes the issue I'm probably going to say so.
Whenever I go to Walmart I always request an intrusive pat-down from the greeter. It looks good on his resume, and it makes us all just a little bit safer.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #21 on: September 26, 2011, 03:31:09 pm »
On the ldconfig thing, do what you do. Debian says use it.
That's not true !
As I wrote, I have installed several versions, none of them is below /usr/local (all below $HOME, because I did not work as root in about 20 years of using unix/linux on any of my machines, if it was not absolutely needed), but /usr/local is not in ld.so.conf.d on my system anyway, so according to:
I point your attention to the Debian Policy Manual section 8.1.1...
Quote
Any package installing shared libraries in one of the default library directories of the dynamic linker (which are currently /usr/lib and /lib) or a directory that is listed in /etc/ld.so.conf[58] must use ldconfig to update the shared library system.
it's not needed to run ldconfig, or did I misunderstand something.

The debian-packages have to call ldconfig, because they install their libs in /usr/lib .

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #22 on: September 26, 2011, 03:36:57 pm »
And again Debian insists it be used on Debian systems. That is probably why it is added automatically. Yesterday I had real world experience looking at the linker not finding files that were exactly where they belonged. And ldconfig fixed the issue.
1. Debian is not the only distro in the world
2. If you don't know what you're doing -> you should use prebuild packages
3. If you compile from source you should know your system and its requirements!
   We can't handle every system in the world. This is the job of the packages/distro maintainers!

No! They'd just be gone. My menu items would be broken.
Facepalm 1
What is the definition of working software, then?

Didn't realise that option existed. I'll look into it. Seems everybody wants you to add their repo and accept their digital trust file, but nobody wants to add a meaningful comment to their sources entry.
Facepalm 2
RTFM! And there is a whole web page with information about what you should do and what the repo provides.

(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 BentFX

  • Multiple posting newcomer
  • *
  • Posts: 18
    • BentFX
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #23 on: September 26, 2011, 05:23:04 pm »
The debian-packages have to call ldconfig, because they install their libs in /usr/lib .
And if the plain jane "make install" is done on a recent Ubuntu the files go into /usr/local/lib... OMG!!! I just checked out the trunk and its BUILD file suggests "make install" into /usr  I think our conversation is done.

Don't any of you lecture me about what I do on my system. :)

No I won't delete the account, you've either got to look at it, or delete it yourselves.

The funny part is I did write the patch for the man page... http://BentFX.com/manpage.patch

Simple "patch -p0 < manpage.patch" from within trunk will do it.

Code
--- src/src/codeblocks.1	2011-09-26 06:59:41.700778880 -0700
+++ src/src/codeblocks.1.fixed 2011-09-26 07:03:11.188781482 -0700
@@ -57,7 +57,7 @@
 .nf
 codeblocks \-\-build \-\-target="Debug" \-\-no\-batch\-window\-close myproject.cbp
 
-Batch rebuild everything in myproject.cpp:
+Batch rebuild everything in myproject.cbp:
 .nf
 codeblocks \-\-rebuild myproject.cbp
 .SH AUTHOR

It boggles my mind. You keep replying with such as this...
Quote
The debian-packages have to call ldconfig, because they install their libs in /usr/lib .
And the only point I'm trying to make is on some systems ldconfig is also needed for /usr/local/lib. And you all can't wrap your heads around that.

Quote
Facepalm 1
What is the definition of working software, then?
Who ever said working software??? I was only trying to illustrate that /usr/local is not system files!!! Since you've got your face in your palm, go ahead and try to get a grip.

Quote
Facepalm 2
RTFM! And there is a whole web page with information about what you should do and what the repo provides.
Again, get a grip! If you want to deride me because I don't know every option to every program on my system then so be it. The fact remains, I'm not going to add the repo. I'll use my Codeblocks... Ha Ha! Hear that? My Codeblocks! Yeah, I'll download what I need, and I'll always be a bit disgusted by you. What a sad case.

AND STILL YOU HAVE NEVER ANSWERED!!! WHAT WOULD YOUR SOLUTION HAVE BEEN??? What a flea king loser.

Read it yesterday... scanned it just now... can't find where it says how to set a comment on the source line... please show me... http://apt.jenslody.de/ or are you just talking out your apps.
« Last Edit: September 26, 2011, 05:33:45 pm by BentFX »
Whenever I go to Walmart I always request an intrusive pat-down from the greeter. It looks good on his resume, and it makes us all just a little bit safer.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #24 on: September 26, 2011, 05:37:21 pm »
@BentFX:
The solution is on "buggy/broken" distros you have to run ldconfig after you run make install. Simple as that...
What other solution do you want from us?

@Admins: can you extract the last posts, because we are too much off topic.

(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #25 on: September 26, 2011, 05:39:54 pm »
Quote
About removing the software, you write removing /usr/local should not harm the system. That's of course correct, but as you also write, you have several other installations there, and they would surely break, if you remove the fodler they are in.
No! They'd just be gone. My menu items would be broken.
What you say is, that a software that is removed is not broken.

But where is the difference between a software, that does not work, because it can not find a lib and a software that does not work, because someone has deleted it ?
Both do not work, and that's the point that interests me, if I want to use software.

And I did not tell you that you should not use ldconfig, the only thing I told you, is that it works here (and on several other actual distros I use for testing purposes) without running ldconfig, and if I remember correctly it also works on ubuntu this way (for me).
But as I wrote, I never install software as root (and that's needed for /usr/local) if it is not absolutely necessary.
And if I am the only user, there's no need to do so.

Again  : please read more carefully:
And again, it works fine without ldconfig.
The cause might be, that I always start with full (or relative) path from console or desktop-file.
The libs are definitely relinked (clearly stated in the buildlog and visible with ldd).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #26 on: September 26, 2011, 05:42:04 pm »
Read it yesterday... scanned it just now... can't find where it says how to set a comment on the source line... please show me... http://apt.jenslody.de/ or are you just talking out your apps.
Documentation about apt/dpkg/debian must be on the debian.org web site, not on the Jens' repo.
Why do you want everybody to serve the info you need on a platter?
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #27 on: September 26, 2011, 05:48:20 pm »
@Admins: can you extract the last posts, because we are too much off topic.

Not everything is off-topic, because some users seem to have a problem with the automake-system, and if someone is brave enough to read through tons of nonseless text to extract the interesting parts, it might be of help for someone, even if the solution (running ldconfig) is in our wiki for a very long time (at least for people who are willing to read).

That's my opinion at the moment, but I'm not the only admin here, and my opinion can change of course.

@BentFX:
be aware, that you are not far away from a ban, if you are not able to calm down and return to a more unemotional discussion.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #28 on: September 26, 2011, 05:50:10 pm »
Read it yesterday... scanned it just now... can't find where it says how to set a comment on the source line... please show me... http://apt.jenslody.de/ or are you just talking out your apps.
Documentation about apt/dpkg/debian must be on the debian.org web site, not on the Jens' repo.
Why do you want everybody to serve the info you need on a platter?

Type
Code
man sources.list
and search for comment.

Should not be too hard for someone who builds his own software.

Offline BentFX

  • Multiple posting newcomer
  • *
  • Posts: 18
    • BentFX
Re: Compile Code::Blocks from SVN under ubuntu (for newbie): experience feed back
« Reply #29 on: September 26, 2011, 06:03:52 pm »
Quote
Should not be too hard for someone who builds his own software.
Yes, I will sort it out. Fact is, inside Synaptics, now that I've thought about it, the original CD(disabled) has a second line of text below it. I just wrote my first patch using nothing but man pages, and trial by fire. I can figure it out.

Other than that... man what a loudmouth I am... Huh?
Whenever I go to Walmart I always request an intrusive pat-down from the greeter. It looks good on his resume, and it makes us all just a little bit safer.