Difference between revisions of "Building MAME"

From Ninerpedia
Jump to navigation Jump to search
(Ubuntu)
m (openSUSE)
 
(15 intermediate revisions by the same user not shown)
Line 15: Line 15:
 
You need
 
You need
  
* gcc / gcc-c++ version 5
+
* gcc / gcc-c++ version 5 or higher
 
* git
 
* git
 
* make
 
* make
Line 31: Line 31:
 
=== Ubuntu ===
 
=== Ubuntu ===
  
[http://www.ubuntu.com Ubuntu] users need to make use of the apt-get command or check the software repository tools. For Ubuntu 11.10 and newer, the following packages are required:
+
[http://www.ubuntu.com Ubuntu] users need to make use of the apt-get command or check the software repository tools. For Ubuntu 15.10 and newer, the following packages are required:
 
 
**outdated**
 
  
 
  sudo apt-get install git
 
  sudo apt-get install git
  sudo apt-get install libqt4-dev
+
  sudo apt-get install qt5-default
sudo apt-get install libsdl2.0-dev
 
sudo apt-get install libgtk2.0-dev
 
sudo apt-get install libgconf2-dev
 
 
  sudo apt-get install libsdl2-ttf-dev  
 
  sudo apt-get install libsdl2-ttf-dev  
sudo apt-get install libasound2-dev
 
 
  sudo apt-get install libfontconfig1-dev
 
  sudo apt-get install libfontconfig1-dev
  
Line 49: Line 43:
  
 
For an [http://www.opensuse.org openSUSE] installation, either use YaST or (if not already installed) follow this path:
 
For an [http://www.opensuse.org openSUSE] installation, either use YaST or (if not already installed) follow this path:
  zypper install git-core
+
  sudo zypper install git-core
  zypper install gcc
+
  sudo zypper install gcc-c++
  zypper install gcc5-c++
+
  sudo zypper install libqt5-qtbase-devel
  zypper install libSDL2_ttf-devel
+
  sudo zypper install xorg-x11-devel
  zypper install libQt5Core-devel  
+
  sudo zypper install alsa-devel
  zypper install libQt5Widgets-devel
+
  sudo zypper install libSDL2_ttf-devel
  zypper install fontconfig-devel
+
   
  zypper install alsa-devel
+
sudo zypper install fontconfig-devel
 +
  sudo zypper install python-xml
  
 
=== Compiling ===
 
=== Compiling ===
Line 62: Line 57:
 
You can just build the complete MAME package by running '''make'''; it includes the whole MESS emulator. If you only want the MESS part, use
 
You can just build the complete MAME package by running '''make'''; it includes the whole MESS emulator. If you only want the MESS part, use
  
  make SUBTARGET=mess
+
  make SUBTARGET=mess REGENIE=1 TOOLS=1
 +
 
 +
REGENIE should be specified, since the GENie project generator tool is used for building. TOOLS will generate the additional helpers imgtool, chdman, and others. You probably don't need them if you use TIImageTool.
 +
 
 +
If you only want the TI systems to be included, you may specify them in the command line:
  
For a 64-bit environment you may add PTR64=1, but it should be automatically set when you compile it on such a machine. For a quad-core machine, you can greatly speed up the compile process with -j4 (start 4 jobs).
+
make -j4 SOURCES=src/mame/drivers/ti99_4x.cpp,src/mame/drivers/ti99_4p.cpp,src/mame/drivers/ti99_8.cpp,src/mame/drivers/geneve.cpp,src/mame/drivers/ti99_2.cpp REGENIE=1 TOOLS=1
  
make SUBTARGET=mess -j4
+
The -j4 switch is used to start 4 build jobs concurrently, which speeds up the compilation considerably.
  
Some systems use gcc 4.8; you must upgrade to gcc 4.9 at least; better even gcc 5. Since gcc5 may co-exist with gcc 4.x by offering a special '''gcc-5''' command, you have to explicitly specify that you want to use gcc 5 by  
+
You must make sure that your build environment is not too old. GCC should be at least version 7. You can also use clang by
  
  make SUBTARGET=mess -j4 OVERRIDE_CC=gcc-5 OVERRIDE_CXX=g++-5
+
  OVERRIDE_CC=clang OVERRIDE_CXX=clang++  
  
 
When you want to get a current version, use the '''git pull''' command. Cleaning the build environment is optional, but if you experience problems when compiling, try to clean first.
 
When you want to get a current version, use the '''git pull''' command. Cleaning the build environment is optional, but if you experience problems when compiling, try to clean first.
  
 
  git pull
 
  git pull
  make clean SUBTARGET=mess
+
  make clean
make SUBTARGET=mess -j4 OVERRIDE_CC=gcc-5 OVERRIDE_CXX=g++-5
 
 
 
Now you should have a freshly built '''mess''' executable file. Unlike previous versions, the tools like '''imgtool''' or '''chdman''' are not included. If your want to get the tools (chdman, imgtool), just specify "TOOLS=1" to make:
 
  
make SUBTARGET=mess -j4 TOOLS=1 OVERRIDE_CC=gcc-5 OVERRIDE_CXX=g++-5
+
After compiling has finished, you should have a freshly built '''mame64''' executable file.
  
 
[[Category:MESS]]
 
[[Category:MESS]]

Latest revision as of 22:00, 1 August 2019

Here are some instructions for building MESS from source.

Windows

TODO

OSX

TODO

Linux and other Unix variants

If you decide to build MESS from source code in Linux, you should probably directly use the git repository on Github since bugs are corrected very quickly (and new ones are as quickly introduced ...).

Version 0.171 and higher

You need

  • gcc / gcc-c++ version 5 or higher
  • git
  • make
  • Development package of alsa
  • Development package of gconf2
  • Development package of gtk2
  • Development package of the SDL2 library
  • Development package of the SDL2_ttf library
  • Development package of the Qt5Core library

Use git to clone the repository to your local drive:

git clone https://github.com/mamedev/mame.git

Ubuntu

Ubuntu users need to make use of the apt-get command or check the software repository tools. For Ubuntu 15.10 and newer, the following packages are required:

sudo apt-get install git
sudo apt-get install qt5-default
sudo apt-get install libsdl2-ttf-dev 
sudo apt-get install libfontconfig1-dev

This set of package installations also imports gcc/gcc-c++ and make.

openSUSE

For an openSUSE installation, either use YaST or (if not already installed) follow this path:

sudo zypper install git-core
sudo zypper install gcc-c++ 
sudo zypper install libqt5-qtbase-devel
sudo zypper install xorg-x11-devel
sudo zypper install alsa-devel
sudo zypper install libSDL2_ttf-devel

sudo zypper install fontconfig-devel
sudo zypper install python-xml

Compiling

You can just build the complete MAME package by running make; it includes the whole MESS emulator. If you only want the MESS part, use

make SUBTARGET=mess REGENIE=1 TOOLS=1

REGENIE should be specified, since the GENie project generator tool is used for building. TOOLS will generate the additional helpers imgtool, chdman, and others. You probably don't need them if you use TIImageTool.

If you only want the TI systems to be included, you may specify them in the command line:

make -j4 SOURCES=src/mame/drivers/ti99_4x.cpp,src/mame/drivers/ti99_4p.cpp,src/mame/drivers/ti99_8.cpp,src/mame/drivers/geneve.cpp,src/mame/drivers/ti99_2.cpp REGENIE=1 TOOLS=1

The -j4 switch is used to start 4 build jobs concurrently, which speeds up the compilation considerably.

You must make sure that your build environment is not too old. GCC should be at least version 7. You can also use clang by

OVERRIDE_CC=clang OVERRIDE_CXX=clang++ 

When you want to get a current version, use the git pull command. Cleaning the build environment is optional, but if you experience problems when compiling, try to clean first.

git pull
make clean

After compiling has finished, you should have a freshly built mame64 executable file.