aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Compilation  (Read 3807 times)

InuY4sha

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Compilation
« on: April 13, 2008, 03:19:12 AM »

I know I could do th ejob by myself.. but I should read the code and everything... what I would like is a COMPLETELY SEPARATED code for the command line and the webserver.. I don't understand why I have to pass through the wxDC structure (such a pain in the ass is incredible..) in order to get a running daemon working, when what I need is just that.

Ciao :)
Riccardo
Logged

Festor

  • Hero Member
  • *****
  • Karma: 79
  • Offline Offline
  • Posts: 935
  • Offline -> Studying...
Re: Compilation
« Reply #1 on: April 13, 2008, 03:30:48 AM »

InuY4sha

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compilation
« Reply #2 on: April 13, 2008, 05:10:04 PM »

Still I couldn't manage to compile a "basic" version... I'm trying to crosscompile for LaFonera and I'm having a lot of troubles due to extra packages that are compiled and probably not needed by aMuled
...
If you know something useful (such as the source dependencies of amuled and amulecmd) it would probably help..
Thanks
R
Logged

InuY4sha

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compilation
« Reply #3 on: April 13, 2008, 07:03:22 PM »

To be more specific, (I'm working under Ubuntu which I know is not the best for this kind of things) the problem is spinning around zlib and wx; the source code is full of references to these libraries wich are precompiled. I'm able to cross-compile the object files needed but when it comes to linking It's of course impossile as the object files are in "MIPS" binary code, while the libraries are compiled for i586 processors.
There are some solutions to the problem:
1) cross-compile the required libraries from a scratch [but again I could have troubles with other dependencies]
2) redraw the code to allow compilation of the sourcecode without requiring these libraries... [quite hard but then it would probably provide amazing results] What I mean by this is a couple of --disable-wx --disable-zlib [if it's even possible] to minimize the requirements for something that is NOT EVEN NEEDED In the end... as I'm going to run this app on a 183MHz processor that could NEVER handle wx graphical stuff...
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Compilation
« Reply #4 on: April 13, 2008, 07:18:39 PM »

You don't seem to know what wxWidgets and zlib are.
Logged

InuY4sha

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compilation
« Reply #5 on: April 13, 2008, 08:21:45 PM »

probably true, I only understood that wx stuff is related to graphics (which I don't need)... it looks like a port from windows from what I was reading here and there... btw I was able to cross compile and obtain a libz.a (whatever it is..) and now I also managed to crosscompile and obtain wx-base something.. let me paste the file name... Yes this one : "libwx_base-2.8.so.0.4.0"... not bad, but now, when trying to link everything in aMule it looks like there's still a wx.NET library which is needed... I got the sources for that, but they look quite strange.. no Makefile... and those ".cs" extensions that made me think about C# (C sharp?)... am I right in guessing it's totally impossible to crosscompile that aMule on a small/low power/low frequency and low memory MIPS processor with DD-Wrt running on top?
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Compilation
« Reply #6 on: April 13, 2008, 08:38:00 PM »

the problem is spinning around zlib and wx
Don't forget cryptopp. If you haven't mentioned it, you're trying to link with the Intel lib probably.
It compiles fine with Mips like that:

 set PATH, CFLAGS, CXXFLAGS and CXX for your crosscompiler

get wxGTK 2.8.7 source (it's THE basic library, used for strings, files, networking, whatever...)
You can easily build it without any graphic stuff at all:
../configure --enable-unicode --without-subdirs --disable-gui --disable-expat --prefix=/home/jars/work/wx/mips --exec-prefix=/home/jars/work/wx/mips --build=i386-linux-gnu --target=mipsel-linux --host=mipsel-linux
make , make install

get Cryptopp (for anything Crypto-related, from MD4 to AIC)
fix CXXFLAGS in GNUMakefile:
make
export PREFIX=/home/jars/work/cryptopp/mips
make install

zlib was already included in my build environment (it's used for compression)
I compiled it some time ago though and found no problem there.

Then build aMule with something like
./configure --disable-monolithic --enable-amule-daemon --with-toolkit=base --with-wx-config=/home/jars/work/wx/mips/bin/wx-config --prefix=/home/jars/work/amule/mips --build=i386-linux-gnu --target=mipsel-linux --host=mipsel-linux --with-zlib=/home/jars/work/freetz/trunk/toolchain/target/ --disable-upnp --disable-ed2k --with-crypto-prefix=/home/jars/work/cryptopp/mips --disable-nls

You shouldn't try to run it on a low memory processor incapable of proper paging though.  ;D
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

InuY4sha

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compilation
« Reply #7 on: April 13, 2008, 08:51:33 PM »

My sincere thanks! Now it's late here and I'm quite fed up with wx libs, but I'll try and let you know... regarding memory....
http://www.dd-wrt.com/wiki/index.php/LaFonera_Hardware_SD-Card
This is WHY I want to make sure that aMule is working fine... it would not be nice if I did the hw modifications and then the software cannot properly run.. right? :)

CIao
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Compilation
« Reply #8 on: April 13, 2008, 11:06:00 PM »

16 MB, well... I've tried it on my AVM Fritz!-Box 7170 with 32 MB. It actually did run 3 months ago, but the current build just exits after a short time. Anyway, a little proggy allocating memory in 1MB chunks simply causes the box to reset at 28MB (even WITH swap turned on).
Considering current code loads a complete chunk (9.5MB) into memory for hashing, I fear it is quite hopeless even on a 32MB box, not to mention 16MB.  :(
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

InuY4sha

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compilation
« Reply #9 on: April 18, 2008, 08:46:59 PM »

Weeekeeend time!!!
Ok back to the topic... as I said.. I could run amule on the SD and use that for paging and chunk buffering... even if it won't last more than 1year because writing times are limited it's not a problem... I'll buy another one eventually.. :) don't care
Logged