Compiling lmms (Apple) - eagles051387/lmms GitHub Wiki

Dependencies

The following dependencies should be met before compiling LMMS:

  • Apple OS X (10.7 "Lion" or higher) (5.3GB)

  • :bulb: Note: Qt5 on homebrew requires OS X 10.8 or higher per homebrew/#45284

  • Xcode Command Line Utilities

  • Xcode 4.6.3 or higher (2.2GB)

    • :bulb: Note: If you've recently upgraded your OS X version (e.g. from Yosemite to El Capitan), first make sure your XCode isn't outdated by running open -a XCode, or by locating it in Applications.
  • Xcode Command Line Utilities

    sudo xcode-select --install
    sudo xcodebuild -license
    

    Note: Alternately, you may install the command line tools via Applications, Xcode, Xcode Preferences menu, Downloads tab, Command Line Tools, Install

  • Homebrew or MacPorts required for fetching build dependencies

Homebrew

Skip this section if using MacPorts for fetching dependencies

  1. Install Homebrew per http://brew.sh

  2. Update brew

    brew update
    
  3. Clone source code

    git clone https://github.com/lmms/lmms
    

    Note: Optional, to clone a specific branch use the -b switch e.g. git clone -b master https://github.com/lmms/lmms

  4. Install brew dependencies using travis install file.

    Note: Optional, if Qt5 is desired

    export QT5=True
    
    sh lmms/.travis/osx..install.sh
    
  5. Note if you receive the following curl SSL error, this is most likely due to a missing SSL certificate. To fetch the latest certificates, run apple software updates, reboot and try again.

curl: (35) error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
Failed to download resource ".."
Download failed ... 
  1. Continue on to the Compiling section

MacPorts

Skip this section if using Homebrew for fetching dependencies

  1. Install MacPorts per https://www.macports.org/install.php

  2. Update the collection of available port definitions:

    sudo port selfupdate
    
  3. Install LMMS and all of its dependencies automatically:

    sudo port install lmms
    

    The LMMS application bundle will be in your MacPorts applications folder, which is /Applications/MacPorts unless you changed it.

  4. Alternately, if you would like to use MacPorts only to get the dependencies and compile LMMS from source manually:

    sudo port install cmake fftw-3-single fltk \
    fluidsynth jack libgig libogg libsamplerate libsdl \
    libsndfile libvorbis portaudio qt4-mac stk pkgconfig \
    nodejs npm
    

    Note: If the build fails because it can not find the QT version as in the following snippet then you should check that you can run qmake from the console, if you can't, you probably need to manually create 2 links (or find a better solution for the ticket macports qt4-mac)

    CMake Error at /opt/local/share/cmake-3.4/Modules/FindQt4.cmake:1324 (message):
    Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
    Call Stack (most recent call first):
    CMakeLists.txt:160 (FIND_PACKAGE)
    
    sudo ln -s /opt/local/libexec/qt4/bin/qmake /opt/local/bin/qmake   
    sudo ln -s /opt/local/libexec/qt4/bin/lrelease /opt/local/bin/lrelease
    
  5. Install appdmg (Needed only for for packaging the DMG file)

    sudo npm install -g appdmg
    
  6. Continue on to the Compiling section

Compiling

See also Compiling lmms (Linux)

  1. Assuming you have already fetched the sources (see Accessing git repository if not), switch to the source root directory, and create a new directory which is needed for you build.

    cd
    cd lmms
    mkdir build
    
  2. Optionally, you can also create a "target" directory, or you can install LMMS to any empty directory of your choice.

    mkdir target
    
  3. Then configure LMMS with CMake, using the previously created target directory (or any empty directory of your choice, in which case just replace "../target" with the directory you want to use).

    Note: Optional, if Qt5 is desired

    export CMAKE_PREFIX_PATH="$(brew --prefix qt5)"
    
    cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=../target
    

    Note: If you receive the error /usr/bin/xcode-select returned unexpected error

    • Make sure to install XCode as well as the XCode Command line tools for your platform
    • Remove CMakeCache.txt
    • Retry

    Note: To build for older versions (i.e. OS X 10.8), you will need the corresponding Xcode SDK installed.

    • Specify the target using: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.8
  4. Now compile LMMS:

    Note: make -j2, commonly used on Linux, won't work here.

    make
    
  5. Run LMMS:

    ./lmms
    

Installing

  1. You only need to do this step once. Extract a copy of the stk source code in your home directory (make install will copy the rawwaves directory from the stk source directory into the LMMS.app application bundle):

    cd
    curl -O https://ccrma.stanford.edu/software/stk/release/stk-4.5.0.tar.gz
    tar xopzf stk-4.5.0.tar.gz
    
  2. Finally, install LMMS into the previously specified directory:

    make install
    
  3. This will automatically create an LMMS.app application bundle in the build directory. image

    image You may copy this to Applications or run it directly from the build directory

Packaging

  1. Optionally, you may wish to package this into a DMG:

    make dmg
    

    image

Debugging LMMS OSX

  1. Clean the build environment
make clean
rm -rf CMakeCache.txt
  1. Re-run cmake configure step with the following additional parameters:
-DCMAKE_BUILD_TYPE=Debug -DWANT_SWH=OFF
  1. Re-run the make install step

  2. Launch LMMS with the lldb debugger. You will be prompted for your password.

    lldb ~/Desktop/LMMS.app/Contents/MacOS/lmms
    
  3. Reproduce the crash. Hit CTRL+C. Type this command from lldb for a backtrace:

    thread backtrace all
    
  4. Post the back-trace to https://gist.github.com/ and paste the link to a new bug report.