Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: "Command not found" in ubuntu 12.4 LTS

  1. #1
    Join Date
    Oct 2013
    Beans
    13

    "Command not found" in ubuntu 12.4 LTS

    I have been using a cross compiler to develop machine code for a raspberry pi computer. The system works on Windows 7 but when I use the "make" command on the ubuntu system I get the following code
    jeff@lap-jeff:~/template$ make
    arm-none-eabi-as -I source/ source/display.s -o build/display.o
    make: arm-none-eabi-as: Command not found
    make: *** [build/display.o] Error 127
    I have added folder of the command to PATH$
    jeff@lap-jeff:~$ echo $PATH
    /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/jeff/arm-2008q3/bin
    And the command utility is in the directory
    jeff@lap-jeff:~$ ls arm-2008q3/bin
    arm-none-eabi-addr2line arm-none-eabi-gcc-4.3.2 arm-none-eabi-objdump
    arm-none-eabi-ar arm-none-eabi-gcov arm-none-eabi-ranlib
    arm-none-eabi-as arm-none-eabi-gdb arm-none-eabi-readelf
    arm-none-eabi-c++ arm-none-eabi-gdbtui arm-none-eabi-run
    arm-none-eabi-c++filt arm-none-eabi-gprof arm-none-eabi-size
    arm-none-eabi-cpp arm-none-eabi-ld arm-none-eabi-sprite
    arm-none-eabi-g++ arm-none-eabi-nm arm-none-eabi-strings
    arm-none-eabi-gcc arm-none-eabi-objcopy arm-none-eabi-strip
    I think that the command originates from the makefile
    In the line below "# Rule to make the object files."

    Text of Makefile:
    Code:
    ###############################################################################
    #       makefile
    #        by Alex Chadwick
    #
    #       A makefile script for generation of raspberry pi kernel images.
    ###############################################################################
    
    # The toolchain to use. arm-none-eabi works, but there does exist
    # arm-bcm2708-linux-gnueabi.
    ARMGNU ?= arm-none-eabi
    #ARMGNU ?= arm-bcm2708-linux-gnueabi
    
    # The intermediate directory for compiled object files.
    BUILD = build/
    
    # The directory in which source files are stored.
    SOURCE = source/
    
    # The name of the output file to generate.
    TARGET = kernel.img
    
    # The name of the assembler listing file to generate.
    LIST = kernel.list
    
    # The name of the map file to generate.
    MAP = kernel.map
    
    # The name of the linker script to use.
    LINKER = kernel.ld
    
    # The names of libraries to use.
    LIBRARIES := csud
    
    # The names of all object files that must be generated. Deduced from the
    # assembly code files in source.
    OBJECTS := $(patsubst $(SOURCE)%.s,$(BUILD)%.o,$(wildcard $(SOURCE)*.s))
    
    # Rule to make everything.
    all: $(TARGET) $(LIST)
    
    # Rule to remake everything. Does not include clean.
    rebuild: all
    
    # Rule to make the listing file.
    $(LIST) : $(BUILD)output.elf
            $(ARMGNU)-objdump -d $(BUILD)output.elf > $(LIST)
    
    # Rule to make the image file.
    $(TARGET) : $(BUILD)output.elf
            $(ARMGNU)-objcopy $(BUILD)output.elf -O binary $(TARGET)
    
    # Rule to make the elf file.
    $(BUILD)output.elf : $(OBJECTS) $(LINKER)
            $(ARMGNU)-ld --no-undefined $(OBJECTS) -L. $(patsubst %,-l %,$(LIBRARIES)) -Map $(MAP) -o $(BUILD)output.elf -T $(LINKER)
    
    # Rule to make everything.
    all: $(TARGET) $(LIST)
    
    # Rule to remake everything. Does not include clean.
    rebuild: all
    
    # Rule to make the listing file.
    $(LIST) : $(BUILD)output.elf
            $(ARMGNU)-objdump -d $(BUILD)output.elf > $(LIST)
    
    # Rule to make the image file.
    $(TARGET) : $(BUILD)output.elf
            $(ARMGNU)-objcopy $(BUILD)output.elf -O binary $(TARGET)
    
    # Rule to make the elf file.
    $(BUILD)output.elf : $(OBJECTS) $(LINKER)
            $(ARMGNU)-ld --no-undefined $(OBJECTS) -L. $(patsubst %,-l %,$(LIBRARIES)) -Map $(MAP) -o $(BUILD)output.elf -T $(LINKER)
    
    # Rule to make the object files.
    $(BUILD)%.o: $(SOURCE)%.s
            $(ARMGNU)-as -I $(SOURCE) $< -o $@
    
    # Rule to clean files.
    clean :
            -rm -f $(BUILD)*.o
            -rm -f $(BUILD)output.elf
            -rm -f $(TARGET)
            -rm -f $(LIST)
            -rm -f $(MAP)

    I'm fairly new to this environment (Linux) and would apreciate any help.

    All the best
    Jeff
    Last edited by oldos2er; October 23rd, 2013 at 05:20 PM. Reason: No code Inserts *Changed quote tags to code tags

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    15,437
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: "Command not found" in ubuntu 12.4 LTS

    arm-none-eabi-as is what? A command or something else?

    Adding a directory to a path is probably NOT what you want, especially if the command isn't inside it. Did you install the package which contains that command?

    When posting makefiles, please wrap it in "code" tags ... see the "Adv Reply". Please edit the 1st post and fix that.
    Inside a makefile, tabs matter. Spaces and tabs have different meanings, so be very careful which editor settings you have.

    You can put the full path to the command inside the makefile. That is a best practice, BTW.

    I suspect better help may occur from the rPi forums.

    I did a quick google and there seems to be many issues around the toolchain for rpi. Lots of solutions on reputable websites.
    Last edited by TheFu; October 23rd, 2013 at 04:07 PM.

  3. #3
    Join Date
    Oct 2013
    Beans
    13

    Re: "Command not found" in ubuntu 12.4 LTS

    @TheFu

    Thanks for your reply. As far as I understand arm-none-eabi-as is a command as it is the same colour (green) as the commands in /bin.

    I did not write the makefile.

    I have posted this on the RasPi forums and not had a solution, and thought it may be one that is related to the operating system.

    I'll have a look at googling my problem

    All the best
    Jeff

  4. #4
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!

    Re: "Command not found" in ubuntu 12.4 LTS

    I do not do any compiling and installing apps using source code etc etc, but I do know that for many of those activities it is necessary to install the build-essential package.
    Could this be part of your problem?
    Last edited by ajgreeny; October 23rd, 2013 at 05:05 PM.
    DISTRO: Xubuntu 18.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo --- Wireless-Info --- SolvedThreads

  5. #5
    Join Date
    Oct 2013
    Beans
    13

    Re: "Command not found" in ubuntu 12.4 LTS

    @ajgreeny

    Thanks - I installed build-essential the package, but it has made no difference -- Will I need to re-install the toolchain package?

    All the best
    Jeff

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    15,437
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: "Command not found" in ubuntu 12.4 LTS

    Quote Originally Posted by jeffhaddow View Post
    @TheFu

    Thanks for your reply. As far as I understand arm-none-eabi-as is a command as it is the same colour (green) as the commands in /bin.

    I did not write the makefile.

    I have posted this on the RasPi forums and not had a solution, and thought it may be one that is related to the operating system.

    I'll have a look at googling my problem
    Do you think it is a file permissions issue? If so, run a chmod a+x on the file. The output of an ls -al in the directory would be helpful. Learn about chmod - man chmod will explain.

    Just suggesting that you edit the makefile/Makefile (case sensitvie) with the full path to the program it needs to run. Just put /home/jeff/arm-2008q3/bin/ in front of it. There might be other changes needed to get the correct libraries linked too.

    Your understanding is just a little too lite today. We've all been there and that will be handled with a little more time and practice.
    Keep plugging away.

  7. #7
    Join Date
    Apr 2012
    Beans
    7,257

    Re: "Command not found" in ubuntu 12.4 LTS

    "Command not found" can sometimes mean a dynamically linked library (or libraries) required by the command is not found, I think - try

    Code:
    ldd ~/arm-2008q3/bin/arm-none-eabi-as

  8. #8
    Join Date
    Oct 2013
    Beans
    13

    Re: "Command not found" in ubuntu 12.4 LTS

    @steeldriver

    I tried this and get the result

    code:
    jeff@lap-jeff:~$ ldd /home/jeff/arm-2008q3/bin/arm-none-eabi-as
    not a dynamic executable
    All the best
    Jeff

  9. #9
    Join Date
    Oct 2013
    Beans
    13

    Re: "Command not found" in ubuntu 12.4 LTS

    Hello TheFu

    The executepermissions do not seem to be the problem:

    Code
    Code:
    jeff@lap-jeff:~/arm-2008q3/bin$ ls -al
    total 15124
    drwxr-xr-x 2 jeff jeff    4096 Nov 13  2008 .
    drwxrwxr-x 8 jeff jeff    4096 Oct 15 19:22 ..
    -rwxr-xr-x 1 jeff jeff  480456 Nov 13  2008 arm-none-eabi-addr2line
    -rwxr-xr-x 2 jeff jeff  502544 Nov 13  2008 arm-none-eabi-ar
    -rwxr-xr-x 2 jeff jeff  862264 Nov 13  2008 arm-none-eabi-as
    -rwxr-xr-x 2 jeff jeff  192648 Nov 13  2008 arm-none-eabi-c++
    -rwxr-xr-x 1 jeff jeff  479448 Nov 13  2008 arm-none-eabi-c++filt
    -rwxr-xr-x 1 jeff jeff  191208 Nov 13  2008 arm-none-eabi-cpp
    -rwxr-xr-x 2 jeff jeff  192648 Nov 13  2008 arm-none-eabi-g++
    -rwxr-xr-x 2 jeff jeff  189800 Nov 13  2008 arm-none-eabi-gcc
    -rwxr-xr-x 2 jeff jeff  189800 Nov 13  2008 arm-none-eabi-gcc-4.3.2
    -rwxr-xr-x 1 jeff jeff   23132 Nov 13  2008 arm-none-eabi-gcov
    -rwxr-xr-x 1 jeff jeff 2806612 Nov 13  2008 arm-none-eabi-gdb
    -rwxr-xr-x 1 jeff jeff 2806612 Nov 13  2008 arm-none-eabi-gdbtui
    -rwxr-xr-x 1 jeff jeff  540508 Nov 13  2008 arm-none-eabi-gprof
    -rwxr-xr-x 2 jeff jeff  744140 Nov 13  2008 arm-none-eabi-ld
    -rwxr-xr-x 2 jeff jeff  490408 Nov 13  2008 arm-none-eabi-nm
    -rwxr-xr-x 2 jeff jeff  627680 Nov 13  2008 arm-none-eabi-objcopy
    -rwxr-xr-x 2 jeff jeff  753176 Nov 13  2008 arm-none-eabi-objdump
    -rwxr-xr-x 2 jeff jeff  502544 Nov 13  2008 arm-none-eabi-ranlib
    -rwxr-xr-x 1 jeff jeff  250408 Nov 13  2008 arm-none-eabi-readelf
    -rwxr-xr-x 1 jeff jeff  705112 Nov 13  2008 arm-none-eabi-run
    -rwxr-xr-x 1 jeff jeff  482268 Nov 13  2008 arm-none-eabi-size
    -rwxr-xr-x 1 jeff jeff  302584 Nov 13  2008 arm-none-eabi-sprite
    -rwxr-xr-x 1 jeff jeff  481736 Nov 13  2008 arm-none-eabi-strings
    -rwxr-xr-x 2 jeff jeff  627680 Nov 13  2008 arm-none-eabi-strip
    I edited the makefile to add the absolute address of the tokens and It now gives the same error but more verbose!!

    Code:
    jeff@lap-jeff:~/template$ make
    /home/jeff/arm-2008q3/bin/arm-none-eabi-as -I /home/jeff/template/source/ /home/jeff/template/source/display.s -o /home/jeff/template/build/display.o
    make: /home/jeff/arm-2008q3/bin/arm-none-eabi-as: Command not found
    make: *** [/home/jeff/template/build/display.o] Error 127
    Quote Originally Posted by TheFu View Post
    Do you think it is a file permissions issue? If so, run a chmod a+x on the file. The output of an ls -al in the directory would be helpful. Learn about chmod - man chmod will explain.

    Just suggesting that you edit the makefile/Makefile (case sensitvie) with the full path to the program it needs to run. Just put /home/jeff/arm-2008q3/bin/ in front of it. There might be other changes needed to get the correct libraries linked too.

    Your understanding is just a little too lite today. We've all been there and that will be handled with a little more time and practice.
    Keep plugging away.

  10. #10
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,047
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: "Command not found" in ubuntu 12.4 LTS

    I'm thinking that you have arm-executable files and that you have the wrong toolchain installed. It seems that these files are used for compiling on the ARM (RaspberryPi) itself, not in a Linux environment. The other possibility is that these are Windows executables and will only run in a Windows environment.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •