Compiling Companion from Source

Help with any software/desktop related issues. e.g. companion9x, eePe, etc
Post Reply
paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Compiling Companion from Source

Post by paulj »

Good morning!

I have been using OpenTX for a couple of years now, and on my Gentoo system I have been compiling from source (cloning the git repository). Last time I was home, I updated everything to 2.2 without any issues. This weekend past, I decided to do the same on my laptop and "away" transmitter (I work away from home, so have replicated equipment in two places!). This is where the fun begins.

The laptop in question is new, and therefore a fresh install (also running Gentoo). I went through the process of getting the repository, and installing all the dependencies. However, it is failing with a CMake error:

Code: Select all

- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Simulators library search path: /usr/local/lib/companion
CMake Error at CMakeLists.txt:99 (use_cxx11):
  Unknown CMake command "use_cxx11".

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as
Through google, I found a CMake macro which satisfies this command:

Code: Select all

macro(use_cxx11)
  if (CMAKE_VERSION VERSION_LESS "3.1")
    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
      set (CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")
    endif ()
  else ()
    set (CMAKE_CXX_STANDARD 11)
  endif ()
endmacro(use_cxx11)
Is there somewhere I should be storing this globally in order for cmake to successfully complete?

Also, in the CMakeLists.txt, there are some environment variables which are not set in my environment, and again don't get set before they are used:
  • COMPANION_SRC_DIRECTORY
  • SIMU_SRC_DIRECTORY

(to name a few).

This leads me to believe there is a requirement for a local configuration file of some sort?

I downgraded to 2.1, and this compiles without issue. I even start to doubt whether I was successful with 2.2 at home, but I am not back until next Tuesday to check what the situation is there.

I am using cmake 3.8.2, and up to date packages of the other dependencies etc (although I haven't got that far yet).

I would appreciate if someone could point out what I have missed!

Many thanks.

User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Compiling Companion from Source

Post by Kilrah »

You're probably running cmake in the wrong folder, it needs to be run in the root folder, NOT the companion subfolder like in 2.1.
paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: Compiling Companion from Source

Post by paulj »

Thanks Kilrah - that was indeed my error! I am now not clear how I managed to do it properly at home :roll:
paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: Compiling Companion from Source

Post by paulj »

One other question - which version of arm-none-eabi-g++ is recommended for 2.2? The latest download from Arm developer is gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2, but I can build a different version if necessary from scratch.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Compiling Companion from Source

Post by Kilrah »

We use gcc-arm-none-eabi-4_7-2013q3. Sure it's old, but it's got a 4-year reliability track record for our purposes so we're not in a hurry to change that.

There's a Dockerfile in the repo for the prod environment if you're into this.

paulj
Posts: 22
Joined: Sun Jun 29, 2014 8:20 am
Country: -

Re: Compiling Companion from Source

Post by paulj »

Thanks! I haven't played with Docker - perhaps I should have a look. 4_7 is in the gentoo tree, but hard masked, so local installation is probably more prudent.

I can understand there is no rush to move to newer versions!

Post Reply

Return to “Software”