Difference between revisions of "HowTo compile on Mac"

From AMule Project FAQ
Jump to: navigation, search
m
Line 2: Line 2:
  
 
# You can simply download the finished application ('binary release') or  
 
# You can simply download the finished application ('binary release') or  
# you compile it from a cvs source snapshot.
+
# You compile it from a [[aMule CVS|CVS source snapshot]].
  
 
''The preceding version of this page covering aMule 2.0.0rc8 and earlier is archived [[HowTo_compile_on_Mac_v200rc8|here]].''
 
''The preceding version of this page covering aMule 2.0.0rc8 and earlier is archived [[HowTo_compile_on_Mac_v200rc8|here]].''
Line 8: Line 8:
 
== Binary releases ==
 
== Binary releases ==
  
If you don't want to bother with installing and compiling all those tools and sources, then get one of the pre-compiled aMule applications. The official release is considered 'stable', but every now and then applications are built from the current source to allow more people to test new features or the like.  
+
If you don't want to bother with installing and compiling all those tools and sources, then get one of the pre-compiled [[aMule]] applications. The official release is considered 'stable', but every now and then applications are built from the current source to allow more people to test new features or the like.  
  
# latest official binary release: [http://www.amule.org/files/download.php?file=72 aMule-2.0.0-Mac]
+
# Latest official binary release: [http://www.amule.org/files/download.php?file=72 aMule-2.0.0-Mac]
# periodically compiled binary from cvs: [http://forum.amule.org/thread.php?threadid=5051 amule forum]
+
# Periodically compiled binary from cvs: [http://forum.amule.org/thread.php?threadid=5051 amule forum]
  
 
== Compiling from source ==
 
== Compiling from source ==
  
Compiling from source allows most current bug reports, because you can compile and test the cvs snapshot of the very day.
+
Compiling from source allows most current bug reports, because you can compile and test the [[aMule CVS|CVS snapshot]] of the very day.
  
To compile aMule from source you need some development tools, the wxWidgets library and the aMule source.
+
To compile [[aMule]] from source you need some development tools, the [[wxWidgets]] library and the [http://dl.amule.org aMule source].
  
 
=== Get the sources and development tools ===
 
=== Get the sources and development tools ===
Line 23: Line 23:
 
==== [http://developer.apple.com/tools/xcode Xcode] ====
 
==== [http://developer.apple.com/tools/xcode Xcode] ====
  
'XCode' is Apple's development environment. We need it for the gcc compiler. You may have XCode on CD/DVD, e.g. it is on the OSX10.4 DVD.  
+
[http://developer.apple.com/tools/xcode Xcode] is [http://www.apple.com Apple]'s development environment. We need it for the [http://gcc.gnu.org GCC] compiler. You may have [http://developer.apple.com/tools/xcode Xcode] on CD/DVD, e.g. it is on the [http://macos.apple.com OSX]10.4 DVD.
Else you can download it from Apple, but you must sign up for a free-of-charge developer account first.
+
 
 +
Else you can download it from [http://www.apple.com Apple], but you must sign up for a free-of-charge developer account first.
 +
 
 
# Get XCode from http://developer.apple.com/tools/download
 
# Get XCode from http://developer.apple.com/tools/download
 
# "Member Site"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install"
 
# "Member Site"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install"
 
  
 
==== [http://fink.sourceforge.net Fink] ====
 
==== [http://fink.sourceforge.net Fink] ====
  
'Fink' is an open source (OS) installer for lots of OS tools ported to Mac OSX. We need it to install the OS tool 'gettext'.
+
[http://fink.sourceforge.net Fink] is an open source (OS) installer for lots of OS tools ported to [http://macos.apple.com Mac OSX]. We need it to install the OS tool [http://www.gnu.org/software/gettext gettext].
# Get Fink from http://fink.sourceforge.net/download
+
 
# Read [http://fink.sourceforge.net/download Fink's installation guide] to learn how to install applications through Fink.
+
# Get [http://fink.sourceforge.net Fink] from http://fink.sourceforge.net/download
 +
# Read [http://fink.sourceforge.net/download Fink's installation guide] to learn how to install applications through [http://fink.sourceforge.net Fink].
  
  
 
==== [http://www.gnu.org/software/gettext gettext] ====
 
==== [http://www.gnu.org/software/gettext gettext] ====
  
'gettext' is an OS library for text internationalization. This library is used to make aMule multi-lingual.
+
[http://www.gnu.org/software/gettext gettext] is an OS library for text internationalization. This library is used to make [[aMule]] multi-lingual.
# get and install the 'gettext' library with 'Fink'. The package name is 'gettext'.  
+
# Get and install the [http://www.gnu.org/software/gettext gettext] library with [http://fink.sourceforge.net Fink]. The package name is [http://www.gnu.org/software/gettext gettext].  
  
 +
==== [[wxWidgets|wxMac]] ====
  
==== [http://www.wxwidgets.org/ wxMac] ====
+
[[wxWidgets|wxMac]] is the port of the [[wxWidgets]] library for [http://macos.apple.com Mac OSX]. This library is used to make [[aMule]] 'multi-platform'.
  
'wxMac' is the port of the 'wxWidgets' library for Mac OSX. This library is used to make aMule 'multi-platform'.
 
 
# Get the source from: http://prdownloads.sourceforge.net/wxwindows/wxMac-2.6.0.tar.gz
 
# Get the source from: http://prdownloads.sourceforge.net/wxwindows/wxMac-2.6.0.tar.gz
# Extract the archive. (just double-click it.)
+
# Extract the archive (just double-click it)
  
Or get the current cvs snapshot. Warning: the wxMac cvs is frequently in a bad condition.
+
Or get the current [[wx-cvs|CVS snapshot]]. Warning: the [[wxMac]] [[wx-cvs|CVS]] is frequently in a bad condition.
 
+
<pre>    bash: cd ~/Desktop
+
    bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
+
    Note: password is 'anoncvs'
+
    bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxMac
+
</pre>
+
  
 +
bash: cd ~/Desktop
 +
bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
 +
Note: password is 'anoncvs'
 +
bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxMac
  
 
==== [http://www.amule.org aMule itself] ====
 
==== [http://www.amule.org aMule itself] ====
  
# Get latest daily cvs source snapshot: [http://www.amule.org/files/download.php?file=5 aMule CVS]
+
# Get latest daily [[aMule CVS|CVS source snapshot]]: [http://www.amule.org/files/download.php?file=5 aMule CVS]
# Extract the archive. (just double-click it.)
+
# Extract the archive (just double-click it)
 
+
  
 
=== Compile the sources ===
 
=== Compile the sources ===
  
Put the amule folder and the wxMac folder at the same place, e.g. on the desktop.
+
Put the ''amule'' folder and the ''wxMac'' folder in the same place, e.g. on the desktop.
  
'''Important:''' If you use XCode 2.0 then your default compiler is gcc 4.0. Currently (2005-05-09) wxMac then only compiles with patches, and the CryptoPP library does not compile at all. Therefore, if you use XCode 2.0 then you must switch back to gcc 3.3 first. First check the version of your current default gcc with ''gcc --version'' and then switch to version 3.3 if required:
+
'''Important:''' If you use [http://developer.apple.com/tools/xcode Xcode] 2.0 then your default compiler is [http://gcc.gnu.org gcc] 4.0. Currently (2005-05-09) [[wxMac]] then only compiles with patches (and [http://www.eskimo.com/~weidai/cryptlib.html CryptoPP] doesn't compile at all). Therefore, if you use [http://developer.apple.com/tools/xcode Xcode] 2.0 then you should switch back to [http://gcc.gnu.org gcc] 3.3 first. First check the version of your current default [http://gcc.gnu.org gcc] with ''gcc --version'' and then switch to version 3.3 if required:
  
<pre>    bash: gcc --version
+
bash: gcc --version
    bash: sudo gcc_select 3.3
+
bash: sudo gcc_select 3.3
</pre>
+
  
 +
==== Compile [[wxMac]] ====
  
 +
This step is only needed once, even if you later download and compile a newer version of the [[aMule CVS]] source.
  
==== Compile wxMac ====
+
The following assumes that you have placed the above packages on your Desktop.<br>
 +
''cd'' into the ''wxMac'' folder, ''configure'' and ''make'':
  
This step is only needed once, even if you later download and compile a newer version of the aMule cvs source.  
+
bash: cd ~/Desktop/wxMac-2.6.0/build
 +
bash: ../configure --disable-shared --enable-unicode
 +
bash: make
  
The following assumes that you have placed the above packages on your Desktop.<br>
+
'''NOTE:''' This took approx. 30 minutes on a G4 at 1 GHz.
'cd' into the wxMac folder, 'configure' and 'make':
+
  
<pre>    bash: cd ~/Desktop/wxMac-2.6.0/build
+
==== Compile [[aMule]] ====
    bash: ../configure --disable-shared --enable-unicode
+
    bash: make
+
</pre>
+
  
This took approx. 30 minutes on my G4 at 1 GHz.
+
Now ''cd'' into the ''amule'' folder, ''configure'' and ''make'':
  
==== Compile aMule ====
+
'''NOTE:''' You can copy'n'paste the 4 lines for ''./configure'' in one go.
  
Now 'cd' into the amule folder, 'configure' and 'make':<br>
+
bash: cd ~/Desktop/aMule
((note: you can copy&paste the 4 lines for './configure' in one go))
+
bash: ./configure --disable-systray --disable-gtk    \
 
+
<pre>    bash: cd ~/Desktop/aMule
+
    bash: ./configure --disable-systray --disable-gtk    \
+
 
             --with-wx-prefix=../wxMac-2.6.0/build/lib/    \
 
             --with-wx-prefix=../wxMac-2.6.0/build/lib/    \
 
             --with-wx-config=../wxMac-2.6.0/build/wx-config \
 
             --with-wx-config=../wxMac-2.6.0/build/wx-config \
             --enable-debug --disable-optimise                    <-- OPTIONAL
+
             --enable-debug --disable-optimise                    '''''<font color="red">OPTIONAL</font>'''''
 
            
 
            
    bash: make
+
bash: make
    bash: strip src/amule                                        <-- OPTIONAL
+
bash: strip src/amule                                        '''''<font color="red">OPTIONAL</font>'''''
    bash: mv src/amule aMule.app/Contents/MacOS/
+
bash: mv src/amule aMule.app/Contents/MacOS/
</pre>
+
 
+
the two lines marked as OPTIONAL are optional, that is, the last two options to ./configure and the strip command. They result in a dramatically reduced file size (approx. 3 MB instead of 50 MB) but disable all possibilities to submit a helpful stacktrace if amule crashes or a sample if it hangs to the [[aMule devs|aMule developers]].
+
 
+
 
+
 
+
  
 +
The two lines marked as '''''<font color="red">OPTIONAL</font>''''' are optional, that is, the last two options to ''./configure'' and the ''strip'' command. They result in a dramatically reduced file size (approx. 3 MB instead of 50 MB) but disable all possibilities to submit a helpful stacktrace if [[aMule]] crashes or a sample if it hangs to the [[aMule devs|aMule developers]].
  
 
=== Problems and solutions ===
 
=== Problems and solutions ===

Revision as of 13:12, 10 May 2005

How to get and install aMule on Apple Mac OSX.

  1. You can simply download the finished application ('binary release') or
  2. You compile it from a CVS source snapshot.

The preceding version of this page covering aMule 2.0.0rc8 and earlier is archived here.

Binary releases

If you don't want to bother with installing and compiling all those tools and sources, then get one of the pre-compiled aMule applications. The official release is considered 'stable', but every now and then applications are built from the current source to allow more people to test new features or the like.

  1. Latest official binary release: aMule-2.0.0-Mac
  2. Periodically compiled binary from cvs: amule forum

Compiling from source

Compiling from source allows most current bug reports, because you can compile and test the CVS snapshot of the very day.

To compile aMule from source you need some development tools, the wxWidgets library and the aMule source.

Get the sources and development tools

Xcode

Xcode is Apple's development environment. We need it for the GCC compiler. You may have Xcode on CD/DVD, e.g. it is on the OSX10.4 DVD.

Else you can download it from Apple, but you must sign up for a free-of-charge developer account first.

  1. Get XCode from http://developer.apple.com/tools/download
  2. "Member Site"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install"

Fink

Fink is an open source (OS) installer for lots of OS tools ported to Mac OSX. We need it to install the OS tool gettext.

  1. Get Fink from http://fink.sourceforge.net/download
  2. Read Fink's installation guide to learn how to install applications through Fink.


gettext

gettext is an OS library for text internationalization. This library is used to make aMule multi-lingual.

  1. Get and install the gettext library with Fink. The package name is gettext.

wxMac

wxMac is the port of the wxWidgets library for Mac OSX. This library is used to make aMule 'multi-platform'.

  1. Get the source from: http://prdownloads.sourceforge.net/wxwindows/wxMac-2.6.0.tar.gz
  2. Extract the archive (just double-click it)

Or get the current CVS snapshot. Warning: the wxMac CVS is frequently in a bad condition.

bash: cd ~/Desktop
bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
Note: password is 'anoncvs'
bash: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxMac

aMule itself

  1. Get latest daily CVS source snapshot: aMule CVS
  2. Extract the archive (just double-click it)

Compile the sources

Put the amule folder and the wxMac folder in the same place, e.g. on the desktop.

Important: If you use Xcode 2.0 then your default compiler is gcc 4.0. Currently (2005-05-09) wxMac then only compiles with patches (and CryptoPP doesn't compile at all). Therefore, if you use Xcode 2.0 then you should switch back to gcc 3.3 first. First check the version of your current default gcc with gcc --version and then switch to version 3.3 if required:

bash: gcc --version
bash: sudo gcc_select 3.3

Compile wxMac

This step is only needed once, even if you later download and compile a newer version of the aMule CVS source.

The following assumes that you have placed the above packages on your Desktop.
cd into the wxMac folder, configure and make:

bash: cd ~/Desktop/wxMac-2.6.0/build
bash: ../configure --disable-shared --enable-unicode 
bash: make

NOTE: This took approx. 30 minutes on a G4 at 1 GHz.

Compile aMule

Now cd into the amule folder, configure and make:

NOTE: You can copy'n'paste the 4 lines for ./configure in one go.

bash: cd ~/Desktop/aMule
bash: ./configure --disable-systray --disable-gtk     \
           --with-wx-prefix=../wxMac-2.6.0/build/lib/     \
           --with-wx-config=../wxMac-2.6.0/build/wx-config \
           --enable-debug --disable-optimise                    OPTIONAL
         
bash: make
bash: strip src/amule                                        OPTIONAL
bash: mv src/amule aMule.app/Contents/MacOS/

The two lines marked as OPTIONAL are optional, that is, the last two options to ./configure and the strip command. They result in a dramatically reduced file size (approx. 3 MB instead of 50 MB) but disable all possibilities to submit a helpful stacktrace if aMule crashes or a sample if it hangs to the aMule developers.

Problems and solutions

  • If Fink reports something like: After unpacking 11.2GB will be freed, don't be afraid. Fink has evolved into a different way of managing packet's size and some old ("old": at least some months old) packages' sizes aren't handled correctly on the output. If this is your case, devide the number by 1024. So, what the above example really means is: After unpacking 11.2MB will be freed.
  • If you get an error like this: You cannot open the application "amule" because it may be damaged or incomplete, right click on amule, then click on Show Packages Contents, go to "Contents">"MacOS"> and double click on amule. Next time you start from aMule.app it will run fine. If you still get the same error, move aMule.app to the desktop and run it from there.