Skip to content
Hyunjin Song edited this page Aug 19, 2023 · 34 revisions

Xcode

  • Xcode>=4.6.3* is required for compilation.

    * If recently upgraded OS make sure your XCode isn't outdated by running open -a XCode, or via Applications.

  • Xcode Command Line Utilities* must be activated.

    sudo xcode-select --install
    sudo xcodebuild -license

    *Alternately via Applications, Xcode, Xcode Preferences menu, Downloads tab, Command Line Tools, Install. Or if that's missing, hunt down the installer from Apple Downloads.

Homebrew

  • Homebrew* or an equivelent package manager is required for fetching libraries

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    *Alternately, you may use MacPorts instead.

    brew install git cmake pkgconfig fftw libogg libvorbis lame libsndfile libsamplerate jack \
    fluid-synth sdl2 libgig libsoundio stk portaudio node fltk qt5 glib

    * If you're building 1.2.x or older, also install sdl12-compat(formerly sdl).

    And the dmg packaging utility

    npm install -g appdmg

    ...done installing? Next, clone the source code

Building on macOS 10.8

Note: This section is for macOS 10.8 only.

10.8 Custom Steps

sudo mv /usr/bin/git /usr/bin/git.old && sudo ln -s /usr/local/bin/git /usr/bin/git # TLS1.0 was highest the OS provided, use brew version instead
brew reinstall --build-from-source https://gist.githubusercontent.com/tresf/9b87883886f691d0e6711f8c71d362a4/raw/stk.rb
brew reinstall --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/9e2b257db3d24c9e5bd7ce2248746688f7e3f6e9/Formula/cmake.rb
brew reinstall --build-from-source https://raw.githubusercontent.com/tresf/homebrew-core/2f6bd4138f9af6b26b5bcb066f944c9491fb106d/Formula/node.rb
brew reinstall --build-from-source https://gist.githubusercontent.com/tresf/c9260c43270abd4ce66ff40359588435/raw/650aa94f29e698b76991ed4db94cd9f0188cb7ef/fluid-synth.rb --ignore-dependencies --env=std
brew reinstall --build-from-source https://gist.githubusercontent.com/tresf/43549a998aafef79433d82659abc1922/raw/281b0e295ad29e743bcf3fe2139193976759b809/libgig.rb
brew reinstall --build-from-source https://gist.githubusercontent.com/tresf/9b87883886f691d0e6711f8c71d362a4/raw/7ac73754fdeab0ab7243b540c2ca66f272043871/stk.rb
brew reinstall --build-from-source qt@5.5 # this will take a long, long time

Then apply some manual patches

# Install ThreadLocal.h
curl -O https://raw.githubusercontent.com/wang-bin/ThreadLocal/master/ThreadLocal.h
mv ThreadLocal.h ~/lmms/include

# Patch MemoryManager.cpp
curl -O https://gist.githubusercontent.com/tresf/36aec89c18f4c7f5d4ebe7805db70d53/raw/51520dee2134b55692d499e753297a29923f1873/MemoryManager.cpp.diff
patch ~/lmms/src/core/MemoryManager.cpp MemoryManager.cpp.diff

# Patch rpmalloc.c
cd src/3rdparty/rpmalloc/rpmalloc
# Force to the last version compatible with this compiler
git reset --hard 1.3.0 # 1.3.1 introduced C++11 atomics which aren't compatible with this version of Clang
curl -O https://gist.githubusercontent.com/tresf/ad797cb09259bff388d8e9beb939a080/raw/88182a0d174d706c006f6b7417c5e6a1c6882fe9/rpmalloc.c.diff
patch ~/lmms/src/3rdparty/rpmalloc/rpmalloc/rpmalloc/rpmalloc.c rpmalloc.c.diff

    ...done installing? Next, clone the source code

Troubleshooting

Namespace Errors

- include/QtCore/qglobal.h:675:70: error: no template named 'is_arithmetic_v' in namespace 'std'; did you mean 'is_arithmetic'?

Check to make sure only qt5 is installed, the build system may be getting headers from another Qt version.

Library Loading Issues

export DYLD_PRINT_LIBRARIES=1
/Applications/LMMS.app/Contents/MacOS/lmms  # or build/LMMS.app/Contents/MacOS/lmms

   ...want to add something?