Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
8 years ago

Running de1soc Vector_add example on de5-net

Hi, I was asked if I can run de1soc vector_add example on De5-net board. After I compile the Kernel when I type Make I get the following error :

arm-linux-gnueabihf-g++ host/src/main.cpp ../common/src/AOCL_Utils.cpp -o vector_add -I/opt/intelFPGA/16.1/hld/host/include -I../common/inc -L/opt/intelFPGA/16.1/hld/board/terasic/linux64/lib -L/opt/intelFPGA/16.1/hld/host/arm32/lib -Wl,--no-as-needed -lalteracl -lalterahalmmd -lterasic_apb_16_0_mmd -lelf -lstdc++

make: arm-linux-gnueabihf-g++: Command not found

Makefile:41: recipe for target 'all' failed

make: *** [all] Error 127

I would be thankful to get some help.

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you are trying to use the example shipped with the Terasic SoC board, it is obviously not going to work on DE5-Net since the latter is not an SoC board. The example will, by default, compile the host code for ARM, while for DE5-Net you should compile the host code for a standard x86/x64 CPU.

    Use the x64 version of the benchmark provided here:

    https://www.altera.com/support/support-resources/design-examples/design-software/opencl/vector-addition.html

    P.S. The error you are getting above is due to the necessary ARM cross-compiler not being available on your system. You should install the necessary packages if you want to cross-compile for ARM. You can easily find the package names by searching google for the missing file. Obviously, this is not needed if you are targeting the DE5-Net board.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    If you are trying to use the example shipped with the Terasic SoC board, it is obviously not going to work on DE5-Net since the latter is not an SoC board. The example will, by default, compile the host code for ARM, while for DE5-Net you should compile the host code for a standard x86/x64 CPU.

    Use the x64 version of the benchmark provided here:

    https://www.altera.com/support/support-resources/design-examples/design-software/opencl/vector-addition.html

    P.S. The error you are getting above is due to the necessary ARM cross-compiler not being available on your system. You should install the necessary packages if you want to cross-compile for ARM. You can easily find the package names by searching google for the missing file. Obviously, this is not needed if you are targeting the DE5-Net board.

    --- Quote End ---

    Thanks for your response. I have run DE5-Net test examples successfully on the Machine. But I was asked if it is possible to run de1soc test examples on DE5-Net. So based on your comments it is not possible. Is that correct?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thanks for your response. I have run DE5-Net test examples successfully on the Machine. But I was asked if it is possible to run de1soc test examples on DE5-Net. So based on your comments it is not possible. Is that correct?

    --- Quote End ---

    I think the test examples from DE1-SoC and DE5-Net are the same, just targeting different boards.

    You can modify the examples from DE1-SoC manually to target DE5-Net. You should modify the makefile so that the host compiler is changed from arm-linux-gnueabihf-g++ to g++, and the target board is de5net_a7 instead of whatever it is right now.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I think the test examples from DE1-SoC and DE5-Net are the same, just targeting different boards.

    You can modify the examples from DE1-SoC manually to target DE5-Net. You should modify the makefile so that the host compiler is changed from arm-linux-gnueabihf-g++ to g++, and the target board is de5net_a7 instead of whatever it is right now.

    --- Quote End ---

    # This is a GNU Makefile.^M

    # It can be used to compile an OpenCL program with^M

    # the Altera Beta OpenCL Development Kit

    # See README.txt for more information.^M

    # You must configure ALTERAOCLSDKROOT to point the root directory of the Altera SDK for OpenCL^M

    # software installation.

    # See doc/getting_started.txt for more information on installing and^M

    # configuring the Altera SDK for OpenCL.^M

    # Creating a static library^M

    TARGET = vector_add^M

    # Where is the Altera SDK for OpenCL software?^M

    ifeq ($(wildcard $(ALTERAOCLSDKROOT)),)^M

    $(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation)^M

    endif^M

    ifeq ($(wildcard $(ALTERAOCLSDKROOT)/host/include/CL/opencl.h),)^M

    $(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation.)^M

    endif^M

    # Libraries to use, objects to compile^M

    SRCS = main.cpp^M

    SRCS_FILES = $(foreach F, $(SRCS), host/src/$(F))^M

    COMMON_FILES = ../common/src/AOCL_Utils.cpp^M

    ^M

    # arm cross compiler^M

    CROSS-COMPILE = arm-linux-gnueabihf-^M

    ^M

    # OpenCL compile and link flags.^M

    AOCL_COMPILE_CONFIG=$(shell aocl compile-config --arm) -I../common/inc

    AOCL_LINK_CONFIG=$(shell aocl link-config --arm) ^M

    ^M

    ^M

    # Make it all!^M

    all : ^M

    $(CROSS-COMPILE)g++ $(SRCS_FILES) $(COMMON_FILES) -o $(TARGET) $(AOCL_COMPILE_CONFIG) $(AOCL_LINK_CONFIG)^M

    # Standard make targets^M

    clean :^M

    @rm -f *.o $(TARGET)^M

    I changed the red section to g++ but it is not working. Should I delete Cross_compile ( green ) part ?

    Thanks,
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Changing the red part alone should be enough to fix the target compiler. You should also remove the --arm switches from "AOCL_COMPILE_CONFIG" and "AOCL_LINK_CONFIG".