aMule Forum

English => Compilation problems => Topic started by: Inkus on October 30, 2005, 04:00:54 PM

Title: Compiling aMuleD on HP-UX
Post by: Inkus on October 30, 2005, 04:00:54 PM
I am trying to compile aMule 2.0.3 stable daemon on HP-UX 11.0 and have some problems:
$ gmake
...
g++  -DUSE_EMBEDDED_CRYPTO -W -Wall -g -ggdb -fno-inline -D__DEBUG__ -fmessage-length=0    -lpthread -o amuleweb  amuleweb-WebServer.o amuleweb-WebInterface.o amuleweb-WebSocket.o amuleweb-MD5Sum.o amuleweb-ECSocket.o amuleweb-ExternalConnector.o amuleweb-ECPacket.o amuleweb-OtherFunctions.o amuleweb-ECSpecialTags.o amuleweb-StringFunctions.o amuleweb-NetworkFunctions.o amuleweb-Format.o -L/usr/local/wxBase/lib    -lwx_base-2.6 -lwx_base_net-2.6  -lz     -lbfd -liberty -lgen
/usr/ccs/bin/ld: Unsatisfied symbols:
   typeinfo for CECFileConfig(first referenced in amuleweb-ExternalConnector.o) (data)
   typeinfo for CaMuleExternalConnector(first referenced in amuleweb-ExternalConnector.o) (data)
   typeinfo for ECSocket(first referenced in amuleweb-ECSocket.o) (data)
collect2: ld returned 1 exit status
gmake[1]: *** [amuleweb] Error 1
gmake[1]: Leaving directory `/home/user/tmp/aMule-2.0.3/src'
gmake: *** [all-recursive] Error 1

Actually, I do not know where the problem is. For example why amuleweb-ECSocket.o does not have ECSocket in it? amuleweb-ECSocket.o is compiled from ECSocket.cpp, which includes ECSocket.h and in this header ECSocket class is declared.

wxBase 2.6.2 is installed in /usr/local/wxBase, amule is configured vith "./configure --enable-amulecmd --disable-monolithic --enable-amule-daemon --with-wx-config=/usr/local/wxBase/bin/wx-config --enable-webserver".
Title: RE: Compiling aMuleD on HP-UX
Post by: Inkus on November 01, 2005, 08:48:26 AM
Maybe the problem is that I have to enable somehow "#pragma pack" in my compiler? I get Many warnings like this:
In file included from OtherFunctions.h:48,
                 from WebServer.h:61,
                 from WebServer.cpp:44:
OtherStructs.h: At global scope:
OtherStructs.h:35: warning: ignoring #pragma pack
OtherStructs.h:41: warning: ignoring #pragma pack
OtherStructs.h:43: warning: ignoring #pragma pack
OtherStructs.h:48: warning: ignoring #pragma pack
OtherStructs.h:50: warning: ignoring #pragma pack
OtherStructs.h:58: warning: ignoring #pragma pack
OtherStructs.h:60: warning: ignoring #pragma pack
OtherStructs.h:66: warning: ignoring #pragma pack
OtherStructs.h:80: warning: ignoring #pragma pack
OtherStructs.h:86: warning: ignoring #pragma pack
OtherStructs.h:95: warning: ignoring #pragma pack
OtherStructs.h:103: warning: ignoring #pragma pack

I am using GCC 3.2. Is there any way to enable "pragma pack" in this compiler, or I have to get  GCC 4.x.x to compile it? There is no GCC 4.x.x available for HP-UX 11.0 freely available, so I would have to compile GCC 4.x.x by myself, and it would take much time.
Title: Re: Compiling aMuleD on HP-UX
Post by: stefanero on November 01, 2005, 09:15:12 AM
heyho

now that you mentioned it, the pragma thingy....

try to download latest cvs and compile this. we got rid of all pramgas lately

maybe taht works
Title: Re: Compiling aMuleD on HP-UX
Post by: Inkus on November 02, 2005, 08:43:38 AM
Quote
Originally posted by stefanero
heyho

now that you mentioned it, the pragma thingy....

try to download latest cvs and compile this. we got rid of all pramgas lately

maybe taht works

Thanks for the reply. I feel kinda guilty for not trying CVS version before posting to this forum, so as an excuse I could say, that from my experience, if I get not obvious error(like missing include or library etc) while compiling a source, it is almost allways HP-UX specific issue, and trying CVS is not gonna help. Looks like this was not the case with aMule. So I tried CVS, the previous error was gone, had to tweak wx includes, since I got realloc not defined in them, had to change wait4 to waitpid in amule.cpp, since there is no wait4 on hp-ux, and after all I got another error, and this time, it's something with the compiler I use:

Code: [Select]
if g++ -DHAVE_CONFIG_H -I. -I. -I..   -I/usr/local/include -I/usr/local/wxBase/lib/wx/include/base-ansi-release-2.6 -I/usr/local/wxBase/include/wx-2.6 -DwxUSE_GUI=0 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1   -DwxUSE_GUI=0  -DHAVE_BFD  -DAMULE_DAEMON  -DUSE_EMBEDDED_CRYPTO -W -Wall -g -ggdb -fno-inline -D__DEBUG__ -fmessage-length=0 -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC   -MT amuled-amule.o -MD -MP -MF ".deps/amuled-amule.Tpo" -c -o amuled-amule.o `test -f 'amule.cpp' || echo './'`amule.cpp; \
then mv -f ".deps/amuled-amule.Tpo" ".deps/amuled-amule.Po"; else rm -f ".deps/amuled-amule.Tpo"; exit 1; fi
cc1plus: warning: changing search order for system directory "/usr/local/include"
cc1plus: warning:   as it has already been specified as a non-system directory
In file included from amule.cpp:92:
FriendList.h:63:10: warning: #warning THIS MUST BE MADE PRIVATE AFTER EC IS CODED
amule.cpp: In member function `virtual bool CamuleApp::OnInit()':
amule.cpp:373: Internal compiler error in c_expand_expr, at c-common.c:3646
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
gmake[4]: *** [amuled-amule.o] Error 1
gmake[4]: Leaving directory `/home/user/tmp/amule-cvs/src'

I googled for this error message, and found some other people getting such an error, but all of them were template related errors, and I guess this error I get is not template related. Looks like I should try to compile amule with gcc version >3.2. I am compiling GCC 4.0.2, but it will take much time (day or two), since my cpu is not that fast I wanted it to be :(. But if anyone has any clue how to overcome this problem with gcc 3.2, I would gladly hear it.
Title: Re: Compiling aMuleD on HP-UX
Post by: phoenix on November 02, 2005, 12:24:54 PM
Inkus,

We wish you luck with your compilations, and please, any patches that will make aMule compile in hp-ux are wellcome, do share them.

Also, in the end, if you want to write an HP-UX how to in our wiki, you are more than wellcome :rolleyes:

Cheers!
Title: Re: Compiling aMuleD on HP-UX
Post by: skolnick on November 02, 2005, 05:06:22 PM
It would be cool to have a guide to compile amule on HP-UX. That way, we would be missing one less OS (still missing IRIX, AIX, cray's OS whose name I can't remember (unicos was it?), BeOS, QNX and a few others) :D

Regards.
Title: Re: Compiling aMuleD on HP-UX
Post by: thedude0001 on November 02, 2005, 05:57:04 PM
...you forgot Plan9 ;)
Title: Re: Compiling aMuleD on HP-UX
Post by: skolnick on November 03, 2005, 04:44:03 AM
Quote
Originally posted by thedude0001
...you forgot Plan9 ;)
No, I did not forget it, I just included it in the "and a few others" category  :P

(OK, so I did not even know about it, I just hate losing :D)

Regards, and thanks for pointing me to Plan9.
Title: Re: Compiling aMuleD on HP-UX
Post by: phoenix on November 03, 2005, 11:27:47 AM
About plan9, is there anyone outside bell labs that actualy uses it?
Title: Re: Compiling aMuleD on HP-UX
Post by: lfroen on November 03, 2005, 12:53:45 PM
Quote
amule.cpp:373: Internal compiler error in c_expand_expr, at c-common.c:3646
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.

"Submit bug report" - means gcc bug report. Amule is good, gcc - bad. I have successfully compiled with gcc-4.x, as well as with gcc-3.4.x.

Quote
any patches that will make aMule compile in hp-ux are wellcome
Yes, wellcome, but I not quite sure if they will be merged with main source tree. Unlike Solaris and versions of BSD, there's no such machines in private use, which makes such compilation atttempts pure academic exersize. This note, however, is not relevant since your problems caused by inappropriate compiler use and/or install.
Title: Re: Compiling aMuleD on HP-UX
Post by: Inkus on November 03, 2005, 01:22:43 PM
Quote
Originally posted by lfroen
 I have successfully compiled with gcc-4.x, as well as with gcc-3.4.x.

What OS are you talking about?
I have tried gcc-3.1, gcc-3.2, now successfully compiled gcc-4.0.2, and got different compiler error with it. :( After some browsing in gcc bug database, I have found other getting similar error on pa-risc, but only if gcc was compiled with --enable-checking (which I guess is the default). So now I am trying to compile gcc 4.0.2 with additional --disable-checking tag, and see if it helps.  

Quote
any patches that will make aMule compile in hp-ux are wellcome
Quote
Yes, wellcome, but I not quite sure if they will be merged with main source tree. Unlike Solaris and versions of BSD, there's no such machines in private use, which makes such compilation atttempts pure academic exersize. This note, however, is not relevant since your problems caused by inappropriate compiler use and/or install.

In aMule source I needed only one change yet : aMule.cpp - to change wait4 call  to waitpid, since there is no wait4 on hp-ux 11.0. waitpid is the same as wait4 with last argument equal to null(0), which happens to be in aMule.cpp.
Title: Re: Compiling aMuleD on HP-UX
Post by: phoenix on November 04, 2005, 11:40:19 AM
To the other devs:
Is there any compatibility problem using waitpid instead of wait4? Linux has both of them. Ken, what about Mac?
Title: Re: Compiling aMuleD on HP-UX
Post by: skolnick on November 04, 2005, 09:38:16 PM
I know nobody asked, but Solaris also has waitpid and wait4 (no idea if they work the same, I just found in google it has both).

Regards.
Title: Re: Compiling aMuleD on HP-UX
Post by: ken on November 05, 2005, 01:25:10 AM
phoenix, the man pages list waitpid as being identical to (indeed, implemented as) wait4 with NULL for the final parameter.
Title: Re: Compiling aMuleD on HP-UX
Post by: lfroen on November 05, 2005, 11:33:36 AM
Quote
I have tried gcc-3.1, gcc-3.2, now successfully compiled gcc-4.0.2, and got different compiler error with it
Quote
but only if gcc was compiled with --enable-checking
Too bad. Your compiler is broken (word "your" is emphasized). Why don't you go and fix it or replaced with better one ? I never compiled gcc in my life - binary distributions are already invented, you know.

Quote
n aMule source I needed only one change yet : aMule.cpp - to change wait4 call to waitpid, since there is no wait4 on hp-ux 11.0
Too bad again.
You welcomed to change what you want, document it and place patch in wiki. No change going into code. We applied patch for ARM because people actually buy those devices, and running amule(d) there make sence, considering their design and purpose. This is not the case with all proprietary Unix'es out there like AIX, HPUX, QNX and others: very expansive hardware used by goverment/academic/coprs for very specific purposes. Not ever intended for private use.

BTW: given the cost of average HPUX machine I doubt that you own one. Did you asked permission to run amule there ? In places where I say such machines, you would need permission even to compile such thing.
Title: Re: Compiling aMuleD on HP-UX
Post by: Inkus on November 05, 2005, 04:40:10 PM
Quote
Originally posted by lfroen
Too bad. Your compiler is broken (word "your" is emphasized). Why don't you go and fix it or replaced with better one ? I never compiled gcc in my life - binary distributions are already invented, you know.
I know. I will try gcc 3.4 in the end. I heard 3.4 is considered very stable. If it does not help, looks like I'll have to forget about amule. HP have stopped supporting HP-UX 11.0 in their packaged software archive, so there is no binary distribution I could use. :(

Quote
You welcomed to change what you want, document it and place patch in wiki. No change going into code. We applied patch for ARM because people actually buy those devices, and running amule(d) there make sence, considering their design and purpose. This is not the case with all proprietary Unix'es out there like AIX, HPUX, QNX and others: very expansive hardware used by goverment/academic/coprs for very specific purposes. Not ever intended for private use.

BTW: given the cost of average HPUX machine I doubt that you own one. Did you asked permission to run amule there ? In places where I say such machines, you would need permission even to compile such thing.

This machine is very old and very slow one.It was used in production environment long long time ago. HP have stopped supporting HP-UX 11.0 (its about 1.5 year from that time), so you can compare it to a machine running win98 or even win95 on the hardware of that time.
Title: Re: Compiling aMuleD on HP-UX
Post by: Inkus on November 05, 2005, 06:16:01 PM
I have compiled amuled with gcc 4.0.2 successfully, however, when run, get bus error.  The same goes to ameweb also. amulecmd starts fine. My blind guess is the byte ordering(hp parisc is bigendian). Did anyone try amule(d) on any bigendian architecture?

What should be the normal size of amuled (with debug symbols included)? my amuled binary is ~70MB of size 8o (with debug symbols, dynamically linked).

I am still thinking of trying gcc 3.4, but the more I think, the less I have desire to do it.
Title: Re: Compiling aMuleD on HP-UX
Post by: stefanero on November 05, 2005, 06:27:42 PM
works fine on power mac which is also big endian....
Title: Re: Compiling aMuleD on HP-UX
Post by: lfroen on November 05, 2005, 07:40:28 PM
Quote
HP have stopped supporting HP-UX 11.0
Quote
This machine is very old and very slow one

Now I see what's going on :) You've got yourself aged out machine which eventually have quite rate architecture and OS. Now you entertaining yourself with attempts to do something usefull with it. It must be real fun (seriously) and nothing wrong with that.
Unfortunatly, some modern software is not comptible with it. SOYL, deal with it any way you want. It is not reasonable to adapt software for machines outaged years ago.
Title: Re: Compiling aMuleD on HP-UX
Post by: Kry on November 05, 2005, 08:23:01 PM
lfroen, can you stop being an annoying nitpicker? If he just needs waitpid instead of wait4, it's cool for me. We try to support *as much as we can* without breaking functionality. this is a good example.
Title: Re: Compiling aMuleD on HP-UX
Post by: Inkus on November 05, 2005, 10:17:33 PM
Quote
Originally posted by lfroen
Now I see what's going on :) You've got yourself aged out machine which eventually have quite rate architecture and OS. Now you entertaining yourself with attempts to do something usefull with it. It must be real fun (seriously) and nothing wrong with that.
Exactly.   ;)

Quote
Originally posted by lfroen
Unfortunatly, some modern software is not comptible with it. SOYL, deal with it any way you want. It is not reasonable to adapt software for machines outaged years ago.
I wouldn't call it is despairingly outaged. Actually, amule is the first software I could not run at all on that machine because of bus errors. Maybe that's because most of software I have compiled was GNU soft or very popular and  developed for a long time. Maybe my compiler is not working correctly, or maybe I am doing something wrong, or just am out of luck.  ;(

Quote
Originally posted by Kry
If he just needs waitpid instead of wait4, it's cool for me. We try to support *as much as we can* without breaking functionality. this is a good example.
I agree with Kry here. If I am not wrong, wait4 does not exist on some AIX versions too. Modern HP-UX (and I guess AIX) OS versions do have wait4 available. But the fact, that waitpid is implemented as wait4 with last argument equal null, does not mean, that wait4 should be used instead. If you gain more compatibility using generic versions of a function, IMO that's the way to go.  :P
Title: Re: Compiling aMuleD on HP-UX
Post by: Kry on November 06, 2005, 01:02:24 AM
Specially if we just use latter param as null.

BTW, what about using gdb to show us where the bus error happens?
Title: Re: Compiling aMuleD on HP-UX
Post by: Inkus on November 06, 2005, 05:12:21 AM
I get internal error in gdb, because gdb is out of memory :(
Title: Re: Compiling aMuleD on HP-UX
Post by: phoenix on November 06, 2005, 01:05:32 PM
Quote
Originally posted by lfroen
...
Quote
n aMule source I needed only one change yet : aMule.cpp - to change wait4 call to waitpid, since there is no wait4 on hp-ux 11.0
Too bad again.
You welcomed to change what you want, document it and place patch in wiki. No change going into code. We applied patch for ARM because people actually buy those devices, and running amule(d) there make sence, considering their design and purpose. This is not the case with all proprietary Unix'es out there like AIX, HPUX, QNX and others: very expansive hardware used by goverment/academic/coprs for very specific purposes. Not ever intended for private use.
Sorry, but I seem to be missing something here. Why isn't the change going into code? I have asked all the devs in a previous post if there was any objections, but when I do that, I expect to read objective reasons not to include this change. Like Kry said, it has always been a policy of the project to support as many platforms as we can, damn, we even support windoze! So unless you have a very good reason not to do it, something like "it breaks platform X", I vote for including this change in the code.
Title: Re: Compiling aMuleD on HP-UX
Post by: Kry on November 06, 2005, 08:28:35 PM
Why is it not even commited yet? DO I have to do everything? :P
Title: Re: Compiling aMuleD on HP-UX
Post by: phoenix on November 09, 2005, 10:32:57 AM
Committed.