Not a howto, but a request for a compiling howto.

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Johnny Reb
Posts: 132
Joined: Fri 05 Aug 2005, 08:02
Location: The Confederate States of America (occupied)
Contact:

Not a howto, but a request for a compiling howto.

#1 Post by Johnny Reb »

I've been attempting to find information on the subject of compiling applications both on this forum, and other places on the net, but haven't found anything really helpful yet. Most of the time the information I've found is very basic, and therefore not very useful.

I've got puppy 1.0.5 running in a fat32 partition as pup001, and have the usr_devx.sfs set up on it. Initially, I had pretty good luck and the first few things I tried compiling worked, but now I'd say I'm at an 85% or better failure rate.

The thing that's most aggravating is that in a majority of cases the failure is caused because the compiler can't find a library file it needs. That in itself would not be all that aggravating if the file were not installed in puppy, but in most cases it is, and it is in the folder the compiler said it looked in for it.

So, if any of y'all can provide some insight into the basics of compiling, or just point me in the right direction to find out I'd appriciate it.

Coming from a windoze background, I can tell y'all that compiling applications is one thing that scares a lot of people away from Linux, and a good howto that gives a reformed windoze user the basics would be a really big help. Compiling was never an issue for me. In my case it was hardware compatability that kept me away from it. Regardless, since I never had a need to do it before I'm having to play catch up when it comes to compiling.
He who dares not offend cannot be honest.
~ Thomas Paine

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

Johnny, can you post an examle (with link to download), where you encounter this problem?

To compile a program, you will need the source of the libraries it depends on, and compile/install that too.
Puppy contains just the binaries of some programs, but not the source.
When you compile it yourself, not just the binary will be created, but also several headers (xxx.h) will be copied to the Filesystem (usually in one of the /include -folders) - these are needed to compile your program.

Mark

User avatar
Johnny Reb
Posts: 132
Joined: Fri 05 Aug 2005, 08:02
Location: The Confederate States of America (occupied)
Contact:

#3 Post by Johnny Reb »

MU wrote:Johnny, can you post an examle (with link to download), where you encounter this problem?

To compile a program, you will need the source of the libraries it depends on, and compile/install that too.
Puppy contains just the binaries of some programs, but not the source.
When you compile it yourself, not just the binary will be created, but also several headers (xxx.h) will be copied to the Filesystem (usually in one of the /include -folders) - these are needed to compile your program.

Mark
Mark,

I can copy several compile logs, but they would occupy too much space here. I'll try to pick out the errors in some of them so that it won't take up so much space.

One example, and this one is really aggravating is the libgpg-error, libgpgme, and libgcrypt. I've had trouble with all three of them while compiling GnuPG, or at least programs that work with GnuPG. I compiled libgpg-error, and libgcrypt without any trouble, and installed them. Regardless there is one program related to GnuPG, gnutls-1.2.7 that refuses to recognize that the libraries are installed even when I place the path to the libraries after the ./configure command (I don't recall the specific argument given to provide the path to the file, but I got it from ./configure --help). There are other examples, but it would probably be better if I went and pulled up specifice error messages. In fact I'll post the last one I got my copying it right out of rxvt output. It's an error message for another library file that I need to compile another program, but it won't compile.

Here's the error output from rxvt:
# make check
Making check in src
make[1]: Entering directory `/usr/local/libassuan-0.6.10/src'
./mkerrors < ./assuan.h > assuan-errors.c
make check-am
make[2]: Entering directory `/usr/local/libassuan-0.6.10/src'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -MT assuan-util.o -MD -MP -MF ".deps/assuan-util.Tpo" -c -o assuan-util.o assuan-util.c; \
then mv -f ".deps/assuan-util.Tpo" ".deps/assuan-util.Po"; else rm -f ".deps/assuan-util.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -MT assuan-errors.o -MD -MP -MF ".deps/assuan-errors.Tpo" -c -o assuan-errors.o assuan-errors.c; \
then mv -f ".deps/assuan-errors.Tpo" ".deps/assuan-errors.Po"; else rm -f ".deps/assuan-errors.Tpo"; exit 1; fi
assuan-errors.c:107: error: parse error before '-' token
assuan-errors.c:107:4: warning: no newline at end of file
make[2]: *** [assuan-errors.o] Error 1
make[2]: Leaving directory `/usr/local/libassuan-0.6.10/src'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/usr/local/libassuan-0.6.10/src'
make: *** [check-recursive] Error 1
#
He who dares not offend cannot be honest.
~ Thomas Paine

noip
Posts: 93
Joined: Fri 07 Oct 2005, 00:45
Location: Sydney

#4 Post by noip »

JR, (wasn't he in a TV series?)

A couple of things that might be of help (at the risk of going off on a tangent from what you were after).

1. Puppy is not set up to compile programs out of the box.
2. Most (all?) source code for Linux assumes you have the GCC compiler on your system.

BUT ... the up side is that compiling programs is easy.

My humble suggestion is that you also install Vector Linux to use as the compiling environment for Puppy (at least for the moment). I think that Vector is the "approved" distro for library compatibility ... An alternative would be Slackware 10.0 or 10.1 if you're lucky.

I'll have a look in my directories for the compiling notes ...


Rgds

GS

vp & ftgs

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#5 Post by Flash »

noip wrote:...
1. Puppy is not set up to compile programs out of the box.
2. Most (all?) source code for Linux assumes you have the GCC compiler on your system...
I haven't compiled anything so I could be wrong about this, but I'm pretty sure Puppy 1.0.5 has an associated file available for download which contains pretty much all you need to compile applications for Puppy. I can't think of the name of that file. :(

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#6 Post by Lobster »

Last edited by Lobster on Sun 26 Mar 2006, 01:33, edited 1 time in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

noip
Posts: 93
Joined: Fri 07 Oct 2005, 00:45
Location: Sydney

#7 Post by noip »

I guess what I'm trying to say here, is that if you are not experienced in compiling programs, then DON'T start with puppy. Install Vector or Slackware 10.1 and start there.

In the absence of me finding the notes I've collected, I'd point you to

www.linuxpackages.net
http://www.linuxpackages.net/howto.php? ... kage+Howto
http://asic-linux.com.mx/~izto/checkinstall/

Knowing how to build a Slackware package, and knowing about "checkinstall" is VERY useful in compiling an app for puppy. A Slackware package (correct version) has everything you need to install into Puppy.

Rgds

GS

vp&ftgs

ps .. steal some of the packages for 10.1 from linuxpackages - they may well run in puppy.

User avatar
Johnny Reb
Posts: 132
Joined: Fri 05 Aug 2005, 08:02
Location: The Confederate States of America (occupied)
Contact:

#8 Post by Johnny Reb »

noip wrote:JR, (wasn't he in a TV series?)
Hello noip, yeah there was a JR in a television series.
A couple of things that might be of help (at the risk of going off on a tangent from what you were after).

1. Puppy is not set up to compile programs out of the box.
2. Most (all?) source code for Linux assumes you have the GCC compiler on your system.

BUT ... the up side is that compiling programs is easy.
I understand that Puppy was not set up for compiling out of the box, but it was my understanding that most of the tools necessary for compiling were included in the usr_devx.sfs file, which I have installed. It does seem to be working for the most part. Most of the trouble I've had is that it can't find certain library files. Some of this I can understand, but when I've successfully compiled a libray file libgpg-error & libgcrypt for example, and it still can't find them it's puzzling.
My humble suggestion is that you also install Vector Linux to use as the compiling environment for Puppy (at least for the moment). I think that Vector is the "approved" distro for library compatibility ... An alternative would be Slackware 10.0 or 10.1 if you're lucky.
If I'm unable to do what I want with the compiler in Puppy that is an option, however disk space is a problem. I do have another version of Linux on this box, Peanut Linux 9.5 but the compiler does not work on it. I do intend to try and get it going again, but since I found Puppy have not done much with it. I don't know how compatable it would be for Puppy. It does have a 2.4.x kernel so at least in that respect it might work. At least for now, I've got Puppy 1.0.4 installed on the hard drive, and I've got Puppy 1.0.5 working from the pup001 file. It was my intention to work it that way so that I could compile some programs that I'd really like to use, and have them ready as dotpups and later install Puppy 1.0.5 on the hard drive. I also figured that if I really screwed the system up trying to compile something that it would be a lot eaiser to start over again that way since as long as I'm working from the pup001 I'm looking at everything as being temporary, but once I install to the hard drive I'll start saving things there that I intend to keep there and won't want to loose.
I'll have a look in my directories for the compiling notes ...
Any tips you can give me will be very much appriciated. One thing I have been wondering about, and this may have something to do with the compiler not being able to find certain files, is does it make a difference *where* you do your compiling? I've been doing it all in /usr/local.


He that would make his own liberty secure, must guard even his enemy from oppression; for if he violates this duty, he establishes a precedent that will reach to himself.
Thomas Paine, Dissertation on First Principles of Government, December 23, 1791
He who dares not offend cannot be honest.
~ Thomas Paine

User avatar
Johnny Reb
Posts: 132
Joined: Fri 05 Aug 2005, 08:02
Location: The Confederate States of America (occupied)
Contact:

#9 Post by Johnny Reb »

noip wrote:In the absence of me finding the notes I've collected, I'd point you to

www.linuxpackages.net
http://www.linuxpackages.net/howto.php? ... kage+Howto
http://asic-linux.com.mx/~izto/checkinstall/

Knowing how to build a Slackware package, and knowing about "checkinstall" is VERY useful in compiling an app for puppy. A Slackware package (correct version) has everything you need to install into Puppy.

ps .. steal some of the packages for 10.1 from linuxpackages - they may well run in puppy.
Thanks for the info, I'll sure check it out!

Society in every state is a blessing, but government, even in its best state, is but a necessary evil; in its worst state an intolerable one; for when we suffer or are exposed to the same miseries by a government, which we might expect in a country without government, our calamity is heightened by reflecting that we furnish the means by which we suffer.
Thomas Paine, Common Sense, 1776
He who dares not offend cannot be honest.
~ Thomas Paine

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#10 Post by Nathan F »

In almost every case when compiling a program, the configure script checks the library's header files, not the libraries themselves. The neccessary files will be in /usr/include or in /usr/lib/pkgconfig. It is not unheard of for a library to be included in Puppy but the associated headers to be missing from usr_devx.sfs. In those cases, the libraries will also have to be compiled, even though they are already in Puppy. I had to compile Gimp myself in order to compile Gimp plugins, for instance.

Compiling from Vector works well in most cases, but not all. Some programs are very specific in what will or will not fly and seem only to run on the host they were compiled on. For the most part5 this is rare, though. Vector is my second choice in a distro, right behind Puppy. If you're worried about space, Vector is also very small for an installed Linux system. Depending on the number of packages you install, count on 1-3GB total, including space for compiling. As far as compiling apps, Vector and Slackware are miles ahead of any other distro and you will probably never have ANY issues.

It doesn't matter where you do your compiling at as long as it's a Linux partition and has enough space. What does matter is that you place everything in the right place afterword. Libraries in Puppy need to be in /usr/lib, not /usr/local/lib which is the default path. When you do the configure step, do this.

Code: Select all

./configure --prefix=/usr
This will also make sure that the libs are placed where they can be found easily to compile against. If you want to make a dotpup, they can late be moved to /root/my-applications/lib if you prefer.

Beyond that, make sure you read any included docs carefully before compiling a package. It will save you a lot of trouble. The most important file is usually named INSTALL and will have most of the info you need.

Good luck.
Nathan

Guest

#11 Post by Guest »

Here's a simple explanation I've found (works for me) for compiling on a Slackware based system:

PACKAGE CREATION
================
1. Create the package creation directory

# mkdir -p /pkgcreate/usr/local

2. Unpack the source distribution, configure it
then compile.
... you should be in /pkgcreate (?)

# tar -zxvf foobar-a.b.c.tar.gz (so you now have directory /pkgcreate/foobar-a.b.c )
# cd foobar-a.b.c
# ./configure --prefix=/usr/local (the ultimate destination)
# make

3. 'Install' the created files in the package
creation directory.

# make install prefix=/pkgcreate/usr/local (where you want the intermediate install to go)

4. Build the tarball package

# cd /pkgcreate
# makepkg foobar-a.b.c-i686-1.tgz
(usually follow the suggestions to create symbolic
links via the script and to NOT change ownership
attributes of the files)

5. Presto you have your tarball package! Stow it
away for safekeeping. (when you "installpkg" it will now go into /usr/local)



Hope this helps a bit.

Rgds

GS

vp&ftgs

noip
Posts: 93
Joined: Fri 07 Oct 2005, 00:45
Location: Sydney

#12 Post by noip »

Sorry, forgot to log in.

GS

vp&ftgs

Guest

#13 Post by Guest »

Nathan F wrote:In almost every case when compiling a program, the configure script checks the library's header files, not the libraries themselves. The neccessary files will be in /usr/include or in /usr/lib/pkgconfig. It is not unheard of for a library to be included in Puppy but the associated headers to be missing from usr_devx.sfs. In those cases, the libraries will also have to be compiled, even though they are already in Puppy. I had to compile Gimp myself in order to compile Gimp plugins, for instance.
Now that explains a lot!
Compiling from Vector works well in most cases, but not all. Some programs are very specific in what will or will not fly and seem only to run on the host they were compiled on. For the most part5 this is rare, though. Vector is my second choice in a distro, right behind Puppy. If you're worried about space, Vector is also very small for an installed Linux system. Depending on the number of packages you install, count on 1-3GB total, including space for compiling. As far as compiling apps, Vector and Slackware are miles ahead of any other distro and you will probably never have ANY issues.
I may try Vector if I can make room for it. I'm going to see if I can move a lot of stuff I've got saved over to cd. Even though I almost never boot into windows now that I've got the modem working in Puppy, I still intend to keep at least win2k pro on one partition. Unfortunatly it is still useful for some things, although the aggravation factor while using it is a lot higher after working with Puppy. Only bad thing about trying another distro is the download time..............on a 56k modem it takes awhile ':evil:'
It doesn't matter where you do your compiling at as long as it's a Linux partition and has enough space. What does matter is that you place everything in the right place afterword. Libraries in Puppy need to be in /usr/lib, not /usr/local/lib which is the default path. When you do the configure step, do this.

Code: Select all

./configure --prefix=/usr
This will also make sure that the libs are placed where they can be found easily to compile against. If you want to make a dotpup, they can late be moved to /root/my-applications/lib if you prefer.
This explains even more about what may be causing the trouble I've been having. I've been using the default location that the compiler places the files. When I boot back into Pup 1.0.5 I'll try again and specify for the library files to go into /usr/lib instead of /usr/local/lib.
Beyond that, make sure you read any included docs carefully before compiling a package. It will save you a lot of trouble. The most important file is usually named INSTALL and will have most of the info you need.
That I have been doing. Actually I've been reading a lot from quiet a few different sources.


"Guard with jealous attention the public liberty. Suspect every one who approaches that jewel. Unfortunately, nothing will preserve it but downright force. Whenever you give up that force, you are ruined.... The great object is that every man be armed." Patrick Henry

Guest

#14 Post by Guest »

Oops, that was me making the reply. For some reason my login timed out before I got the message posted. I'm not sure why that's happening because I wasn't logged in that long, but it's happened two or three times now.

User avatar
Johnny Reb
Posts: 132
Joined: Fri 05 Aug 2005, 08:02
Location: The Confederate States of America (occupied)
Contact:

#15 Post by Johnny Reb »

Humm, for some reason my logins were not persisting using standard Mozilla, but they seem to be using Firefox. Rather weird since the only difference is that I was using Tor with standard Mozilla, and I'm using JAP with Firefox. Other than that the settings are exactly the same.
He who dares not offend cannot be honest.
~ Thomas Paine

User avatar
Johnny Reb
Posts: 132
Joined: Fri 05 Aug 2005, 08:02
Location: The Confederate States of America (occupied)
Contact:

#16 Post by Johnny Reb »

Anonymous wrote:Here's a simple explanation I've found (works for me) for compiling on a Slackware based system:

PACKAGE CREATION
================
1. Create the package creation directory

# mkdir -p /pkgcreate/usr/local

2. Unpack the source distribution, configure it
then compile.
... you should be in /pkgcreate (?)

# tar -zxvf foobar-a.b.c.tar.gz (so you now have directory /pkgcreate/foobar-a.b.c )
# cd foobar-a.b.c
# ./configure --prefix=/usr/local (the ultimate destination)
# make

3. 'Install' the created files in the package
creation directory.

# make install prefix=/pkgcreate/usr/local (where you want the intermediate install to go)

4. Build the tarball package

# cd /pkgcreate
# makepkg foobar-a.b.c-i686-1.tgz
(usually follow the suggestions to create symbolic
links via the script and to NOT change ownership
attributes of the files)

5. Presto you have your tarball package! Stow it
away for safekeeping. (when you "installpkg" it will now go into /usr/local)



Hope this helps a bit.

Rgds

GS

vp&ftgs
Thanks, between the information you have given me, and that Nathan has given me I think I've got a good chance of getting things to work. I don't know if I'll boot back into Pup 1.0.5 and try it tonight, but if I don't I will tomorrow. After several days of working on it I'm thinking of just surfing tonight. Oh, btw I did try the slackware packages, and they didn't work. The one I tried was GnuPG, and it installed without any problem, but when I tried to run ./gpg it couldn't find a library file it needed.


The most dangerous man, to any government, is the man who is able to think things out for himself, without regard to the prevailing superstitions and taboos. Almost inevitably he comes to the conclusion that the government he lives under is dishonest, insane and intolerable, and so, if he is romantic, he tries to change it. And even if he is not romantic personally he is very apt to spread discontent among those who are.

H.L. Mencken
He who dares not offend cannot be honest.
~ Thomas Paine

noip
Posts: 93
Joined: Fri 07 Oct 2005, 00:45
Location: Sydney

#17 Post by noip »

JR

I understand about the library files. It can be frustrating. The nice thing about Slackware / Vector, is that because there is no dependency checking with their package management system, programs are compiled for a PARTICULAR VERSION of that distro, which means that except in exceptional circumstances, the required libraries WILL exist on the host system.

Puppy is tied closely to Vector 5.1 (?) so that most of the libraries are common (obviously Puppy has to cut down on some).

What am I trying to say? A bit of patience, and you'll find that if there are any missing libraries on any programs you transfer from Slackware / Vector, you'll probably be able to find them on the host system and you'll have a good chance of ultimate success.

Don't give up.

GS

vp&ftgs

User avatar
Johnny Reb
Posts: 132
Joined: Fri 05 Aug 2005, 08:02
Location: The Confederate States of America (occupied)
Contact:

#18 Post by Johnny Reb »

noip wrote: What am I trying to say? A bit of patience, and you'll find that if there are any missing libraries on any programs you transfer from Slackware / Vector, you'll probably be able to find them on the host system and you'll have a good chance of ultimate success.

Don't give up.
Give up? Me? That ain't going to happen! ':wink:' Shoot, after fooling with windoze for several years Linux is a breeze ':lol:'. I'm just trying to get off to a running start. I love to tinker, and working with an OS that is friendly to tinkering, and customization is great. It's also very refreshing to work with an OS that don't crash when you push it just a little, and is not ram starved. I've pushed Puppy way beyond the limits of anything I could do with windoze, and it ain't even wimpered ':P:'. I did kind of crash it one night though, although it really wasn't a crash as such. I had been surfing all night, and had multiple browser windows open, with multiple tabs open in each one. I wasn't paying the least bit of attention to system resources because it wasn't too long after I got Puppy online, and I was still used to the behavior of windoze. Anyway, I opened one window too many, and all of a sudden everything stopped except for the mouse, and it would only move very slowly, and jerked when moving. I managed to get one last thing to open, the view running processes, which I had minimumized (sp?), and it revealed that I had 640Mb out of 640Mb of ram in use. It actually didn't crash, it just did not have any ram left to work with, and quit responding. The thing that impressed me most was the fact that up until it had used the last bit of ram available it had showed absolutly no sign of being under any stress. Had I been using win2k or any other version of windoze, the computer would have crashed a long time before I got anywhere near that point, and would have been complaining loudly about the stress it was under. Puppy is one tough Pup!


"Liberty cannot be preserved without a general knowledge among the people... Be not intimidated, therefore, by any terrors, from publishing with the utmost freedom...nor suffer yourselves to be wheedled out of your liberty by any pretenses of politeness, delicacy, or decency. These, as they are often used, are but three different names for hypocrisy, chicanery, and cowardice."

-- John Adams
He who dares not offend cannot be honest.
~ Thomas Paine

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Puppy is one tough Pup

#19 Post by Lobster »

Puppy is one tough Pup!
It is the truth. I had (not sure how) no menu system - probably too many of the experimental window managers to speak of.
:roll:
Basically if I clicked on Start all I had was one option (not a full menu)

. . . Puppy was disintegrating around me (was running other programs that were going off at tangents) and yet I was able to continue a conversation I was having with Dex and Klh on IRC ...

The Puppy was running with a patch, wounded by Lobster clobbering (sorry Pup) and limping to the very end.

Brave Pup. :?

But and now the happy ending . . . :D

Shot and deleted the pup001 - it was the kind thing to do.
Shut down system
. . .
and like a phoenix the Puppy was back and friskier than ever in 15 mins. Browsing and causing Puppy mischief . . .
Puppy is one tough Pup!


8) Puppy - A computers Best Friend
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

menno

#20 Post by menno »

Code: Select all

 The one I tried was GnuPG, and it installed without any problem, but when I tried to run ./gpg it couldn't find a library file it needed. 
As I understand the compiling is correct but it is missing some lib's .
Mostly you been told what lib ,per example : blabla.so . Search thrue the systeem if you have somewhere a blabla.* . It would be posseble a) it is put into a directory which is not in LD_LIBRARY_PATH , b) you find a blabla.a then you have to convert the blabla.a into blabla.so .
Done by

Code: Select all

ld --whole-archive -shared -o blabla.so blabla.a

Post Reply