#54 Cannot set toolchain path

Version 1.x

Hello there, I need a help to compile a C++ project over ARM I inherited from former colleague. These are my very steps into programming, and even if I found your site extremely well done, I still encounter some problems.

First of all, I'm working on a Ubuntu machine 14.04 (automatically upgraded from 13.10, where the problem started at first) on VirtualBox running on Windows7 64bit.

This is my version of Eclipse:
Eclipse IDE for C/C++ Developers
Version: Kepler Service Release 2
Build id: 20140224-0627

Installed software:
Eclipse IDE for C/C++ Developers epp.package.cpp null
GNU ARM C/C++ Cross Compiler Support ilg.gnuarmeclipse.managedbuild.cross.feature.group Liviu Ionescu
GNU ARM C/C++ Development Support (End of life) org.eclipse.cdt.cross.arm.gnu.feature.group SourceForge Project
GNU ARM C/C++ Freescale Project Templates ilg.gnuarmeclipse.templates.freescale.feature.group Liviu Ionescu
GNU ARM C/C++ Generic Cortex-M Project Template ilg.gnuarmeclipse.templates.cortexm.feature.group Liviu Ionescu
GNU ARM C/C++ STM32Fx Project Templates ilg.gnuarmeclipse.templates.stm.feature.group Liviu Ionescu
GNU ARM J-Link Debugging Support ilg.gnuarmeclipse.debug.gdbjtag.jlink.feature.group Liviu Ionescu
GNU ARM OpenOCD Debugging Support ilg.gnuarmeclipse.debug.gdbjtag.openocd.feature.group Liviu Ionescu

I installed - decompressing the tarball files - two different version of the Mentor CodeSourcery toolchain (because I have to work with a previous project, compiled with the 2010q1 version), in those two folders:

I did not set the Ubuntu PATH variable via .bashrc file, so I just did it using the GUI provided in Eclipse. Here are the two results I have, when I try to put the path for the older toolchain either as eclipse variable or as project variable.

To verify that the toolchain path is correctly (which is not), I also followed the suggesiton to use this command in pre-build steps: ${cross_prefix}${cross_c}${cross_suffix} --version

Still I have typical error for wrong path even if I try different ways.

First case, path set in Eclipse Environment:
name PATH
value ${PATH}:/opt/CodeSourcery/Sourcery_G++_Lite/arm-2010q1/bin

Clean & Build Selected Configuration console output:
make pre-build main-build
Cannot run program "make": Unknown reason

Error: Program "make" not found in PATH

Second case, path set in Project Properties, toolchain settings (both global variable and per project as well - Eclipse Environment variable deleted):
name PATH
value /opt/CodeSourcery/Sourcery_G++_Lite/arm-2010q1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Clean & Build Selected Configuration console output:
Invoking: Cross ARM C++ Compiler
arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -O2 [etc. etc.]
make: [pre-build] Error 127 (ignored)
/bin/sh: 1: arm-none-eabi-g++: not found
make: *** [src/CounterCheck.o] Error 127

make pre-build main-build
Checking the compiler version
make: arm-none-eabi-gcc: Command not found
arm-none-eabi-gcc --version

I know for sure that this project has been compiled correctly on a native Ubuntu 10.04 machine, but I have to work on my own on a Windows machine. I tried also to svn revert the project several times, just to be sure that project has not been corrupted after gaming with variables.
Still, no luck... please, could you share your opining on what's going wrong?


  • Federico

    Federico - 2014-05-09

    A quick correction. The places where the toolchains are installed are:

    The subsequent /bin is of course the path for the compiler.

  • Liviu Ionescu (ilg)

    be sure you remove all environment PATH variable settings and allow only the plug-in to manage the path, otherwise you'll have problems.

    I suggest you experiment on a new, empty workspace, with freshly generated projects.

  • Federico

    Federico - 2014-05-12

    Thanks for the quick reply. I found an unwanted PATH variable setting in Ubuntu and I deleted it, I deleted the workspace to start again with an empty one, and reverted the project (unluckily I have to make the existing one working) and imported it again. Still the same error occurs, as before...
    Is there any verbose/debug option to help me in finding which "hidden" setting is misleading the compiler?

  • Liviu Ionescu (ilg)

    I'm afraid you are systematically doing something wrong. please follow the installation steps available from the documentation pages and install the recommended toolchain.

    once this one works properly, you can repeat the steps for code sourcery g++ lite.

    one important note, if running on 64-bit machines, install the required 32-bit libraries, otherwise the compiler cannot be executed.

    invoke the compiler manually as recommended, to be sure it properly starts, before trying to use it from Eclipse.

    Last edit: Liviu Ionescu (ilg) 2014-05-12
  • Federico

    Federico - 2014-05-15

    Thank you for the suggestions, it seems that toolchains are not functional. After decompressing the tarball for the reccomended toolchain (in same folder as the Codesourcesy ones), the direct invokation of the compiler gives negative response:

    Suggested toolchain, suggested verification command:
    root@federico-VirtualBox:/opt/gcc-arm-none-eabi-4_8-2014q1# arm-none-eabi-gcc --version
    The program 'arm-none-eabi-gcc' is currently not installed. You can install it by typing:
    apt-get install gcc-arm-none-eabi

    Previous toolchain, various commands:
    root@federico-VirtualBox:/opt/CodeSourcery/Sourcery_G++_Lite/arm-2010q1# arm-none-eabi-gcc --version
    The program 'arm-none-eabi-gcc' is currently not installed. You can install it by typing:
    apt-get install gcc-arm-none-eabi
    root@federico-VirtualBox:/opt/CodeSourcery/Sourcery_G++_Lite/arm-2010q1# arm-none-eabi-g++ -v
    The program 'arm-none-eabi-g++' is currently not installed. You can install it by typing:
    apt-get install gcc-arm-none-eabi
    root@federico-VirtualBox:/opt/CodeSourcery/Sourcery_G++_Lite/arm-2010q1# arm-none-linux-gnueabi-gcc -v
    arm-none-linux-gnueabi-gcc: command not found

    I discovered that this virtual machine had at first the Sourcery 2010q1 toolchain installed (when the compiler was invoked directly it worked due to Ubuntu environment settings automatically done) and then removed.
    When I started working on this machine I decompressed (no automatic installer used) the two Sourcery toolchains in different locations, but did not any direct verification of their funcitonality, going directly through Eclipse.
    Now that I deleted the Ubuntu enviroment setting, addedd the reccomended toolchain (just decopressing following the instructions), verified that lib32 are correctly installed (lib32bz2-1.0 found), the verification fails...
    Should I do the apt-get install gcc-arm-none-eabi? I'm afraid it will install beyond my control (settings PATH variables, unfriendly installation, difficulties to get rid of it path and so on) that I prefer to ask for some suggestion - even if I understand that is beyond your scope.

    Any suggestion would be really welcome though, since I cannot go further in using the GNU Eclpse ARM in this situation.

    Thanks again

  • Liviu Ionescu (ilg)

    You have a path problem. Please try the following:

    • remove ALL toolchain path references from any system or user profiles
    • as suggested in the documentation, start the compiler using the full path, for example

    $ /opt/gcc-arm-none-eabi-4_8-2014q1/bin/arm-none-eabi-gcc --version

    (mind the /bin part)

    If the compiler does not start properly, you might need to install 2 specific 32-bit libraries (see the toolchain README file for details); the fact that you have lib32bz2 installed is not an indication that all 32-bit libraries are available.

    After you check that the toolchain starts properly, Eclipse will also start it, assuming you provide the correct toolchain path (down to the last /bin part).

  • Federico

    Federico - 2014-05-15

    I did not have time to finish the suggested commands, but I can tell that both gcc and g++ check of the launchpad toolchain, using full path reference, are working but compiling gives me an error of "missing semaphore.h" (which should be already present in Linux environment). No further inbestigation of this. For Coudesourcery toolchains, gcc check is ok but not g++. It will take me some days to verify again all, including the lib32.

    Thanks you for the patience it takes, and regards

  • Liviu Ionescu (ilg)

    ok, good luck.

    I suggest we close this ticket since the reported problems are no longer due to the plug-ins.

  • Federico

    Federico - 2014-05-20

    I succeeded in compiling the project, here is what happened, maybe someone is interested.
    - No additional references to toolchain path was existing neither in.bashrc or profile
    - ia32-libs are not available for Ubuntu 13.10 and later, so I tried these (do not know if some can be skipped):
    sudo apt-get install libgtk2.0-0:i386 libxtst6:i386 gtk2-engines-murrine:i386 \lib32stdc++6 libxt6:i386 libdbus-glib-1-2:i386 libasound2:i386

    sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 libncurses5:i386

    sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

    After a lot of different combinations, it seems that setting Eclipse build environment variable (from Windows menu -> preferences) and then import the project solved the problem.
    Any trying to assign the correct toolchain after import (either via Eclipse variable or via project properties -> toolchain setting as gobal as well as local, for any toolchain available) did not have success (it could give error in not findinding the toolchain, not finding the make command, or not finding the semaphore.h file).
    An Eclipse error maybe?

    I noticed also a possible source of conflicts when, under project properties, build, environment, it's pressed Apply button even without any change just to check the values present. This will create another instance of the PATH variable. In fact, checking again the PATH value will un-grey the Delete button (and deleting will show the already existing variable) or will append another time the toolchain path to the variable value. Don't know which instance will overshadow the other or if they will conflict, because compilation was not working even after a correction.

    Thanks for your support

    Last edit: Federico 2014-05-20
  • Liviu Ionescu (ilg)

    ia32-libs are not available for Ubuntu 13.10 and later, so I tried these ...

    looks like you completely messed your environment. if you are using the recommended toolchain, the accompanying readme clearly states what 32 bit libraries are required. you install them, check if the compiler starts in a terminal, and if so, go to Eclipse. it just works.

    another instance of the PATH variable

    unless you know exactly what you are doing, please do not manually change the project environment PATH, since this might invalidate the automatic use of the toolchain path.

  • Federico

    Federico - 2014-05-22

    Well, when I followed the blog instructions for ia32-libs, Ubuntu suggested: lib32z1 lib32ncurses5 lib32bz2-1.0. And official toolchain is really vague in the README: "For 64 bit system, 32 bit libc and libncurses are required to run the tools."
    Which is not actually telling anything. So, was the problem due to 32 bit libraries?

  • Liviu Ionescu (ilg)

    So, was the problem due to 32 bit libraries?

    most probably

  • Liviu Ionescu (ilg)

    • status: open --> closed
    • assigned_to: Liviu Ionescu (ilg)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks