aMule Forum

English => Multiplatform => Mac OSX => Topic started by: isulzer on March 27, 2008, 09:11:14 PM

Title: Universal Compile for tiger and leopard
Post by: isulzer on March 27, 2008, 09:11:14 PM
This should work with Tiger and Leopard on g3, g4, g5 and intel architectures... im not sure if the libraries are all statically linked though. but I cant test it so someone let me know what kind of errors they get....
http://www.megaupload.com/?d=FZKO6SU6 (http://www.megaupload.com/?d=FZKO6SU6)
http://rapidshare.com/files/102841373/aMule-CVS-20080326.zip.html (http://rapidshare.com/files/102841373/aMule-CVS-20080326.zip.html)

Please see bottom of thread for newer version.
Title: Re: Universal Compile for tiger and leopard
Post by: hardtraks on March 27, 2008, 09:16:30 PM
Hi!
Not launching on my G4 2x500 mhz and tiger 10.4.11
But thanks anyway !  ;)
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on March 27, 2008, 09:21:57 PM
can you run it from the terminal so it tells you what errors you get?
to do this right click, or control click on the .app and show packages contents. Navigate through Contents/MacOS/ and drag amule onto a terminal window to get its full path there. then hit enter. Doing this should tell you what libraries arent included i think. you can also add the -o option after amule to channel everything into the stdout.
Title: Re: Universal Compile for tiger and leopard
Post by: hardtraks on March 27, 2008, 10:14:19 PM
Ok:
Code: [Select]
$ /Users/hardtraks/Desktop/aMule-CVS-20080326/aMule.app/Contents/MacOS/amule -o
dyld: Library not loaded: /usr/lib/libiconv.2.dylib
  Referenced from: /Users/hardtraks/Desktop/aMule-CVS-20080326/aMule.app/Contents/MacOS/amule
  Reason: Incompatible library version: amule requires version 7.0.0 or later, but libiconv.2.dylib provides version 5.0.0
Trace/BPT trap
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on March 27, 2008, 10:20:32 PM
K yeah. Typo there. didnt use the 10.4 sdk properly. Ill fix that.
Title: Re: Universal Compile for tiger and leopard
Post by: eisa01 on March 28, 2008, 06:57:53 PM
Thanks! Launched fine for Leopard PPC.
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on March 28, 2008, 07:59:30 PM
Yeah its the tiger part thats the problem. Compiling with the 10.4 sdk is just screwy. Since it seem that aMule needs versions of default libraries that are much newer than those available for 10.4.11. I guess ill just have to make a list of the differences and compile them statically on 10.5 and hope it works? Also means i need access to a 10.4.11 machine. which i don't have. Everyone i know has upgraded.
Title: Re: Universal Compile for tiger and leopard
Post by: fced on March 29, 2008, 01:32:53 AM
Thanks
it work for me, on a Powerbook 1.25ghz with Leopard and on macbook Intel 2.3ghz also with leopard 10.5.2
Title: Re: Universal Compile for tiger and leopard
Post by: rigodon on March 30, 2008, 03:31:08 PM
It works but my CPU is burning at 100% with this version. imacCore Duo.
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on March 31, 2008, 09:32:10 AM
Maybe describe what youre doing a bit more how many open files you have etc.... also what does the log say?(you can find this in the console(/Applications/Utilities/Console.app)... or just run it from the terminal with previous mentioned steps) It could be that i missed something important... would be nice to know what.
Title: Re: Universal Compile for tiger and leopard
Post by: eisa01 on March 31, 2008, 05:12:37 PM
I had aMule peg as much CPU as it could get when I was downloading just one file at 100-200K and uploading at 50K. I was also just sharing this one file. Less than 100 sources total

But aMule has always been a resource hog, so I don't think it's anything with your build.

I think there are great optimization opportunities, I tried sampling it in Instruments, and there were 3 things that took 75% of the total. There were also some unicode functions which took 5%, which I find very strange, as it shouldn't need to convert unicode all the time.

Note I'm not a programmer, so my knowledge is not the best about this.
Title: Re: Universal Compile for tiger and leopard
Post by: wuischke on March 31, 2008, 05:59:37 PM
Could you give us information (preferably in a new thread) about aMule's optimization potential on Mac? We're of course interested in making aMule better, but we're always short on Macs. ;)
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on April 01, 2008, 10:25:30 PM
Heres a new version with aMule-CVS-20080401 and a static libiconv for tiger people. It also has prebinding, so it should load faster.
As always, if you find an issue, please run it in the terminal and let me know the output. Id like to know which libraries are missing for tiger.

Im running it, and the most it hit was 20% of one core when it opened a huge amount of connections.

http://www.megaupload.com/?d=KJFFVN4R (http://www.megaupload.com/?d=KJFFVN4R)
http://rapidshare.com/files/104113281/aMule-CVS-20080401-static-libiconv.zip.html (http://rapidshare.com/files/104113281/aMule-CVS-20080401-static-libiconv.zip.html)
Title: Re: Universal Compile for tiger and leopard
Post by: hardtraks on April 02, 2008, 01:08:52 AM
Same here:
Code: [Select]
$ /Users/hardtraks/Desktop/aMule-CVS-20080401-static-libiconv/aMule.app/Contents/MacOS/amule -o
dyld: Library not loaded: /usr/lib/libiconv.2.dylib
  Referenced from: /Users/hardtraks/Desktop/aMule-CVS-20080401-static-libiconv/aMule.app/Contents/MacOS/amule
  Reason: Incompatible library version: amule requires version 7.0.0 or later, but libiconv.2.dylib provides version 5.0.0
Trace/BPT trap
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on April 02, 2008, 01:50:40 AM
So it didnt actually link with the static library.... wth. Amule config said it did....
K im gonna make a 3rd partition and reinstall tiger... play with it on the minimal install.
Title: Re: Universal Compile for tiger and leopard
Post by: hardtraks on April 02, 2008, 02:06:03 AM
Thank you for the effort  :)

I'm going to download Xcode and give a try too  :P even if I don't understand anything atm. 
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on April 02, 2008, 06:48:00 AM
Problem is alot of people say that since late november/early december, they cant compile those amule CVS for tiger. I have no idea though if this is correct or not. Thats about the time my laptop with tiger on it got stolen. And it took me about a month to get the money to buy a new one... heh. It came with leopard...
Title: Re: Universal Compile for tiger and leopard
Post by: blackfede on April 02, 2008, 03:14:05 PM
The version on libiconv shipped with tiger is 5.0.0, but we need the 7.0.0, so i tried to install libiconv via darwinports... bingo! Version 7.0.0! So you can use that!
Anyway i do the tricks, and change the reference to point at version instelled with darwinports, but there'a another problem....

Code: [Select]
[14:12] MacOS$> otool -L amule
amule:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
        /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
        /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 14.0.0)
        /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit (compatibility version 1.0.0, current version 525.13.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
        /opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.10.0)
        /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.27.0)
        /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.15.0)
[14:12] MacOS$> ./amule
dyld: lazy symbol binding failed: Symbol not found: _open$UNIX2003
  Referenced from: /Users/blackfede/Desktop/aMule-CVS-20080401-static-libiconv/aMule.app/Contents/MacOS/./amule
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _open$UNIX2003
  Referenced from: /Users/blackfede/Desktop/aMule-CVS-20080401-static-libiconv/aMule.app/Contents/MacOS/./amule
  Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap


Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on April 03, 2008, 04:07:18 AM
The whole point is to have a binary that can be run on an out of the box tiger... and leopard. or at least with only updates from apple.
Title: Re: Universal Compile for tiger and leopard
Post by: blackfede on April 03, 2008, 10:05:49 AM
I understand, but what i think is: if static link is difficult, why just don't include the libiconv in the bundle and play with install_name_tool to make it work correctly? libiconv require only libSystem.B, and this is a System lib.

By the way, another problem seems to be this libSystem.B: your build require version 111.0.0, but on Tiger i have 88.1.11. Now this is a problem i can't figure out how to resolve...
Title: Re: Universal Compile for tiger and leopard
Post by: blackfede on April 03, 2008, 10:36:40 AM
Maybe i'm wrong, but i think is not possible to build a unique bundle for Tiger and Leopard. We must build one for Tiger (Universal) and one for Leopard (Universal). Did you agree?
Title: Re: Universal Compile for tiger and leopard
Post by: rigodon on April 03, 2008, 06:47:41 PM
http://forum.amule.org/index.php?topic=13726.0

This version is leopard only i think, and it's fine.
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on April 03, 2008, 07:48:12 PM
Yeah we know. thats an old version though. It possible to build applications thats run on both tiger and leopard. the problem is dependencies.
Title: Re: Universal Compile for tiger and leopard
Post by: blackfede on April 04, 2008, 10:24:55 PM
We should look for a way to compile aMule using Tiger SDK, it must be possible to set a flag, to use 10.4u SDK. So, in this way, if you build for Tiger, it will be ok for Leopard to!
In Xcode, i know how to do this, just go in Project -> Edit Project Settings -> Cross-Develop Using Target SDK -> 10.4u.
Title: Re: Universal Compile for tiger and leopard
Post by: blackfede on April 04, 2008, 10:34:51 PM
Maybe the isysroot is what we need! Can you give it a try? If you don't have 10.4u SDK, you can download for free at Apple Developer Connect: http://connect.apple.com/
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on April 05, 2008, 08:13:50 PM
the -isysroot /Developer/SDKs/MacOSX10.4u.sdk
is the way to do that. If you look carefuly, wxmac is compiled with that option by default. the problem though, is that it wont begin to compile amule. It gives me errors about multiple declarations and missing defines etc... probably due to versions of libraries
and yeah it works fine with the 10.5 sdk.
Title: Re: Universal Compile for tiger and leopard
Post by: blackfede on April 07, 2008, 09:17:51 AM
So we return back to the problem of compilation under 10.4... there are a lot a topic with people who can't compile aMule with 10.4, including myself... Did you get some error about wxChar and/or wxString operator?
Title: Re: Universal Compile for tiger and leopard
Post by: isulzer on April 07, 2008, 10:34:16 PM
You get that error if you compile under 10.4 i get different ones with the 10.4 sdk under 10.5. I think the problem is that amule is expecting content of header files that dosent exist(because of the older versions). Maybe I can compile all the libraries needed under tiger statically and then compile amule. To do that i need to triple boot into tiger. Which means i need refit and to repartition my drive, which is a bit annoying. or maybe i can use an external drive and save myself the hastle. Ill play with that tonight. Havent had time cus ive been busy.