This has been working with all versions of Mame I've tried since 246 and GCC10/11/12.
I suggest installing the system Mame from apt first so the binaries and any config files are set up; if you don't want to overwrite an existing installation then you can change the directories to your liking; personally I haven't found any issue (and easier to configure GUIs) in overwriting with the compiled binaries.
Change
Code: Select all
-j7
![Smile :)](./images/smilies/icon_e_smile.gif)
First of all, clone just the branch you need for your version, e.g. 250:
Code: Select all
git clone -b mame0250 --depth 1 https://github.com/mamedev/mame.git mame0250
NOTE: you can get 1%-2% more performace (and a smaller binary) by adding Link Time Optimization to the options:
Code: Select all
LTO=1
Code: Select all
-Wl,--no-keep-memory
Code: Select all
ARCHOPTS=
I'm using
Code: Select all
-march=native
Code: Select all
ARCHOPTS=
For compiling Mame using system libraries
First, install needed development libraries using APT:
Code: Select all
sudo apt install libexpat1-dev libflac-dev libfontconfig1-dev libglm-dev libjpeg-dev liblua5.3-dev libportmidi-dev libpugixml-dev libsdl2-dev libsdl2-ttf-dev libsqlite3-dev libutf8proc-dev libxinerama-dev portaudio19-dev python3-dev qtbase5-dev rapidjson-dev zlib1g-dev libomp-dev
Compile Mame with system libraries
Code: Select all
make -j7 REGENIE=1 TARGETOS=linux TARGET=mame SUBTARGET=mame PTR64=1 STRIP_SYMBOLS=1 TOOLS=1 OPENMP=1 SEPARATE_BIN=1 DEBUG=0 USE_QTDEBUG=0 ARCHOPTS="-march=native -fuse-ld=gold" NOWERROR=1 OSD=sdl DISTRO=debian-stable PYTHON_EXECUTABLE=python3 USE_SYSTEM_LIB_ASIO= USE_SYSTEM_LIB_EXPAT=1 USE_SYSTEM_LIB_ZLIB=1 USE_SYSTEM_LIB_JPEG=1 USE_SYSTEM_LIB_FLAC=1 USE_SYSTEM_LIB_LUA=lua5.3:/usr/include/lua5.3 USE_SYSTEM_LIB_SQLITE3=1 USE_SYSTEM_LIB_PORTMIDI=1 USE_SYSTEM_LIB_PORTAUDIO=1 USE_BUNDLED_LIB_SDL2= USE_SYSTEM_LIB_UTF8PROC=1 USE_SYSTEM_LIB_GLM=1 USE_SYSTEM_LIB_RAPIDJSON=1 USE_SYSTEM_LIB_PUGIXML=1 SDL_INI_PATH=/etc/mame
For compiling Mame using libraries supplied with Mame
Code: Select all
make -j7 REGENIE=1 TARGETOS=linux TARGET=mame SUBTARGET=mame PTR64=1 STRIP_SYMBOLS=1 TOOLS=1 SEPARATE_BIN=1 DEBUG=0 USE_QTDEBUG=0 OSD=sdl OPENMP=1 OPTIMIZE="fast" ARCHOPTS="-march=native -fuse-ld=gold"
Installing the binaries including tools from the separate build dirs
Code: Select all
sudo cp build/linux_gcc/bin/x64/Release/mame /usr/games/mame
sudo cp build/linux_gcc/bin/x64/Release/{castool,chdman,floptool,imgtool,jedutil,ldresample,ldverify,romcmp} /usr/bin/
Feel free to ask any questions!