RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    compiling mame on ubuntu 22.04 fails

    Scheduled Pinned Locked Moved Help and Support
    ubuntu 22.04lts
    11 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dookieshooter
      last edited by

      I have an ubuntu 22.04 x86_64 build running retroPie. I have been trying to get mame 0.246 to compile, with little success. The computer is older. 8gb ddr3 with an AMD X4 processor.

      I have python2 and 3 installed. I have worked around the qt5-default package issue per threads i've found.

      I have tried using retroPie to install/build from source as well as manually cloning the mame repo and building from there.

      I am also unable to build the lr-mame2016 or lr-mame packages from within retropie. lr-mame2015 DID work however.

      So has anyone successfully done this? Wondering if I need to roll back to 20 or even 18.

      Note: I'm am most certainly a MAME noob.

      log file for mame build failure here:

      Some possibly relevant sections from the logs:

      Compiling src/mame/gameplan/gameplan_v.cpp...
      during RTL pass: expand
      In file included from ../../../../../src/emu/emumem_hedw3.cpp:5:
      ../../../../../src/emu/emumem_hedw.ipp: In constructor ‘handler_entry_write_dispatch<HighBits, Width, AddrShift>::handler_entry_write_dispatch(address_space*, memory_view&) [with int HighBits = 30; int Width = 0; int AddrShift = 1]’:
      ../../../../../src/emu/emumem_hedw.ipp:38:50: internal compiler error: Segmentation fault
         38 | template<int HighBits, int Width, int AddrShift> handler_entry_write_dispatch<HighBits, Width, AddrShift>::handler_entry_write_dispatch(address_space *space, memory_view &view) : handler_entry_write<Width, AddrShift>(space, handler_entry::F_VIEW), m_view(&view), m_a_dispatch(nullptr), m_a_ranges(nullptr), m_u_dispatch(nullptr), m_u_ranges(nullptr)
            |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Compiling src/mame/gameplan/toratora.cpp...
      0x7f92b86b851f ???
      	./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
      0x7f92b869fd8f __libc_start_call_main
      	../sysdeps/nptl/libc_start_call_main.h:58
      0x7f92b869fe3f __libc_start_main_impl
      	../csu/libc-start.c:392
      Please submit a full bug report,
      with preprocessed source if appropriate.
      Please include the complete backtrace with any bug report.
      See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
      make[2]: *** [emu.make:1232: ../../../../linux_gcc/obj/x64/Release/src/emu/emumem_hedw3.o] Error 1
      make[2]: *** Waiting for unfinished jobs....
      
      
      Compiling src/mame/homebrew/phunsy.cpp...
      Archiving libhegenerglaser.a...
      Compiling src/mame/homelab/braiplus.cpp...
      make[1]: *** [Makefile:94: emu] Error 2
      Compiling src/mame/homebrew/pimps.cpp...
      make[1]: *** Waiting for unfinished jobs....
      Compiling src/mame/handheld/hh_tms1k.cpp...
      
      
      Compiling src/mame/handheld/wildfire.cpp...
      Archiving libhandheld.a...
      make: *** [makefile:1286: linux_x64] Error 2
      strip: 'mame': No such file
      Removing additional swap
      Could not successfully build mame - MAME emulator (/home/arcade/RetroPie-Setup/tmp/build/mame/mame not found).
      /home/arcade
      
      
      

      I'm assuming maybe that either the compiler is too new or some other dependency is too new. Haven't dug into the error(s) too much yet.

      Appreciate any/all feedback!

      testudoT 1 Reply Last reply Reply Quote 0
      • testudoT
        testudo @dookieshooter
        last edited by testudo

        @dookieshooter

        While I am reluctant to assist a DOOKIE, but here goes nothing...

        Still on Ubuntu 20.04, but had similar issues compiling MAME and MESS.

        In my case I found out that I needed a larger SWAP partition to prevent my CPUs from freezing. The 8GB RAM and 8 GB SWAP were not enough to successfully compile either program. I temporarily increased my SWAP file to 14 GB everything compiled nicely. You might want to give increasing your SWAP space a try and see if that does the trick.

        D 1 Reply Last reply Reply Quote 0
        • D
          dookieshooter @testudo
          last edited by dookieshooter

          @testudo hey thanks! I'm a dookie shooter! not a dookie ;)

          Will try it out soon.

          did you see the same type of errors because of this?

          side note: I started with only 4Gb. that would cause the computer to completely shut off hard, even with forcing compiling with a single core. bumping to 8Gb seemed to help immensely.

          testudoT 1 Reply Last reply Reply Quote 0
          • testudoT
            testudo @dookieshooter
            last edited by

            @dookieshooter

            They were different errors, but I do not recall exactly what they were.

            Guess I'll hold-off upgrading to 22.04 for a bit.

            D 1 Reply Last reply Reply Quote 0
            • D
              dookieshooter @testudo
              last edited by dookieshooter

              @testudo I'm going to try an ubuntu 20lts image in a vm and see where I get. Would still love to hear if anyone else has had success though.

              F 1 Reply Last reply Reply Quote 0
              • F
                Folly @dookieshooter
                last edited by Folly

                @dookieshooter

                Not tried on Ubuntu 22.04.
                Though with other OSes I also had to make the swap larger.

                For your information, binaries can be found here :
                https://stickfreaks.com/mame/
                ( 0.245 can be found in the old directory now )

                Normally the x86_64 version is also in there, but for some reason 0.246 is not.
                Could be that more people have trouble.
                You can check if anything comes along on this forum :
                https://forums.bannister.org/
                (check also the non-Windows part)

                D 1 Reply Last reply Reply Quote 1
                • D
                  dookieshooter @Folly
                  last edited by

                  @Folly Awesome! i searched around but didn't find any pre-compiled bins.

                  looks like the gcc versions are different, which would explain some of the errors.

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    Folly @dookieshooter
                    last edited by Folly

                    @dookieshooter

                    Different gcc version, that could be the problem.
                    Just try a binary, I think it will work.
                    Let me know if it does.

                    D 1 Reply Last reply Reply Quote 1
                    • D
                      dookieshooter @Folly
                      last edited by dookieshooter

                      @Folly

                      So I hacked around and THINK I got the mame 245 binary installed properly. I basically hacked up the mame.sh script in retropie setup to skip the compile step and only take the precompiled stuff from stickfreaks.

                      However, whatever game I use with it exit back out. so no dice there. Could be something else, but I think I'm going to re-install with an older ubuntu LTS image and be done w/ it for now.

                      of course, there's a mame 242 deb package already installed with ubuntu 22. possible to just point retropie to that somehow?

                      F 2 Replies Last reply Reply Quote 0
                      • F
                        Folly @dookieshooter
                        last edited by Folly

                        @dookieshooter

                        And if you run mame directly does it also fail ?
                        Use the command like this (check version) :

                        /opt/retropie/emulators/mame/mame -version
                        

                        or running mame

                        /opt/retropie/emulators/mame/mame
                        

                        Ok, using older version is probably better.
                        However I stopped using Ubuntu.
                        I had mouse pointer issues ( pointer suddenly gone )which I could not resolve in Ubuntu.
                        And for some reason I remember that I had issues with lr-mess too.
                        So from then on I use Debian instead which works far better and also far better with RetroPie, in my opinion.
                        Only nagging thing about Debian is that you probably need the version with "non-free drivers" to support some hardware.
                        And you need add the username to the /etc/sudoers file so you can use the command sudo.

                        1 Reply Last reply Reply Quote 0
                        • F
                          Folly @dookieshooter
                          last edited by

                          @dookieshooter said in compiling mame on ubuntu 22.04 fails:

                          So I hacked around and THINK I got the mame 245 binary installed properly. I basically hacked up the mame.sh script in retropie setup to skip the compile step and only take the precompiled stuff from stickfreaks.

                          Ok, It probably can work if you did it correct.

                          This is how I do it when mame has been already configured earlier :
                          Extract the .7z in /opt/retropie/emulators/mame .

                          This is how I do it when mame has NOT been configured earlier :
                          Extract the .7z in /opt/retropie/emulators/mame .

                          Commands for installing the dependencies and configuring :

                          cd RetroPie-Setup/
                          sudo ./retropie_packages.sh mame depends
                          sudo ./retropie_packages.sh mame configure
                          
                          1 Reply Last reply Reply Quote 0
                          • F Folly referenced this topic on
                          • First post
                            Last post

                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.