1

By issuing make in terminal I can successfully build using cmake. However I cannot build from CLion, arm-none-eabi-gcc is not found.

In the CMakeLists.txt, I setup the tool chain like this:

set(CMAKE_C_COMPILER arm-none-eabi-gcc)

Running in terminal:

arm-none-eabi-gcc -v

outputs:

Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/home/flo/bin/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/lto-wrapper
Target: arm-none-eabi
Configured with: /tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/src/gcc/configure --target=arm-none-eabi --prefix=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-native --libexecdir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-native/lib --infodir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/install-native/arm-none-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-gmp=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-native/host-libs/usr --with-mpfr=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-native/host-libs/usr --with-mpc=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-native/host-libs/usr --with-isl=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-native/host-libs/usr --with-libelf=/tmp/jenkins/jenkins-GCC-7-build_toolchain_docker-775_20180622_1529687456/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for Arm Embedded Processors 7-2018-q2-update' --with-multilib-list=rmprofile
Thread model: single
gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 
Florian K
  • 92
  • 9
  • Does your terminal's $PATH match the path used by CLion? I'm guessing it is different. – Botje Aug 06 '19 at 07:42
  • @Botje it is in path:$PATH bash: /home/flo/.local/bin:/home/flo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:```/home/flo/bin/gcc-arm-none-eabi-7-2018-q2-update/bin```:/home/flo/bin/protoc/bin:/home/flo/.fzf/bin: No such file or directory – Florian K Aug 06 '19 at 08:03
  • But I was asking about CLion's $PATH, as that does not seem to find it. – Botje Aug 06 '19 at 08:05
  • 1
    Have you tried the advice in https://stackoverflow.com/questions/37662130/clion-or-cmake-does-not-see-environment-variable ? (use it to add that directory to CLion's PATH) – Botje Aug 06 '19 at 08:07
  • CLion is looking in the /build folder only – Florian K Aug 06 '19 at 08:07
  • @Botje Added variable ```CMAKE_C_COMPILER=/home/flo/bin/gcc-arm-none-eabi-7-2018-q2-update/bin``` to environment as suggested in the link you provided but still no luck – Florian K Aug 06 '19 at 08:33
  • 1
    You should add that directory to the PATH variable instead, as CMake and the subsequent compilation will need many more programs from that directory. – Botje Aug 06 '19 at 08:35

0 Answers0