aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 ... 19 20 [21] 22 23 ... 37

Author Topic: RRM's epic struggle for a better aMule on high-speed connections  (Read 165838 times)

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
RRM's epic struggle for a better aMule on high-speed connections
« Reply #300 on: December 15, 2009, 03:34:00 PM »

Actually it shouldn't be that important (well, at least that's not a know problem), but "gettext" is probably the package you are looking for.
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #301 on: December 15, 2009, 03:50:21 PM »

but which one?
there are so many gettext packages...
oh, stupid me, again, i didnt see that one of them is described as:
"GNU internationalization utilities".
So, no more warnings!!!

While performing step 6 (installing) i noticed a lot of warnings flashing by...
hope it doesnt mean anything...

But then, after the final part of step 6:
Code: [Select]
make[2]: Leaving directory `/home/rrm/tmp/amule'
make[1]: Leaving directory `/home/rrm/tmp/amule'
rrm@rrm-desktop:~/tmp/amule$ cd /usr/local/stow
rrm@rrm-desktop:/usr/local/stow$ sudo stow amule-opt
rrm@rrm-desktop:/usr/local/stow$

What to do next?
« Last Edit: December 15, 2009, 04:02:38 PM by RRM »
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #302 on: December 15, 2009, 04:11:40 PM »

he he, silly me....  ::)
just start aMule!!!

IT WORKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  8)
« Last Edit: December 15, 2009, 04:13:17 PM by RRM »
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #303 on: December 15, 2009, 04:16:37 PM »

Can/Should i install a different version as well?
I like this shit...
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #304 on: December 15, 2009, 04:21:21 PM »

IT WORKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  8)
Hey congratulations RRM! The first time is always the hardest!

I'm sorry I didn't provide you with the right set of packages.

Now, as you guessed, you have aMule's source code in ~/tmp/amule

You can update the source code with git pull or by changing/replacing files as instructed.

Remember that now that you have your sourcecode and build environment set up, compiling again is a matter of

Code: [Select]
$ make
$ sudo make install

If you don't want to change the install directory. If you want to change it or modify some build options (like debug, etc...) you need to call configure previously, then make.

BTW, just to check you got right the compilation could you send us the output of
Code: [Select]
$ cd ~/tmp/amule
$ cat config.log | grep DEBUG
$ head config.log

p.d: You almost did a very dangerous thing trying to install zlib by hand, if in doubt ask us, we will gladly help you.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #305 on: December 15, 2009, 04:21:49 PM »

Can/Should i install a different version as well?
I like this shit...
;D ;D ;D

I think right now you should test STU's change.

I instructed you to use stow as in the foreseeable future you may need to use several versions.

For instance, suppose you want to have a stock aMule an STU's one. With git you can create a branch, but this may be  a little bit hard for you, so better we copy the directories:
Code: [Select]
$ # Go to a temp directory
$ cd ~/tmp
$ # We have amule code already, just copy it
$ cp -r amule amule-upstream
$ mv amule amule-stu
$ # now amule-stu contains amule sourcecode and amule-upstream should contain unmodified code.
$ # Fix the changed file
$ cd amule-upstream
$ git checkout src/amule.cpp
$ # The previous command will restore the file.
$ # Now build both, we could use a shell command like for i in upstream stu to perform the build faster
$ ./configure --prefix=/usr/local/stow/amule-upstream-opt-debug/ --enable-geoip --enable-optimize --enable-debug --with-wxdebug --mandir=/share/bin
$ make -j 2 && sudo make install
$ cd ../amule-stu
$ ./configure --prefix=/usr/local/stow/amule-stu-opt-debug/ --enable-geoip --enable-optimize --enable-debug --with-wxdebug --mandir=/share/bin
$  make -j 2 && sudo make install
$ cd /usr/local/stow
$ ls
$ # Now you have several aMules here, you may switch with stow -D (unstow) and stow
« Last Edit: December 15, 2009, 04:29:08 PM by btkaos »
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #306 on: December 15, 2009, 05:10:13 PM »

Quote
Hey congratulations RRM!

Thank you, it was fun!

Quote
You can update the source code with git pull

Is it always the same, like this?
Code: [Select]
$ git clone git://repo.or.cz/amule.git
Quote
Remember that now that you have your sourcecode and build environment set up, compiling again is a matter of

Code: [Select]
$ make
$ sudo make install

If you don't want to change the install directory.

Will that replace the current aMule program (the tilted blue square)?
and if i call
Code: [Select]
~/tmp/amule$ ./configure --prefix=/usr/local/stow/amule-2/ --enable-geoip --enable-optimize --disable-debug --mandir=/share/bin
$ make
$ sudo make install

I will get a second program in the same folder?
or a second amule folder (amule-2) in the same tmp folder?
But why not like this?
Code: [Select]
$ make -j 2
$ sudo make install
$ cd /usr/local/stow
$ sudo stow amule-2

Quote
If you want to change it or modify some build options (like debug, etc...) you need to call configure previously, then make.

but not like this?
Code: [Select]
$ make -j 2
$ sudo make install
$ cd /usr/local/stow
$ sudo stow amule-opt

Quote
BTW, just to check you got right the compilation could you send us the output of
Code: [Select]
$ cd ~/tmp/amule
$ cat config.log | grep DEBUG

configure:7621: checking if wxWidgets was built in DEBUG mode
WX_DEBUG='0'

Quote
Code: [Select]
$ head config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by aMule configure SVN, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ ./configure --prefix=/usr/local/stow/amule-opt/ --enable-geoip --enable-optimize --disable-debug --mandir=/share/bin

## --------- ##
## Platform. ##

Quote
You almost did a very dangerous thing trying to install zlib by hand, if in doubt ask us, we will gladly help you.

Sorry, i thought i was bothering you guys too much
and had to find some answers myself... :-[
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #307 on: December 15, 2009, 05:30:32 PM »

Quote
you may switch with stow -D (unstow) and stow

How do you mean?
How can i run these 2 versions?
Will all 3 versions obtain and write their data from and to the same ~/.aMule folder?
« Last Edit: December 15, 2009, 05:34:46 PM by RRM »
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
RRM's epic struggle for a better aMule on high-speed connections
« Reply #308 on: December 15, 2009, 09:39:19 PM »

Wow, you've been busy I see. You know, there are instructions for building, but it's sure more fun to figure it out on your own.  :)

I'm a little lost on that "stow" thing. You can build the source so it installs into different place using the --prefix option as you've been told. --prefix sets the path where make install will put the files. You can also install it to a path in your home (like ~/tmp/bin ) and so install it without sudo.
To run it just give the path to select the executable you want, like /usr/local/stow/amule-2/amule . You can even run it without install from the place where you've built it with src/amule, that's probably the easiest way for test versions.

And yes, wherever you've installed it, it will always use your same config / temp files / share. We aren't doing anything fancy here, so need to back up anything (well, no more need than every other day).

Now just copy the amule.cpp I posted into the src dir (overwriting the original one, cd to ~/tmp/amule, type
touch src/amule.cpp
make
and run it with
src/amule
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

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #309 on: December 15, 2009, 11:46:24 PM »

Dear RRM, let me explain some basic concepts and see if that solves your questions.

Computer programs are usually created using a programming language, which contains instructions for the computer.

Programs using a particular programming language may be "compiled" or run directly from its source. Compiling means the computer takes the program and converts it to a faster form, by removing useless code, optimizing what the programmer wrote, etc... We call that faster form the "binary" and the editable one "source code".

In aMule's case, the programming language used is C++, which in general needs to be compiled. Compiling the whole aMule software, which consists of hundreds or source files is called building, and the result of building is called a build. Note that you cannot run source code without compiling unless you are really an expert.

Apart from that, complex programs like aMule allow to set some compiler options, and the binary will be different. Those options are optimization level, debug level, libraries to use, etc... The reason that those options are compile-time and not settable from the Preferences panel is that in general are hard to do. For instance, a debug build will contain extra low-level instructions that are impossible to remove without recompiling.

Now, lets apply all the above to your situation.

First of all, in order to produce an aMule binary you need to fetch the "source code", that is, the form of the program that programmers can easily edit. This is needed so we can easily change aMule behavior and you may test it.

There are several ways of getting aMule's source code, a quick one is using git, a program whose whole purpose is to track changes to source code.

When you do a git clone $url, you "clone" that is to say, fetch the whole source code available at $url. Note that if the developers update the source code git helps you avoiding to download the whole source code. The command to update the source code is git pull, and it will download only the changes you don't have in your local copy. Of course this is much faster than downloading again all the source code. git can be used for a lot of thing (like sending changes to aMule developers), but just knowing git clone and git pull should be enough for you. (By the way, git checkout "extracts" a file from the saved version)

So far so good, you should have learned how to fetch and update aMule source code. Now lets see what can we do with the source code: Generating an aMule binary and misc files, so you can run aMule.

The first step is to "configure" the build process. In this step you tell the build system where will  aMule binaries be installed, and may set several options. So that's exactly what prefix means, the install location.  (I know prefix is a cryptic name for that) Enabling debug and optimizations are options, you may see all options calling ./configure --help

For packages compiled by the users, Ubuntu follows a convention that binaries should be placed under /usr/local/, but as STU said, you may place the binaries whenever you want. I recommend you to place them under /usr/local/stow/$build-name

Now let me to introduce stow to you. When compiling and installing some software, the default prefix will be /usr/local, so you once you finish the build you'll get a binary like /usr/local/bin/amule

So far so good, /usr/local/bin  is in your PATH by default  (a variable which tells the system where to look for binaries) , so you can type amule and it will start.

Now imagine you want to change some build options or the actual source code. You build aMule again and you get a new /usr/loca/bin/amule. What happens if you want to have both builds available?

Now stow enters in the equation. Stow allows you to install software in /usr/local/stow/ and select which version should be made the default, that is to say, the one present in /usr/local/bin

This way, using stow you build aMule and set the prefix to install it in /usr/local/stow/amule-myowncoolversion. Now you have a complete aMule build living in /usr/local/stow/amule-myowncoolversion, but as this location is not in the default path you may encounter some problems. So you change the current directory to /usr/local/stow and do
$ stow amule-myowncoolversion. Now that version is the default one.

Now you have some changes in aMule,  so you call configure again and tell it to install this new build in other location [always under /usr/local/stow] You may go to /usr/local/stow, unstow the previous one and stow the new one. Do you need to try the old one? Just unstow/stow again and you are set.

Of course, as STU said this is not really needed, but I like to be methodical.

The last bits remaining is to explain make and make install. Make performs the actual build and make install will install the software where prefix indicated.

Really last paragraph: configuration files are stored in a per user location, so changing the binary doesn't affect them. Think of upgrading Firefox, you get a new program, but all your settings are retained because they live in a different location.

Is it always the same, like this?
Code: [Select]
$ git clone git://repo.or.cz/amule.git
git clone downloads aMule source code from zero. git pull updates it to newer versions, so you should only use git when you want to fetch changes from aMule developers.
Quote
[Will that replace the current aMule program (the tilted blue square)?
and if i call
Code: [Select]
~/tmp/amule$ ./configure --prefix=/usr/local/stow/amule-2/ --enable-geoip --enable-optimize --disable-debug --mandir=/share/bin
$ make
$ sudo make install
I will get a second program in the same folder?
or a second amule folder (amule-2) in the same tmp folder?
But why not like this?
Code: [Select]
$ make -j 2
$ sudo make install
$ cd /usr/local/stow
$ sudo stow amule-2
You will get the program in the folder you choose in configure using the --prefix parameter. If you make again without changing the folder, the new program will overwrite the old. Both behaviour make sense.
Quote
but not like this?
Code: [Select]
$ make -j 2
$ sudo make install
$ cd /usr/local/stow
$ sudo stow amule-opt
This will build amule (make -j2), install amule in whatever prefix is set (sudo make install) go to stow location (/usr/local/stow) and stow amule-opt.
Quote
Code: [Select]
configure:7621: checking if wxWidgets was built in DEBUG mode
WX_DEBUG='0'
$  head config.log
 $ ./configure --prefix=/usr/local/stow/amule-opt/ --enable-geoip --enable-optimize --disable-debug --mandir=/share/bin
You must compile with --enable-debug --with-wxdebug.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #310 on: December 16, 2009, 12:23:48 AM »

Umm, summaring the long history of this crash, I got and idea.

Run
Code: [Select]
$ sudo bash -c "ulimit -n 65536; ulimit -n; su -m -c 'ulimit -n; id -nu' \"`id -un`\""
Check that it outputs 65536 two times.
Then run amule using this
Code: [Select]
$ sudo bash -c "ulimit -n 65536; ulimit -n; su -m -c 'ulimit -n; gdb amule' \"`id -un`\""
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #311 on: December 16, 2009, 12:27:25 AM »

You may also try:

Code: [Select]
$ sudo bash -c "echo 2048 > /proc/sys/net/core/somaxconn"
« Last Edit: December 16, 2009, 12:29:03 AM by btkaos »
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #312 on: December 16, 2009, 08:15:12 AM »

To run it just give the path to select the executable you want, like /usr/local/stow/amule-2/amule

Ok, in the terminal, right?
But why then, do i type: "gdb amule" and "run" to normally run it?

Quote
You can even run it without install from the place where you've built it with src/amule,

Ah, ok, so to run the 2 other versions,
i need to write in a terminal:

tmp/amule-stu/src/amule
or
tmp/amule-upstream/src/amule

?
But i also found those executables here...
so maybe i need to type this:

/usr/local/stow/amule-opt/bin/amule
or
/usr/local/stow/amule-stu-opt-debug/bin/amule
?

Quote
Now just copy the amule.cpp I posted into the src dir

But, i already did that in step 3 and 4...


3. I download the modified file (amule.cpp) that Stu gave me.

4. I delete the amule.cpp in ~/tmp/amule/src/
and replace it with the downloaded amule.cpp

right?
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #313 on: December 16, 2009, 09:36:12 AM »

Wow, Bill...
Thank you very much for that detailed information!!!
That helped a lot, indeed.

Quote
When compiling and installing some software, the default prefix will be /usr/local,
so you once you finish the build you'll get a binary like /usr/local/bin/amule

So, i cannot simply run these executables by using a terminal?
/usr/local/stow/amule-opt/bin/amule
/usr/local/stow/amule-stu-opt-debug/bin/amule

Quote
Now imagine you want to change some build options or the actual source code.
You build aMule again and you get a new /usr/local/bin/amule.

So, the executable file over there (/usr/local/bin/amule) with the arrow
is the actual and only amule executable that i run when typing "amule"?

Quote
Stow allows you to install software in /usr/local/stow/ and select which version should be made the default, that is to say, the one present in /usr/local/bin
This way, using stow you build aMule and set the prefix to install it in /usr/local/stow/amule-myowncoolversion.

You mean:
/usr/local/stow/amule-opt
and
/usr/local/stow/amule-stu-opt-debug
right?

Quote
but as this location is not in the default path you may encounter some problems. So you change the current directory to /usr/local/stow and do
$ stow amule-myowncoolversion. Now that version is the default one.

Im sorry, i dont understand.
You mean i should change "/usr/local/stow/amule-opt" (or  "/usr/local/stow/amule-stu-opt-debug") into "/usr/local/stow" ?
How do i change that?

Quote
Now you have some changes in aMule,  so you call configure again and tell it to install this new build

Do you mean that i first type:
Code: [Select]
$ git pull git://repo.or.cz/amule.gitand then:
Code: [Select]
$ ./configure --prefix=/usr/local/stow/amule-opt/ --enable-geoip --enable-optimize --disable-debug --mandir=/share/bin
or:
$ ./configure --prefix=/usr/local/stow/amule-stu-opt-debug/ --enable-geoip --enable-optimize --enable-debug --with-wxdebug --mandir=/share/bin
and then:
Code: [Select]
$ make -j 2 && sudo make install
$ cd /usr/local/stow
$ sudo stow amule-opt
or:
$ make -j 2 && sudo make install
$ cd /usr/local/stow
$ sudo stow amule-stu-opt-debug

right?

Quote
You may go to /usr/local/stow, unstow the previous one and stow the new one. Do you need to try the old one? Just unstow/stow again and you are set.

?Huh?
I dont understand; how do i do this?

Quote
Of course, as STU said this is not really needed, but I like to be methodical.

Me too, otherwise i get confused for sure...

Quote
You must compile with --enable-debug --with-wxdebug.

For both versions?
But then they will be exactly the same, no?
« Last Edit: December 16, 2009, 09:47:26 AM by RRM »
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #314 on: December 16, 2009, 09:46:14 AM »

Umm, summaring the long history of this crash, I got and idea.

Run
Code: [Select]
$ sudo bash -c "ulimit -n 65536; ulimit -n; su -m -c 'ulimit -n; id -nu' \"`id -un`\""
Check that it outputs 65536 two times.
Then run amule using this
Code: [Select]
$ sudo bash -c "ulimit -n 65536; ulimit -n; su -m -c 'ulimit -n; gdb amule' \"`id -un`\""

Rev 9901 still runs smoothly,
shouldnt i wait till it crashes?
Logged
Pages: 1 ... 19 20 [21] 22 23 ... 37