Skip to content

Compiling lmms (On Windows)

Dave French edited this page Sep 6, 2015 · 58 revisions

#Compiling LMMS on Windows ###Building LMMS Using MSYS2 and mingw-w64 on Windows 64-bit

  • LMMS complied and running on Windows 7 64-bit

    image

  • Note: This tutorial was created in an effort to enable code debugging on Windows. This tutorial is not yet supported. Please find our official Windows build tutorial here: Compiling-lmms-(Windows)

  • Note: The pacman mirrors that come default with msys2 rely heavily on sourceforge.net mirrors. If you are having problems with pacman, first make sure sourceforge isn't experiencing downtime.

###Install Dependencies

  1. Download and install 64-bit msys2 from https://msys2.github.io/

  2. Launch MSYS2 Shell, update (about 16MB):

Sync your local database:

pacman -Sy

Update essential packages:

pacman --needed -S bash pacman pacman-mirrors msys2-runtime

Restart MSYS2 (important), and update the rest of your packages:

pacman -Su

Note: If at any time you receive the message Errors occurred, no packages were upgraded, try again.

  1. Download and install the 32-bit and 64-bit toolchains (about 85MB)
pacman -S mingw-w64-x86_64-gcc mingw-w64-i686-gcc
  1. Download and install dependencies (about 726MB, 3.3GB installed)
pacman -S git pkgconfig make cmake wget p7zip gzip tar binutils mingw-w64-x86_64-qt4 mingw-w64-i686-qt4 gdb
  1. Close and re-open msys2. Download msys_helper.sh helper script
#FIXME: Change this URL to https://github.com/lmms/[...]
wget https://raw.githubusercontent.com/tresf/lmms/master/cmake/msys/msys_helper.sh --no-check-certificate
  1. Run the helper script. This will automatically:
  • Download, extract and install the mingw ppa (400MB)
  • Download, compile and install fluid.exe
  • Configure git for use with msys
./msys_helper.sh

Note: You will eventually receive some messages cp: cannot create regular file, these are safe to ignore.

Note2: Fluid may show warnings during build, these are generally safe to ignore as well.

  1. Create symbolic links for CMD-style paths (workaround msys2's moc.exe issue)
  • Open CMD as administrator (Start, "CMD", CTRL + SHIFT + ENTER)

  • Run the following commands:

    mklink /d %SystemDrive%\mingw64 %SystemDrive%\msys64\mingw64
    mklink /d %SystemDrive%\mingw32 %SystemDrive%\msys64\mingw32
    mklink /d %SystemDrive%\home %SystemDrive%\msys64\home

###Compiling

  1. Run configure
cd ~/lmms
mkdir build target
cd build
../cmake/build_mingw64.sh
  1. Build
make VERBOSE=1

Note: mallets are broken on 32-bit. Edit CMakeLists.txt change WANT_STK OFF

Note: win32 builds need fluid to be rebuilt by the 32-bit compiler. The easiest way to do this is open MinGW-w64 Win32-Shell:

rm -rf /usr/local/bin/fluid.exe
. ~/msys_helper.sh

###Running

  1. Run
./lmms.exe
  1. (TODO) Fix artwork directory. Installing and running the Windows desktop version will help resolve artwork.

###Debugging

  1. Enable debug symbols to be passed to mingw script

    export CMAKE_OPTS=-DCMAKE_BUILD_TYPE=Debug
  2. Add manual reference to QtCore4.dll

    Note: FIXME: Can we add this automatically via IF(CMAKE_BUILD_TYPE STREQUAL "Debug")

    • src/CMakeLists.txt:115

      TARGET_LINK_LIBRARIES(lmms
          ${LMMS_REQUIRED_LIBS} QtCore4
          # Fix debug builds ---^
      )
    • plugins/zynaddsubfx/CMakeLists.txt:112

      TARGET_LINK_LIBRARIES(ZynAddSubFxCore zynaddsubfx_nio ${FFTW3F_LIBRARIES} 
      ${QT_LIBRARIES} -lz -lpthread QtCore4)
      #         Fix debug builds ---^
  3. Add the Following line to lmms/CMakeLists.txt between ln 144 145

SET(QT_LIBRARIES optimized;/mingw64/bin/QtGui4.dll;debug;/mingw64/bin/QtGui4.dll$ )

Note, this is a Hack that need to be cleaned, but gets win64 debug build working

 1. Add the Following line to cmake/modules/BuildPlugin.cmake ln 34
```` SET(QT_LIBRARIES
           optimized;/mingw64/bin/QtGui4.dll;debug;/mingw64/bin/QtGui4.dll;optimized;/mingw64/bin/QtXml4.dll;debug;/mingw64/bin/QtXml4.dll;optimized;/mingw64/bin/QtCore4.dll;debug;/mingw64/bin/QtCore4.dll
        )
  1. Remove the build directory and run the appropriate build script again

  2. To debug the lmms.exe process

    gdb lmms.exe
    run

###Packaging

  1. Install NSIS from http://nsis.sourceforge.net/Download

  2. Add NSIS to Windows PATH

    • Navigate to View Advanced System Settings, Environment Variables
    • Add this to the very end of the System PATH
    ;c:\Program Files (x86)\nsis\
  3. Create the package

    make package