My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
CompilingFromHg  
Tutorial on how to check out source code with Hg and compile under Linux
Phase-Deploy
Updated Oct 9, 2011 by s...@narfation.org

Compiling Mupen64Plus from source code under Linux

This guide is for people who want to play with the latest Mupen64Plus code under development, by grabbing the source code from our development repository and compiling it yourself.

Requirements

  • Build environment (GCC, G++, GNU Make, pkg-config, etc)
  • Mercurial distributed SCM
  • Development packages for dependencies
    1. SDL 1.2
    2. libpng
    3. FreeType 2
    4. zlib
    5. OpenGL (GL, glu)
  • Optional development packages for dependencies
    1. libsamplerate
    2. liblircclient

Installing Mercurial

If you do not have Mercurial installed, launch your favorite application manager and search for mercurial. If you are on Ubuntu or Debian this line will work in the console:

$ sudo apt-get install mercurial

Checking out, building, and updating the source code

Part of the re-design of our emulator has involved breaking it up from a single big package into 6 separate modules which must all be built separately. In order to make this easier for developers, I have written a few simple shell scripts for checking out and building the code. You make download an archive of the scripts here:

m64p_helper_scripts.tar.gz (updated Jul 9, 2011)

To check out, build, and run the new Mupen64Plus code, unzip these scripts into an empty directory and run:

./m64p_get.sh && ./m64p_build.sh && ./m64p_test.sh

If, at a later time, you want to pull the latest changes and rebuild all of the code, you may do the following:

./m64p_update.sh && ./m64p_build.sh

The build script will create a test directory and place all of the necessary files there. You can go into this directory and run the console front-end (named mupen64plus) to run ROMs.

Custom Builds

The makefiles of the Mupen64Plus modules support many different compile-time options. Some of these options are specific to a single module, while others are common to several modules. You can build the modules individually, passing options to the makefile in the projects/unix/ folder of the module, or you can append options to the ./m64p_build.sh script and build all the modules with the same options.

Common Options

  General Options:
    BITS=32       == build 32-bit binaries on 64-bit machine
    APIDIR=path   == path to find Mupen64Plus Core headers
    OPTFLAGS=flag == compiler optimization (default: -O3)
    PIC=(1|0)     == Force enable/disable of position independent code
  Install Options:
    PREFIX=path   == install/uninstall prefix (default: /usr/local)
    SHAREDIR=path == path to install shared data files (default: PREFIX/share/mupen64plus)
    LIBDIR=path   == library prefix (default: PREFIX/lib)
    PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)
    DESTDIR=path  == path to prepend to all installation paths (only for packagers)
  Debugging Options:
    DEBUG=1       == add debugging symbols
    V=1           == show verbose compiler output

Mupen64Plus-Core Only

  General Options:
    LIRC=1        == enable LIRC support
    NO_ASM=1      == build without assembly (no dynamic recompiler or MMX/SSE code)
    SHAREDIR=path == extra path to search for shared data files
  Install Options:
    INCDIR=path   == path to install core header files (default: PREFIX/include/mupen64plus)
  Debugging Options:
    PROFILE=1     == build gprof instrumentation into binaries for profiling
    DEBUGGER=1    == build graphical debugger
    DBG_CORE=1    == print debugging info in r4300 core
    DBG_COUNT=1   == print R4300 instruction count totals (64-bit dynarec only)
    DBG_COMPARE=1 == enable core-synchronized r4300 debugging
    DBG_PROFILE=1 == dump profiling data for r4300 dynarec to data file

Mupen64Plus-Audio-SDL Only

  General Options:
    NO_RESAMP=1   == build without libsamplerate; disables high-quality audio resampling

Mupen64Plus-Input-SDL Only

  Debugging Options:
    PLUGINDBG=1   == print extra debugging information while running

Mupen64Plus-UI-Console Only

  General Options:
    COREDIR=path   == default path to search for Mupen64Plus Core (must end with slash)
    PLUGINDIR=path == default path to search for plugins
    SHAREDIR=path  == default path to search for shared data files
    PIE=(1|0)      == Force enable/disable of position independent executables
  Install Options:
    BINDIR=path    == path to install mupen64plus binary (default: PREFIX/bin/)
    MANDIR=path    == path to install mupen64plus manual page (default: PREFIX/share/man)

Mupen64Plus-Video-Rice Only

  General Options:
    NO_ASM=1      == build without inline assembly code (x86 MMX/SSE)
Comment by Nit3H...@gmail.com, Feb 22, 2010

| \/ | / / | || | | \| | | |\/| | | | | ' \ / \ ' \| ' \| || || |) | | | | / | | | | | || | |) | / | | | () | | /| | || \ \ || ||\,| ./ \|| ||\/ || || ||\,|/

|| http://code.google.com/p/mupen64plus/
Mupen64Plus Console User-Interface Version 1.99.3

UI-console: attached to core library 'Mupen64Plus Core' version 1.99.3

Includes support for Dynamic Recompiler.
Error: no ROM filepath given

Comment by project member richard...@gmail.com, Feb 22, 2010

You have to give it the path and filename of an uncompressed ROM file to run.

Comment by adriano....@gmail.com, May 14, 2010

there is a typo in: ./m64p_get.sh && ./m64_build.sh && ./m64p_test.sh

a 'p' is missing in "./m64_build.sh": ./m64p_get.sh && ./m64p_build.sh && ./m64p_test.sh

Comment by project member richard...@gmail.com, May 15, 2010

Thanks, I fixed it.

Comment by ZLegacy@gmail.com, May 31, 2010

When I ran the commands together I got an error (wish I could remember what it said now). Then I ran each one separately and it worked fine.

Comment by Inukaze....@gmail.com, Sep 15, 2011

From where i download and install "«/usr/local/include/mupen64plus»" ??? i need it

Comment by project member s...@narfation.org, Sep 16, 2011

All files for /usr/(local/)include/mupen64plus are part of mupen64plus-core and can be downloaded+installed from https://bitbucket.org/richard42/mupen64plus-core

There are also distribution packages for it (like libmupen64plus-dev on Debian/Ubuntu)

Comment by marcovanotti15, Oct 27, 2011

Hi! I can compile it, however, when I'm trying to run it from console ui, I get this error:

AttachCoreLib?() Error: Shared library '(null)' incompatible; core API major version 1.0.0 doesn't match with this application (2.0.1)

For compiling and everything I just runned the scripts listed here.

Comment by warriorr...@gmail.com, Nov 6, 2011

Attempting to run build for HP Touchpad running Ubuntu

Makefile:76 CPU type "armv7l" not supported. Please file bug report at...

Any ideas?

Comment by project member richard...@gmail.com, Nov 6, 2011

You can't make an ARM build from my source tree. You should come to our irc channel (#mupen64plus on irc.freenode.net) or our Emutalk forum and post this question to ask about getting this to run.

Comment by Inukaze....@gmail.com, Nov 27, 2011

Ubuntu Lucid 10.04 LTS ( AMD64 )- Un-Usable

Error :

dlopen('./libmupen64plus.so.2') error: ./libmupen64plus.so.2: undefined symbol: png_set_write_fn AttachCoreLib?() Error: failed to find Mupen64Plus Core library

Comment by alan.o...@gmail.com, Feb 17, 2012

Just compiled from source on Ubuntu 11.10 and loaded up Zelda: Ocarina of Time... omg. My childhood.

Comment by Francis1...@gmail.com, May 12, 2012

AttachCoreLib?() Error: Shared library '(null)' incompatible; core API major version 1.0.0 doesn't match with this application (2.0.1)

I have the same problem of marcovanotti15. Won't work.

Comment by project member richard...@gmail.com, May 20, 2012

Francis1993z, this looks like the console-ui application is finding an old version of the core library. If you previously installed v1.99.xx on your system, remove the older version and try again.


Sign in to add a comment
Powered by Google Project Hosting