Trouble building rtaudio in Ubuntu 16.04

Rack’s rtaudio dependency requires cmake 3.10. I’m trying to build rack in a Docker image built on Ubuntu 16.04. I get this error message:

cd rtaudio && mkdir -p build
cd rtaudio/build && cmake -DCMAKE_INSTALL_PREFIX="/Rack/dep/." -DCMAKE_INSTALL_LIBDIR=lib -DRTAUDIO_BUILD_STATIC_LIBS=ON -DRTAUDIO_API_ALSA=ON -DRTAUDIO_API_JACK=OFF -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_OSS=OFF ..
CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
  CMake 3.10 or higher is required.  You are running version 3.5.1

When I build the docker image, I apt-get install cmake without specifying a version. I’ve tried specifying apt-get install cmake=3.10 to no avail.

Any idea how to get cmake 3.10 (or higher) on Ubuntu 16.04? Will I have to build it instead of installing it?

You could install a binary. https://cmake.org/download/

Thanks, I’ll try that.

I had the same problem
solved with a

sudo yum install

:muscle:

Would I need to install yum first, or is it already there?

A quick scan of the internet suggests that installing yum on Ubuntu is a sin against four different gods. I lack the religious training to evaluate such things.

I was able to install cmake 3.10 in my docker image by adding this to my Dockerfile:

ADD https://cmake.org/files/v3.10/cmake-3.10.3-Linux-x86_64.sh /cmake-3.10.3-Linux-x86_64.sh
RUN mkdir /opt/cmake \
  && sh /cmake-3.10.3-Linux-x86_64.sh --prefix=/opt/cmake --skip-license \
  && ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
1 Like

sorry you should use

apt get install cmake

or something related on Ubuntu!
current cmake should be 3.11
(I’m on Debian!)

On Ubuntu 16.04 that command installs cmake 3.5.1, which is how the failure happened in the first place.

1 Like

I’m on an old distro (Fedora 23) and occasionally run into this problem. I resolved the issue by building the latest cmake myself and installing it to the /opt directory (NOT to anywhere in the /usr hierarchy). Then when I need it I’ll invoke it (or link it) from that path.

Just run into this myself. I’m compiling cmake now.

This dependency is going to be an issue for pretty much anyone building on Ubuntu.

1 Like

I don’t see a workaround other than sending a patch to RtAudio that downgrades the CMake requirement. They might not accept it.

No, I can’t think of a good solution either.

EDIT: Actually someone else has already submitted exactly such a PR to rtaudio

In the instructions for how to build Rack on Ubuntu 16.04, include instructions for how to install a sufficient version of cmake.

You can just change the required CMake version in the CMakeLists.txt of rtaudio definition, as rtaudio does not need this version to build. This then should also a be problem for rtmidi.