Sonic-pi: Cannot compile from source on Debian Stretch

Created on 10 Mar 2019  路  12Comments  路  Source: sonic-pi-net/sonic-pi

Hello,

Followed the instructions at INSTALL-LINUX.md to compile from source:

sudo apt-get install -y g++ ruby ruby-dev pkg-config git build-essential libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libicu-dev libreadline6-dev libfftw3-dev libxt-dev libudev-dev cmake libboost-dev libqwt-qt5-dev libqt5scintilla2-dev libqt5svg5-dev qt5-qmake qt5-default qttools5-dev qttools5-dev-tools qtdeclarative5-dev libqt5webkit5-dev qtpositioning5-dev libqt5sensors5-dev qtmultimedia5-dev libffi-dev curl python erlang-base

[~/git_repos/music-making/sonic-pi/app/gui/qt]% sh ./build-debian-app

./build-debian-app: 16: ./build-debian-app: Bad substitution
This script is modified version of the original build-ubuntu-app script. This has been tested on Debian Stretch (9).
In some cases users may need to install some of the dependencies by hand from source.
We're working to make a one shot script solution for all Linux platforms.
Original script made by Factoid and possibly other people, modified for Debian Stretch by SunderB.
Some packages may be built from source and installed manually.
How do you want to install these packages?
1 - install manually via. make install.
2 - make .deb packages via. checkinstall and install those via dpkg. (Only works on Debian)
Type quit to exit.
1
./build-debian-app: 38: [: 1: unexpected operator
-e Installing dependencies for building supercollider, as well as qt5 and supporting libraries for gui...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libasound2-dev is already the newest version (1.1.3-5).
libavahi-client-dev is already the newest version (0.6.32-2).
libboost-dev is already the newest version (1.62.0.1).
build-essential is already the newest version (12.3).
cmake is already the newest version (3.7.2-1).
curl is already the newest version (7.52.1-5+deb9u9).
erlang-base is already the newest version (1:19.2.1+dfsg-2+deb9u2).
libfftw3-dev is already the newest version (3.3.5-3).
g++ is already the newest version (4:6.3.0-4).
git is already the newest version (1:2.11.0-3+deb9u4).
libicu-dev is already the newest version (57.1-6+deb9u2).
libffi-dev is already the newest version (3.2.1-6).
libsndfile1-dev is already the newest version (1.0.27-3).
libxt-dev is already the newest version (1:1.1.5-1).
pkg-config is already the newest version (0.29-4+b1).
python is already the newest version (2.7.13-2).
libqt5scintilla2-dev is already the newest version (2.9.3+dfsg-4).
qtdeclarative5-dev is already the newest version (5.7.1-2+b2).
qtpositioning5-dev is already the newest version (5.7.1-1).
qtmultimedia5-dev is already the newest version (5.7.1~20161021-2).
libqt5sensors5-dev is already the newest version (5.7.1~20161021-2).
libqt5svg5-dev is already the newest version (5.7.1~20161021-2+b2).
qttools5-dev is already the newest version (5.7.1-1).
qttools5-dev-tools is already the newest version (5.7.1-1).
libqt5webkit5-dev is already the newest version (5.7.1+dfsg-1).
libqwt-qt5-dev is already the newest version (6.1.2-6).
ruby is already the newest version (1:2.3.3).
ruby-dev is already the newest version (1:2.3.3).
libudev-dev is already the newest version (232-25+deb9u8).
qt5-default is already the newest version (5.7.1+dfsg-3+deb9u1).
qt5-qmake is already the newest version (5.7.1+dfsg-3+deb9u1).
libjack-jackd2-dev is already the newest version (2:1.9.12-1~kxstudio1v5).
libreadline6-dev is already the newest version (6.3-8ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
./build-debian-app: 54: [: 1: unexpected operator
-e Building supercollider from source...
fatal: destination path 'supercollider' already exists and is not an empty directory.
HEAD is now at 2aa400aec... Merge pull request #3497 from supercollider/3.9
-- SuperCollider Version: 3.9.1
-- Building from branch HEAD, commit hash is 2aa400aec
-- Build type defaulting to "RelWithDebInfo"
-- Compiling with Qt GUI
-- building boost libraries manually
-- using bundled libyaml-cpp
-- HIDAPI components:
--     linux hidraw
-- libudev stable: 1
-- Found UDev: /lib/x86_64-linux-gnu/libudev.so
--    include: /usr/include
--     hidapi_parser
-- Building with HID support
-- Using fftw3f
-- Found jack: /usr/lib/x86_64-linux-gnu/libjack.so
-- Audio API: jack
-- Found GNU Readline version 6.3: /usr/lib/x86_64-linux-gnu/libreadline.so
CMake Warning at QtCollider/CMakeLists.txt:11 (find_package):
  By not providing "FindQt5OpenGL.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5OpenGL", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5OpenGL" with
  any of the following names:

    Qt5OpenGLConfig.cmake
    qt5opengl-config.cmake

  Add the installation prefix of "Qt5OpenGL" to CMAKE_PREFIX_PATH or set
  "Qt5OpenGL_DIR" to a directory containing one of the above files.  If
  "Qt5OpenGL" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  lang/CMakeLists.txt:189 (include)


-- Found Qt: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.7.1
-- Compiling with Readline support
-- Compiling with ALSA midi support
-- Building the Qt IDE
CMake Warning at editors/sc-ide/CMakeLists.txt:10 (find_package):
  By not providing "FindQt5OpenGL.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5OpenGL", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5OpenGL" with
  any of the following names:

    Qt5OpenGLConfig.cmake
    qt5opengl-config.cmake

  Add the installation prefix of "Qt5OpenGL" to CMAKE_PREFIX_PATH or set
  "Qt5OpenGL_DIR" to a directory containing one of the above files.  If
  "Qt5OpenGL" provides a separate development package or SDK, be sure it has
  been installed.


-- Building with Sced for gedit 3 (UNIX)
-- Configuring done
CMake Warning (dev) at lang/CMakeLists.txt:323 (add_executable):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "sclang" links to target "Qt5::OpenGL" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lang/CMakeLists.txt:208 (add_library):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "libsclang" links to target "Qt5::OpenGL" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at editors/sc-ide/CMakeLists.txt:265 (add_executable):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "SuperCollider" links to target "Qt5::OpenGL" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lang/CMakeLists.txt:323 (add_executable):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "sclang" links to target "Qt5::OpenGL" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at editors/sc-ide/CMakeLists.txt:265 (add_executable):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "SuperCollider" links to target "Qt5::OpenGL" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/jb/git_repos/music-making/supercollider/build
[  0%] Built target hidapi
[  0%] Built target hidapi_parser
[  1%] Built target DiskIO_UGens_supernova
[  1%] Built target UIUGens_supernova
[  2%] Built target PV_ThirdParty_supernova
[  2%] Built target TriggerUGens
[  3%] Built target PV_ThirdParty
[  4%] Built target LFUGens
[  4%] Built target ReverbUGens
[  5%] Built target FFT_UGens
[  5%] Built target MulAddUGens
[  5%] Built target UnpackFFTUGens
[  6%] Built target TestUGens_supernova
[  6%] Built target PanUGens
[  7%] Built target ChaosUGens_supernova
[  8%] Built target ML_UGens_supernova
[  8%] Built target IOUGens
[  9%] Built target PhysicalModelingUGens_supernova
[ 10%] Built target DemandUGens
[ 11%] Built target MulAddUGens_supernova
[ 12%] Built target UIUGens
[ 12%] Built target UnaryOpUGens
[ 12%] Built target ChaosUGens
[ 12%] Built target BinaryOpUGens
[ 13%] Built target FFT_UGens_supernova
[ 13%] Built target FilterUGens
[ 14%] Built target OscUGens
[ 14%] Built target DemandUGens_supernova
[ 14%] Built target LFUGens_supernova
[ 15%] Built target GrainUGens_supernova
[ 15%] Built target PhysicalModelingUGens
[ 16%] Built target GendynUGens
[ 16%] Built target TestUGens
[ 16%] Built target DelayUGens_supernova
[ 16%] Built target GrainUGens
[ 16%] Built target GendynUGens_supernova
[ 16%] Built target TriggerUGens_supernova
[ 18%] Built target ML_UGens
[ 18%] Built target DelayUGens
[ 18%] Built target IOUGens_supernova
[ 18%] Built target DiskIO_UGens
[ 18%] Built target DynNoiseUGens
[ 18%] Built target BinaryOpUGens_supernova
[ 18%] Built target NoiseUGens_supernova
[ 18%] Built target NoiseUGens
[ 18%] Built target OscUGens_supernova
[ 18%] Built target FilterUGens_supernova
[ 18%] Built target DynNoiseUGens_supernova
[ 18%] Built target PanUGens_supernova
[ 18%] Built target ReverbUGens_supernova
[ 19%] Built target UnaryOpUGens_supernova
[ 19%] Built target UnpackFFTUGens_supernova
[ 19%] Built target boost_system
[ 21%] Built target boost_filesystem
[ 21%] Built target tlsf
[ 28%] Built target libscsynth
[ 28%] Built target scsynth
[ 30%] Built target boost_program_options
[ 31%] Built target boost_thread
[ 31%] Built target oscpack
[ 34%] Built target libsupernova
[ 35%] Built target supernova
Scanning dependencies of target yaml
[ 35%] Building CXX object external_libraries/CMakeFiles/yaml.dir/libyamlcpp.cpp.o
[ 36%] Linking CXX static library libyaml.a
[ 36%] Built target yaml
[ 69%] Built target libsclang
[ 69%] Linking CXX executable sclang
/usr/bin/ld: cannot find -lQt5::OpenGL
collect2: error: ld returned 1 exit status
lang/CMakeFiles/sclang.dir/build.make:126: recipe for target 'lang/sclang' failed
make[2]: *** [lang/sclang] Error 1
CMakeFiles/Makefile2:3618: recipe for target 'lang/CMakeFiles/sclang.dir/all' failed
make[1]: *** [lang/CMakeFiles/sclang.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

Am I missing something?

Linux developer experience

Most helpful comment

Firstly, it's a bash script, not an sh script, so it should be run using bash: bash ./build-debian-app. Hopefully this should remove some errors.

Installed libqt5opengl5-dev, and made progress on the compilation process.
Still got it failing with this error:

Building sonic-pi binary...
<snip>
g++ -m64 -Wl,-O1 -Wl,-z,relro -o sonic-pi qrc_SonicPi.o qrc_help_files.o qrc_info_files.o main.o mainwindow.o sonicpilexer.o sonicpiapis.o sonicpiscintilla.o oschandler.o oscsender.o sonicpilog.o sonic_pi_osc_server.o sonic_pi_udp_osc_server.o sonic_pi_tcp_osc_server.o sonicpitheme.o scope.o infowidget.o moc_mainwindow.o moc_sonicpilexer.o moc_sonicpilog.o moc_sonicpiscintilla.o moc_sonic_pi_osc_server.o moc_sonic_pi_udp_osc_server.o moc_sonic_pi_tcp_osc_server.o moc_sonicpitheme.o moc_scope.o moc_infowidget.o   -L/usr/X11R6/lib64 -lrt -lqscintilla2_qt5 -L/lib -lqwt-qt5 -L/usr/lib/x86_64-linux-gnu -lqt5scintilla2 -lQt5OpenGL -lQt5Svg -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Concurrent -lQt5Network -lQt5Core -lGL -lpthread 
/usr/bin/ld: cannot find -lqscintilla2_qt5
collect2: error: ld returned 1 exit status
Makefile:218: recipe for target 'sonic-pi' failed
make: *** [sonic-pi] Error 1

I can only suppose some library related to scintilla2 is still missing?

I've also encountered this error recently.
When the compiler tries to link the code together, I think it scans certain directories for the library files with the specific name(?), so maybe the name of the lib specified is incorrect?
On my computer, I managed to get it to work by modifying the SonicPi.pro file slightly:

# Linux only
unix:!macx {
  LIBS += -lrt -lqt5scintilla2 # <-- was qscintilla2_qt5
  QMAKE_CXXFLAGS += -std=gnu++11
  QMAKE_CXXFLAGS += -Wall -Werror -Wextra -Wno-unused-variable -Wno-unused-parameter
  debug {
    QMAKE_CXXFLAGS += -ggdb
  }
}

What's odd is that I don't remember having to do that before. Maybe the name of it changed slightly from qscintilla2_qt5 to qt5scintilla2? I don't know.

All 12 comments

same here

/usr/bin/ld: cannot find -lQt5::OpenGL

Do you have the "libqt5opengl5-dev" package installed?

Installed libqt5opengl5-dev and problem resolved, but got another problem later while installing supercollider:
Makefile:1784: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Segmentation fault

Then, that isn't a question for this thread on this repo, unless I'm not understanding it right.

Installed libqt5opengl5-dev, and made progress on the compilation process.
Still got it failing with this error:

Building sonic-pi binary...
<snip>
g++ -m64 -Wl,-O1 -Wl,-z,relro -o sonic-pi qrc_SonicPi.o qrc_help_files.o qrc_info_files.o main.o mainwindow.o sonicpilexer.o sonicpiapis.o sonicpiscintilla.o oschandler.o oscsender.o sonicpilog.o sonic_pi_osc_server.o sonic_pi_udp_osc_server.o sonic_pi_tcp_osc_server.o sonicpitheme.o scope.o infowidget.o moc_mainwindow.o moc_sonicpilexer.o moc_sonicpilog.o moc_sonicpiscintilla.o moc_sonic_pi_osc_server.o moc_sonic_pi_udp_osc_server.o moc_sonic_pi_tcp_osc_server.o moc_sonicpitheme.o moc_scope.o moc_infowidget.o   -L/usr/X11R6/lib64 -lrt -lqscintilla2_qt5 -L/lib -lqwt-qt5 -L/usr/lib/x86_64-linux-gnu -lqt5scintilla2 -lQt5OpenGL -lQt5Svg -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Concurrent -lQt5Network -lQt5Core -lGL -lpthread 
/usr/bin/ld: cannot find -lqscintilla2_qt5
collect2: error: ld returned 1 exit status
Makefile:218: recipe for target 'sonic-pi' failed
make: *** [sonic-pi] Error 1

I can only suppose some library related to scintilla2 is still missing?

"libqscintilla2-dev" package installed?

Firstly, it's a bash script, not an sh script, so it should be run using bash: bash ./build-debian-app. Hopefully this should remove some errors.

Installed libqt5opengl5-dev, and made progress on the compilation process.
Still got it failing with this error:

Building sonic-pi binary...
<snip>
g++ -m64 -Wl,-O1 -Wl,-z,relro -o sonic-pi qrc_SonicPi.o qrc_help_files.o qrc_info_files.o main.o mainwindow.o sonicpilexer.o sonicpiapis.o sonicpiscintilla.o oschandler.o oscsender.o sonicpilog.o sonic_pi_osc_server.o sonic_pi_udp_osc_server.o sonic_pi_tcp_osc_server.o sonicpitheme.o scope.o infowidget.o moc_mainwindow.o moc_sonicpilexer.o moc_sonicpilog.o moc_sonicpiscintilla.o moc_sonic_pi_osc_server.o moc_sonic_pi_udp_osc_server.o moc_sonic_pi_tcp_osc_server.o moc_sonicpitheme.o moc_scope.o moc_infowidget.o   -L/usr/X11R6/lib64 -lrt -lqscintilla2_qt5 -L/lib -lqwt-qt5 -L/usr/lib/x86_64-linux-gnu -lqt5scintilla2 -lQt5OpenGL -lQt5Svg -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Concurrent -lQt5Network -lQt5Core -lGL -lpthread 
/usr/bin/ld: cannot find -lqscintilla2_qt5
collect2: error: ld returned 1 exit status
Makefile:218: recipe for target 'sonic-pi' failed
make: *** [sonic-pi] Error 1

I can only suppose some library related to scintilla2 is still missing?

I've also encountered this error recently.
When the compiler tries to link the code together, I think it scans certain directories for the library files with the specific name(?), so maybe the name of the lib specified is incorrect?
On my computer, I managed to get it to work by modifying the SonicPi.pro file slightly:

# Linux only
unix:!macx {
  LIBS += -lrt -lqt5scintilla2 # <-- was qscintilla2_qt5
  QMAKE_CXXFLAGS += -std=gnu++11
  QMAKE_CXXFLAGS += -Wall -Werror -Wextra -Wno-unused-variable -Wno-unused-parameter
  debug {
    QMAKE_CXXFLAGS += -ggdb
  }
}

What's odd is that I don't remember having to do that before. Maybe the name of it changed slightly from qscintilla2_qt5 to qt5scintilla2? I don't know.

Thank you trebmuh and SunderB.

(libqscintilla2-dev was not installed, but installing it did not solve the problem).

Modifying the SonicPi.pro file as specified above solved the problem. Got the app running now!

I will issue a pull request to add the dependency on libqt5opengl5-dev. Should I include the modification to SonicPi.pro as well?

I just compiled Sonic-Pi v3.2.0 successfully on Debian Stretch

at first encountered this error

./build-debian-app: line 203: lrulease: command not found

I had to change line 203 of build-debian-app from

lrulease SonicPi.pro

to

lrelease SonicPi.pro

========

also line 39 of the Makefile from

LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lrt -lqscintilla2_qt5 -L/lib -lqwt-qt5 -L/usr/lib/x86_64-linux-gnu -lqt5scintilla2 -lQt5OpenGL -lQt5Svg -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Concurrent -lQt5Network -lQt5Core -lGL -lpthread

to

LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lrt -lqt5scintilla2 -L/lib -lqwt-qt5 -L/usr/lib/x86_64-linux-gnu -lqt5scintilla2 -lQt5OpenGL -lQt5Svg -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Concurrent -lQt5Network -lQt5Core -lGL -lpthread

essentially replacing -lqscintilla2_qt5 with -lqt5scintilla2

========

to get MIDI to work...

move the osmid folder and its contents

from sonic-pi/app/server/native/linux/osmid

to sonic-pi/app/server/native/

creating sonic-pi/app/server/native/osmid with the files m2o and o2m within

libqt5opengl5-dev

could someone please add mention of this package in the Linux readme?

@escuta - it is already there, if we are still talking about INSTALL-LINUX.md.
See https://github.com/samaaron/sonic-pi/blob/master/INSTALL-LINUX.md#1-install-dependencies--prerequisites - scroll down to the Debian/Ubuntu packages under Package installation one-liners

Hi all that have commented on this issue - if you are still wondering about linux compilation problems you have had in the past, I encourage you to update your copy of the Sonic Pi source code and try again. (Latest stable is https://github.com/samaaron/sonic-pi/tree/v3.2.2 at time of writing, or master branch if you are interested in bleeding edge).
Much work has been carried out recently on the way to a better build system, and it should now be a lot easier to compile on Linux. I'll close this issue for now, but if anyone still has issues after trying with the updated code, feel free to reopen this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MoiRouhs picture MoiRouhs  路  3Comments

ctford picture ctford  路  6Comments

chunseoklee picture chunseoklee  路  4Comments

adamrmelnyk picture adamrmelnyk  路  7Comments

farukbigez picture farukbigez  路  7Comments