mbed-cli does not find ARM compiler in linux (with ARM_PATH defined)

Created on 20 Jun 2016  路  27Comments  路  Source: ARMmbed/mbed-cli

Trying to compile with ARM compiler -- Getting this kind of failure:

Building project mbed-client-testapp (K64F, ARM)
ERROR: run_cmd: Command 'C:/Program Files/ARM/bin/armcc' can't be found
ERROR: run_cmd: Command 'C:/Program Files/ARM/bin/armcc' can't be found

I have specified as per README:

Product: ARM Compiler 5.06
Component: ARM Compiler 5.06 update 1 (build 61)
Tool: armcc [4d35ad]
teetak01@machine:~/dev/mbed-client-testapp (bootstrap)$ which armcc
/home/teetak01/ARM_Compiler_5.06u1/bin/armcc
teetak01@machine:~/dev/mbed-client-testapp (bootstrap)$ env | grep ARM_PATH
GCC_ARM_PATH=/usr/bin/arm-none-eabi-gcc
ARM_PATH=/home/teetak01/ARM_Compiler_5.06u1
Command-line code management tool for ARM mbed OS - http://www.mbed.com
version 0.7.3
build system enhancement

All 27 comments

Currently mbed CLI and the build tools do not take into account the GCC and ARM environment variables. Of course these could be extended.

this propably related to this one: https://github.com/ARMmbed/mbed-os/issues/125 . but because latest mbed-os uses tools from mbedmicro/mbed correction probably belong to mbedmicro/mbed repository...

but still I think this is more like a bug than enhancement because its normal way to use env paths for this kind of cases.. hardcoded paths causes allmost always an problems...

@teetak01 have you completed the following step from the README https://github.com/ARMmbed/mbed-cli#toolchain-selection ?

@screamerbg I did not initially do the first part, bacause I presumed that specifying an en enviromental variable would override any hard-coded definitions. It should be globally configurable parameters, instead of repository-specific place. Currently I have to edit a file manually for each repo to get the ARM_PATH working correctly.

@screamerbg The current implementation also stays in infinite loop printing the ERROR.

@screamerbg tested with mbed cli 0.7.13, both issues still remain. Not sure was either supposed to be fixed.

PR filed at https://github.com/mbedmicro/mbed/pull/2005 that enables the functionality in mbed OS tools

When the above PR is accepted and the mbed OS is updated one can do

mbed config --global ARM_PATH "C:\Program Files\ARM"

Also per program config is supported for when specific version of ARMCC, GCC or IAR is need, e.g.

mbed config ARM_PATH "C:\Program Files\ARM"           # local/current program config

why it doesn't use existing environment variables:
ARMROOT=/usr/local/ARM_Compiler_5
GCC_ARM_PATH=...
PATH=...iar/
it's quite pointless to create new environment variables if there is already... also I think there is no need to mbed specific command to set these environment variables, instead users could use just normal way, like set -command..

It was discussed that toolchain related environment variables should be separate and should use the MBED_ prefix.
cc @bridadan @sg-

@jupe mbed-cli isn't necessary to set these variables, it's just a contained way within the mbed command. You can still use set or export to set the MBED_* variables and the tools will pick that up.

so is it founding compilers via these default variables if I dont configure anything manually?

By "default variables" do you mean finding the compilers that have been added to the system PATH variable? Currently only GCC_ARM is found in this way, but we are planning to extend this to IAR and ARM toolchains in the future.

yes, with system PATH, but there is also those couple other variables which is set during toolchain installation. I think that was the original issue, so it seems that problem is not solved yet...

Thanks for clairfying @jupe. I just looked to see if any of those variables are set on my system (I have all of the toolchains installed on my Windows machine)

$ echo %ARMROOT%
%ARMROOT%

$ echo %GCC_ARM_PATH%
%GCC_ARM_PATH%

The two variables you mentioned above aren't set on my machine.

From the ARMROOT variable link you posted above, it looks like those variables aren't actually set by the toolchain, but they are _read_ by the toolchain if they are set to extend functionality. Here's the relevant bit from that link from which I'm drawing this conclusion:

ARM Compiler toolchain does not require environment variables to be set. However, there are situations where you might want to set environment variables. For example, if you want to specify additional command-line options for armcc, but you do not want to modify your build scripts, then you can specify the options using ARMCCnn_CCOPT.

The environment variables used by the toolchain are[...SNIP...]

Any progress on this? I now installed a new environment and armcc there. mbed-cli does not respect the environmental variables:
export ARM_PATH="/home/teetak01/ARM_Compiler_5.06u3/"

It also does not follow the mbed_settings.py file in my root-folder for the project. Instead it is reading the ARMCC path from mbed-os/tools/settings.py, which by default is pointing to some windows-folder ARM_PATH = "C:/Keil_v5/ARM/ARMCC".

I had to manually change the path here to my installed path and of course changing it there will destroy it when ever mbed-os folder is updated.

mbed-cli version is 0.9.1

this should be very easy to fix so when we get it?

This is covered in the toolchain selection in the mbed CLI manual https://github.com/ARMmbed/mbed-cli/blob/master/README.md#toolchain-selection

Thanks, missed those updates.

I'm not very satisfied with this solution -> not very good user experience if every user have to run some mbed-cli commands before using compiler. Why mbed-cli couldn't detect those environment variables instead?

@jupe There is a PR up now that adds this capability I believe, as well as improved errors when your toolchain is not found: https://github.com/ARMmbed/mbed-os/pull/2418

Sorry to bring this old thread back up but I'm having the same problem with an mbed-cli installed last week:

make.py: error: Could not find executable for ARM.
Currently set search path: /home/matthieu/ARM_Compiler_5.06u6/bin

armcc is there, and seems functional*. I have also edited the mbed_settings.py with ARM_PATH = /home/matthieu/ARM_Compiler_5.06u6/bin but the message still shows up...

It works well with GCC_ARM though (but the compiler is giving me memory troubles).

*: I don't have a licence file for the armcc. It might be a problem later on, but I still don't understand the Could not find executable part.

@matthieu-labas which version of Mbed OS are you using?

@matthieu-labas Set your ARM_PATH to /home/matthieu/ARM_Compiler_5.06u6.

@theotherjimmy you're right, the bin was wrong. I don't remember where I read we had to add it...
@bridadan MbedOS 5.11.4 with mbed CLI 1.9.0 (in case it makes a difference).

Sorry for bothering on such an rtfm question!

Was this page helpful?
0 / 5 - 0 ratings