• Software
  • Building Flucoma on Bela, issue upgrading CMake

I have built Flucoma for Bela with clients for SuperCollider, Pure Data and C++ https://github.com/jarmitage/flucoma-bela

Original post (for posterity)

See also: https://discourse.flucoma.org/t/guidance-building-for-bela-platform/876

I am trying to build the SuperCollider version of Flucoma (https://www.flucoma.org/) on Bela.

Flucoma depends on CMake ≥3.11 whereas Bela has CMake 3.7ish

I downloaded a recent CMake and am trying to install it. I am using distcc so my install command looks like CC="distcc-clang" CXX="distcc-clang++" ./bootstrap && make && sudo make install.

The initial compile pass seems to work fine, then at the linking stage I get this error:

loading initial cache file /root/cmake-3.22.1/Bootstrap.cmk/InitialCacheFlags.cmake
CMake Error at Modules/Compiler/._ADSP-DetermineCompiler.cmake:1:
  Parse error.  Expected a command name, got bad character with text "".
Call Stack (most recent call first):
  Modules/CMakeCompilerIdDetection.cmake:6 (include)
  Modules/CMakeCompilerIdDetection.cmake:33 (_readFile)
  Modules/CMakeDetermineCompilerId.cmake:283 (compiler_id_detection)
  Modules/CMakeDetermineCompilerId.cmake:302 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  Modules/CMakeDetermineCompilerId.cmake:59 (__determine_compiler_id_test)
  Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:7 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/root/cmake-3.22.1/CMakeFiles/CMakeOutput.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
root@bela:~/cmake-3.22.1# cat CMakeFiles/CMakeOutput.log
The system is: Linux - 4.14.108-ti-xenomai-r143 - armv7l

Unsure of what to do, I prepended these lines to CMakeFiles.txt to see what would happen:

set(CMAKE_C_COMPILER "/usr/local/bin/distcc-clang")
set(CMAKE_CXX_COMPILER "/usr/local/bin/distcc-clang++")

Tried again, got these errors:

loading initial cache file /root/cmake-3.22.1/Bootstrap.cmk/InitialCacheFlags.cmake
CMake Error at Modules/Compiler/._ADSP-DetermineCompiler.cmake:1:
  Parse error.  Expected a command name, got bad character with text "".
Call Stack (most recent call first):
  Modules/CMakeCompilerIdDetection.cmake:6 (include)
  Modules/CMakeCompilerIdDetection.cmake:33 (_readFile)
  Modules/CMakeDetermineCompilerId.cmake:283 (compiler_id_detection)
  Modules/CMakeDetermineCompilerId.cmake:302 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  Modules/CMakeDetermineCompilerId.cmake:59 (__determine_compiler_id_test)
  Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:9 (project)

-- Configuring incomplete, errors occurred!
See also "/root/cmake-3.22.1/CMakeFiles/CMakeOutput.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------

The only thing I can think to do next is to not use distcc, which would require me to have slightly more time on my hands. Any ideas?

Tried to be cheeky and compile flucoma-sc with CMake 3.7:

CMake Error at CMakeLists.txt:66 (include):
  include could not find load file:

    FetchContent


CMake Error at CMakeLists.txt:70 (FetchContent_Declare):
  Unknown CMake command "FetchContent_Declare".


-- Configuring incomplete, errors occurred!
See also "/root/flucoma-sc/build/CMakeFiles/CMakeOutput.log".

jarm Any reason why not?

it would require installation of the package from source or pre-built binaries (if available) instead of apt-get and that may easily get you into dependency hell (or not!).

I'd suggest you try out this fresh next-gen image:

https://github.com/BelaPlatform/bela-image-builder/releases/tag/v0.5.0alpha2

note that here you'll need an updated clang (11) on your host for distcc to work properly and you'll also need to edit /usr/local/bin/distcc-clang++ and /usr/local/bin/distcc-clang accordingly.

  • jarm replied to this.

    Yeah, I did notice that apt was only offering cmake-3.7.2, that's a shame

    Are you inferring that this new image may come with or provide more recent versions of CMake?

    Happy to give it a go 🙂

      jarm Are you inferring that this new image may come with or provide more recent versions of CMake?

      3.18

      Booted the new image, got clang-11, updated distcc scripts, running into this error when testing it out:

      distccd[50109] (dcc_scan_args) found input file "/root/Bela/resources/network/udp-client.c"
      distccd[50109] (dcc_scan_args) found object/output file "udp-client.o"
      distccd[50109] compile from udp-client.c to udp-client.o
      distccd[50109] (dcc_run_job) output file udp-client.o
      distccd[50109] (dcc_input_tmpnam) input file /root/Bela/resources/network/udp-client.c
      distccd[50109] (dcc_readx) ERROR: unexpected eof on fd5
      distccd[50109] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
      distccd[50109] (dcc_cleanup_tempfiles_inner) deleted 5 temporary files
      distccd[50109] (dcc_job_summary) client: 192.168.7.2:40944 OTHER exit:0 sig:0 core:0 ret:108 time:14ms

      giuliomoro you'll also need to edit /usr/local/bin/distcc-clang++ and /usr/local/bin/distcc-clang accordingly.

      To clarify, what I've actually done on the host is created /usr/local/bin/clang-3.11-arm and /usr/local/bin/clang++-3.11-arm, and added the correct path to both of those for the host's clang-11. I assume that's what you meant.

      On Bela, I haven't changed anything out of the box with distcc.

      On bela you also need to replace ${CLANG_VERSION} in /usr/local/bin/distcc-clang* with 11. Anyhow, that log looks like a protocol mismatch error . The board has distcc 3.3.5, you may want to make sure you have a similar version on the host.

      Updated to distcc-3.3.5, updated Bela scripts, getting same error.

      Will go through and check everything again but don't think I've missed anything at this point (famous last words)...

      try with a simple program

      int main()
      {
         return 0;
      }

      and try to build it with distcc-clang test.c -c -o test.o and see how that goes

      ah turns out you also have to apply the same fix to /usr/local/bin/clang++-11-arm and /usr/local/bin/clang-11-arm

      Just to confirm, on a Linux host (Ubuntu 20.04) where I installed the clang+-11, g++-10-arm-linux-gnueabihf and distcc-3.3.3 packages. I have these files on the host:

      ===/usr/local/bin/clang++-11-arm===
      #!/bin/bash
      clang++-11 -target armv7l-unknown-linux-gnueabihf $@
      ===/usr/local/bin/clang-11-arm===
      #!/bin/bash
      clang-11 -target armv7l-unknown-linux-gnueabihf $@
      
      ===/usr/local/bin/g++-10-arm===
      #!/bin/bash
      arm-linux-gnueabihf-g++-10 $@
      ===/usr/local/bin/gcc-10-arm===
      #!/bin/bash
      arm-linux-gnueabihf-gcc-10 $@

      and these files on Bela:

      ===/usr/local/bin/clang++-11-arm===
      #!/bin/bash
      clang++-11 $@ -stdlib=libstdc++
      ===/usr/local/bin/clang-11-arm===
      #!/bin/bash
      clang-11 $@
      ===/usr/local/bin/g++-10-arm===
      #!/bin/bash
      g++-10 $@
      ===/usr/local/bin/gcc-10-arm===
      #!/bin/bash
      gcc-10 $@
      ===/usr/local/bin/distcc-clang===
      #!/bin/bash
      export DISTCC_HOSTS=192.168.7.1
      export DISTCC_VERBOSE=0
      export DISTCC_FALLBACK=0
      export DISTCC_BACKOFF_PERIOD=0
      distcc clang-11-arm $@
      ===/usr/local/bin/distcc-clang++===
      #!/bin/bash
      export DISTCC_HOSTS=192.168.7.1
      export DISTCC_VERBOSE=0
      export DISTCC_FALLBACK=0
      export DISTCC_BACKOFF_PERIOD=0
      distcc clang++-11-arm $@
      ===/usr/local/bin/distcc-g++===
      #!/bin/bash
      export DISTCC_HOSTS=192.168.7.1
      export DISTCC_VERBOSE=0
      export DISTCC_FALLBACK=0
      export DISTCC_BACKOFF_PERIOD=0
      distcc g++-10-arm $@
      ===/usr/local/bin/distcc-gcc===
      #!/bin/bash
      export DISTCC_HOSTS=192.168.7.1
      export DISTCC_VERBOSE=0
      export DISTCC_FALLBACK=0
      export DISTCC_BACKOFF_PERIOD=0
      distcc gcc-10-arm $@

      (each of the files has gone through sudo chmod 777 FILENAME ).
      On the host I start the daemon with:

      distccd --verbose --daemon --allow 192.168.7.2 --log-level debug --log-file ~/.distcc/distccd.log --enable-tcp-insecure

      and tail the log as usual.

      I can then successfully build from Bela using any of distcc-clang, distcc-clang++, distcc-gcc, distcc-g++

      I also got that working on macos for clang:

       ======= /usr/local/bin/clang++-11-arm ========
      #!/bin/bash
      /usr/local/bin/clang-11/bin/clang++ -nostdinc -target armv7l-unknown-linux-gnueabihf --sysroot ~/arm $@
       ======= /usr/local/bin/clang-11-arm ========
      #!/bin/bash
      /usr/local/bin/clang-11/bin/clang-11 -nostdinc -target armv7l-unknown-linux-gnueabihf --sysroot ~/arm $@

      (note that the --sysroot ~/arm thing is not necessary)

      • jarm replied to this.

        Thanks! Just catching up, will try again this week

        3 months later
        a month later

        jarm Hiya, did you manage to try this out yet? It would be awesome to have Flucoma working on Bela

        • jarm replied to this.
          7 days later

          markh sadly not yet!

          They are also releasing builds frequently so perhaps the builds I have are already out of date.

          Hopefully I'll have time over the summer... I encourage anyone to beat me to it!

          a month later