Installing DeSmuME from source on Linux

From DeSmuME
(Difference between revisions)
Jump to: navigation, search
(Enabling SSE2 Extensions)
 
(13 intermediate revisions by 4 users not shown)
Line 6: Line 6:
 
The Linux version of desmume comes in source code form only, and if your distribution does not package it or is packaging an old version you will have to compile the sources yourself. In order to compile desmume from a source tarball you'll need at least these packages:
 
The Linux version of desmume comes in source code form only, and if your distribution does not package it or is packaging an old version you will have to compile the sources yourself. In order to compile desmume from a source tarball you'll need at least these packages:
  
gcc make libglib2 libgtk2 libglade gettext libsdl zlib intltool agg libasound
+
gcc make libglib2 libgtk2 libglade gettext libsdl zlib intltool agg libasound libpcap
  
 
If you're compiling from svn, you'll need those one as well:
 
If you're compiling from svn, you'll need those one as well:
  
autoconf automake
+
autoconf automake
  
 
If you want 3d engines alternatives to software rasterizer you may install libgtkglext or libosmesa.
 
If you want 3d engines alternatives to software rasterizer you may install libgtkglext or libosmesa.
Line 16: Line 16:
 
On debian you should have all the requirements installed with this command:
 
On debian you should have all the requirements installed with this command:
  
sudo apt-get install build-essential autoconf automake libgtk2.0-dev libglu1-mesa-dev libsdl1.2-dev libglade2-dev libgtkglext1-dev gettext zlib1g-dev libosmesa6-dev intltool libagg-dev libasound2-dev
+
sudo apt-get install build-essential autoconf automake libgtk2.0-dev libglu1-mesa-dev libsdl1.2-dev libglade2-dev gettext zlib1g-dev libosmesa6-dev intltool libagg-dev libasound2-dev libsoundtouch-dev libpcap-dev
  
desmume requires libgtk 2.8 or higher.
+
desmume requires libgtk 2.10 or higher.
 +
 
 +
After successful compilation, you can start DeSmuME by running <code>desmume</code>. If you want to enable dynamic JIT recompiler, do this:
 +
 
 +
desmume --cpu-mode=1
  
 
== Install desmume from source tarball ==
 
== Install desmume from source tarball ==
  
Go to http://desmume.org/download/ to check out the latest version of desmume available. At the time of writing the latest stable release of desmume is 0.9.5.
+
Go to http://desmume.org/download/ to check out the latest version of desmume available. At the time of writing the latest stable release of desmume is 0.9.11.
  
 
Download the tarball and extract it:
 
Download the tarball and extract it:
  
* wget http://prdownloads.sourceforge.net/desmume/desmume-0.9.5.tar.gz?download
+
wget http://sourceforge.net/projects/desmume/files/desmume/0.9.11/desmume-0.9.11.tar.gz/download
* tar xvzf desmume-0.9.5.tar.gz
+
tar xvzf desmume-0.9.11.tar.gz
  
Enter the desmume directory and build the source:
+
Or if you don't want to save the archive locally:
  
* cd desmume-0.9.5
+
wget -O - http://sourceforge.net/projects/desmume/files/desmume/0.9.11/desmume-0.9.11.tar.gz/download | tar xvz
* ./configure
+
* make
+
* sudo make install
+
  
If you are not using sudo the last command needs to be run as the 'root' user.
+
Enter the desmume directory and build the source:
  
If you want to use offscreen mesa instead of gtkglext as alternative 3d engine use the ./configure --enable-osmesa instead of just ./configure.
+
cd desmume-0.9.11
 +
./configure
 +
make
 +
sudo make install
  
== Install desmume from svn ==
+
If you are not using sudo the last command needs to be run as the <code>root</code> user.
  
You need subversion to checkout latest unreleased version of desmume. On debian you can install it with:
+
If you want to use offscreen mesa as alternative 3d engine use the <code>./configure --enable-osmesa</code> instead of just <code>./configure</code>.
  
sudo apt-get install subversion
+
== Install desmume from git ==
  
Once you have subversion installed and checked you have the svn command type:
+
Grab the source from https://github.com/TASVideos/desmume
 
+
svn co https://desmume.svn.sourceforge.net/svnroot/desmume/trunk/desmume desmume
+
  
 
Enter the desmume directory and build the source:
 
Enter the desmume directory and build the source:
  
* cd desmume
+
cd desmume/src/frontend/posix/
* ./autogen.sh
+
./autogen.sh
* ./configure
+
./configure
* make
+
make
* sudo make install
+
sudo make install
  
If you have updated your svn tree with 'svn update', then be sure to run the 'make clean' command before you start.
+
If you want to use offscreen mesa as alternative 3d engine use the <code>./configure --enable-osmesa</code> instead of just <code>./configure</code>.
  
If you want to use offscreen mesa instead of gtkglext as alternative 3d engine use the ./configure --enable-osmesa instead of just ./configure.
+
If you want to enable HUD display, use <code>./configure --enable-hud</code>.
  
== Enabling SSE2 Extensions ==
+
== Enabling compiler optimizations ==
 
If you want to optimize the build on Linux, you should set the C++ compiler options to enable specific optimization for your processor:
 
If you want to optimize the build on Linux, you should set the C++ compiler options to enable specific optimization for your processor:
  
You can do this by setting the CXXFLAGS variables like shown below before running './configure' :
+
You can do this by setting the <code>CFLAGS</code> and <code>CXXFLAGS</code> variables like shown below:
  
CXXFLAGS='-O2 -march=native'
+
CFLAGS='-O2 -march=native' CXXFLAGS=$CFLAGS ./configure
  
You may need to set the '-march=native' for example because by default, gcc under 32-bit Debian builds code that works on the 486 (which doesn't support SSE).
+
You may need to set the <code>-march=native</code> for example because by default, gcc under 32-bit Debian builds code that works on the 486 (which doesn't support SSE).
  
 
On x86 / x86-64 machines you can squeeze the processor a bit more using:
 
On x86 / x86-64 machines you can squeeze the processor a bit more using:
  
CXXFLAGS='-O2 -march=native -mfpmath=sse'
+
CXXFLAGS='-O2 -march=native -mfpmath=sse' ./configure
 +
 
 +
For more optimization options, see [[Optimization#Linux]]
  
 
== Known issues ==
 
== Known issues ==
If you have a crash on a 64bit environment while disabling/enabling sound during gameplay, deinstall agg (libagg-dev on Debian) and rebuild. This should solve the problem.
+
 
 +
* If you have a crash on a 64bit environment while disabling/enabling sound during gameplay, deinstall agg (libagg-dev on Debian) and rebuild. This should solve the problem. (Alvin: Is this still applicable?)
 +
 
 +
* Some people on MacOS X have a broken build environment, mixing pieces from fink / macports / source installation / etc... That is wrong and painful for both the user and the developers who have to sort out build issues. Please don't do that! To workaround the issue you can try passing the needed include paths to autoreconf. Modify autogen.sh adding -B/my/path/ to autoreconf invocation, the path should be -B/sw for fink and -B/opt/local for macports. After the modify rerun ./autogen.sh and ./configure.

Latest revision as of 06:37, 12 August 2018

Contents

Supported compilers

On the Linux platform, only the GCC compiler and toolchain is supported.

Pre-requisites

The Linux version of desmume comes in source code form only, and if your distribution does not package it or is packaging an old version you will have to compile the sources yourself. In order to compile desmume from a source tarball you'll need at least these packages:

gcc make libglib2 libgtk2 libglade gettext libsdl zlib intltool agg libasound libpcap

If you're compiling from svn, you'll need those one as well:

autoconf automake

If you want 3d engines alternatives to software rasterizer you may install libgtkglext or libosmesa.

On debian you should have all the requirements installed with this command:

sudo apt-get install build-essential autoconf automake libgtk2.0-dev libglu1-mesa-dev libsdl1.2-dev libglade2-dev gettext zlib1g-dev libosmesa6-dev intltool libagg-dev libasound2-dev libsoundtouch-dev libpcap-dev

desmume requires libgtk 2.10 or higher.

After successful compilation, you can start DeSmuME by running desmume. If you want to enable dynamic JIT recompiler, do this:

desmume --cpu-mode=1

Install desmume from source tarball

Go to http://desmume.org/download/ to check out the latest version of desmume available. At the time of writing the latest stable release of desmume is 0.9.11.

Download the tarball and extract it:

wget http://sourceforge.net/projects/desmume/files/desmume/0.9.11/desmume-0.9.11.tar.gz/download
tar xvzf desmume-0.9.11.tar.gz

Or if you don't want to save the archive locally:

wget -O - http://sourceforge.net/projects/desmume/files/desmume/0.9.11/desmume-0.9.11.tar.gz/download | tar xvz

Enter the desmume directory and build the source:

cd desmume-0.9.11
./configure
make
sudo make install

If you are not using sudo the last command needs to be run as the root user.

If you want to use offscreen mesa as alternative 3d engine use the ./configure --enable-osmesa instead of just ./configure.

Install desmume from git

Grab the source from https://github.com/TASVideos/desmume

Enter the desmume directory and build the source:

cd desmume/src/frontend/posix/
./autogen.sh
./configure
make
sudo make install

If you want to use offscreen mesa as alternative 3d engine use the ./configure --enable-osmesa instead of just ./configure.

If you want to enable HUD display, use ./configure --enable-hud.

Enabling compiler optimizations

If you want to optimize the build on Linux, you should set the C++ compiler options to enable specific optimization for your processor:

You can do this by setting the CFLAGS and CXXFLAGS variables like shown below:

CFLAGS='-O2 -march=native' CXXFLAGS=$CFLAGS ./configure

You may need to set the -march=native for example because by default, gcc under 32-bit Debian builds code that works on the 486 (which doesn't support SSE).

On x86 / x86-64 machines you can squeeze the processor a bit more using:

CXXFLAGS='-O2 -march=native -mfpmath=sse' ./configure

For more optimization options, see Optimization#Linux

Known issues

  • If you have a crash on a 64bit environment while disabling/enabling sound during gameplay, deinstall agg (libagg-dev on Debian) and rebuild. This should solve the problem. (Alvin: Is this still applicable?)
  • Some people on MacOS X have a broken build environment, mixing pieces from fink / macports / source installation / etc... That is wrong and painful for both the user and the developers who have to sort out build issues. Please don't do that! To workaround the issue you can try passing the needed include paths to autoreconf. Modify autogen.sh adding -B/my/path/ to autoreconf invocation, the path should be -B/sw for fink and -B/opt/local for macports. After the modify rerun ./autogen.sh and ./configure.
Personal tools