orbit icon indicating copy to clipboard operation
orbit copied to clipboard

./bootstrap-orbit.sh fails if gcc isn't available on path with version suffix

Open SoftwareApe opened this issue 4 years ago • 1 comments

E.g. installing in nix-shell you have gcc version 10, but not gcc-10 or g++-10 available.

I'm trying to install in nix-shell, because the installer doesn't accept the Ubuntu 18.04. cmake version (3.10.2), see #2133

However the installer seems to expect these suffixed versions:

&: cmake_installer/3.16.3@conan/stable
[env]
CC=gcc-10
CFLAGS=-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fsized-deallocation -D_FORTIFY_SOURCE=2 -fstack-protector-all
CXX=g++-10

Then later

CMake Error at /nix/store/52ixz29sl0ln24s8y3s6579cfqnfkf9z-cmake-3.19.6/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:49 (message):
  Could not find compiler set in environment variable CC:

  gcc-10.

even when you do

alias gcc-10=gcc
alias g++-10=g++

SoftwareApe avatar Mar 25 '21 13:03 SoftwareApe

After quite a lot of trial and error I was able to make it work with the following shell.nix which contains the other dependencies I needed:

{ pkgs ? import <nixpkgs> {} }:
  pkgs.mkShell {
    # nativeBuildInputs is usually what you want -- tools you need to run
    nativeBuildInputs = [
        pkgs.buildPackages.cmake
        pkgs.buildPackages.clang_9
        pkgs.buildPackages.gcc10
        pkgs.buildPackages.libGL
        pkgs.buildPackages.libGLU
        pkgs.buildPackages.x11
        pkgs.buildPackages.icu
        pkgs.buildPackages.libxml2
        pkgs.buildPackages.qt5.full
    ];
    shellHook = ''
        export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib:$LD_LIBRARY_PATH"
        ln --force -s $(which gcc) ~/.local/bin/gcc-10
        ln --force -s $(which g++) ~/.local/bin/g++-10
    '';
}

I now create symlinks that are on my path.

Note that I still needed to remove the -Werror=all option for this to build, as mentioned in #2135 .

SoftwareApe avatar Mar 25 '21 16:03 SoftwareApe