Altera_Forum
Honored Contributor
8 years agolibaltera_s5_ref_mmd.so: file not recognized: File format not recognized
Hi there,
I am getting an error when trying to build the host application for emulation. All the flow (under a Linux Mint 18, essentially Ubuntu 16.04) works fine and I am able to run the kernels in the board with no issue. Also, the emulation kernel is created without any issue, but when building the host application, linking fails. It seems the format of the file libaltera_s5_ref_mmd.so is not recognized ?¿ . I have tried to extract the file from the RTE package downloaded from the webpage (both for my quartus version and previous, including the update, and the version before the update in july, just in case it hadn't changed) and tried with it, but same error. It is very weird. Has anyone experienced something similar?/home/rusa/tools/intelFPGA/17.0/hld/board/s5_ref/linux64/lib/libaltera_s5_ref_mmd.so: file not recognized: File format not recognizedcollect2: error: ld returned 1 exit status
Makefile:74: recipe for target 'bin/host' failed
make: *** Error 1 All the set-up is apparently fine. I am using OpenCL SDK version 17.0 and I am able to run the application on the DE1SoC board. Intel(R) FPGA SDK for OpenCL(TM), 64-Bit Offline CompilerVersion 17.0.2 Build 602
Copyright (C) 2017 Intel Corporation
The init script I use for emulation is as follows. It is exactly the same as the one I use for building real kernels for the DE1SoC board but pointing to a non-SoC board (s5_ref as available per the standard SDK installation) as instructed by Intel in page 38 of https://www.altera.com/en_us/pdfs/literature/hb/opencl-sdk/aocl_c5soc_getting_started.pdf, and as already tried in a tutorial I followed in a conference, targeting version 16.1 (if I remind correctly the version): export ALTERAOCLSDKROOT=/home/rusa/tools/intelFPGA/17.0/hldexport QSYS_ROOTDIR=/home/rusa/tools/intelFPGA/17.0/quartus/sopc_builder/bin
export QUARTUS_ROOTDIR=/home/rusa/tools/intelFPGA/17.0/quartus
# path to the installation directory of the Quartus Prime software that supports your device
export QUARTUS_ROOTDIR_OVERRIDE=/home/rusa/tools/intelFPGA/17.0/quartus
# set board dir -> SETS A STANDARD NON-SoC BOARD NEEDED FOR EMULATION
export AOCL_BOARD_PACKAGE_ROOT=$ALTERAOCLSDKROOT/board/s5_ref
# license config
export LM_LICENSE_FILE=$HOME/tools/1-FW77S7_License.dat
#
#
# #####
# update PATH variable
# #####
# add the path to the cross-compiler for ARM devices
export PATH=/home/rusa/tools/intelFPGA/17.0/embedded/ds-5/bin:/home/rusa/tools/intelFPGA/17.0/embedded/ds-5/sw/gcc/bin:$PATH
# add the path to the SDK bin directory of the software installation
export PATH=$ALTERAOCLSDKROOT/bin:$PATH
# utility? (estaba en la version 16.0 del tutorial, revisar Terasic)
export PATH=$ALTERAOCLSDKROOT/linux64/bin:$PATH
# path to the directory with the quartus executable
export PATH=$QUARTUS_ROOTDIR/bin:$PATH
#
#
# #####
# update LD_LIBRARY_PATH
# #####
# add the path to the SDK host runtime libraries (for emulation in PC in case of SoC-based boards)
export LD_LIBRARY_PATH=$ALTERAOCLSDKROOT/host/linux64/lib:$LD_LIBRARY_PATH
# add the path to the board libraries (for working with SoC-based boards, it is used to set the path to a non-SoC board, needed for emulation)
export LD_LIBRARY_PATH=$AOCL_BOARD_PACKAGE_ROOT/linux64/lib:$LD_LIBRARY_PATH
# ?¿ utility ?¿ PROBABLY OLD (estaba en la version 16.0 del tutorial, revisar Terasic)
export LD_LIBRARY_PATH=$ALTERAOCLSDKROOT/linux64/lib:$LD_LIBRARY_PATH
# ##
# source the Altera OpenCL environment
# ##
source $ALTERAOCLSDKROOT/init_opencl.sh
After sourcing, everything seems fine: rusa@emma ~/dev/IntelFPGA/OpenCL/examples/hello_world $ source /home/rusa/tools/intelFPGA/init_soc_emulation.sh ALTERAOCLSDKROOT is set to /home/rusa/tools/intelFPGA/17.0/hld. Using that.
Will use $QUARTUS_ROOTDIR_OVERRIDE= /home/rusa/tools/intelFPGA/17.0/quartus to find Quartus
AOCL_BOARD_PACKAGE_ROOT is set to /home/rusa/tools/intelFPGA/17.0/hld/board/s5_ref. Using that.
Adding /home/rusa/tools/intelFPGA/17.0/hld/bin to PATH
Adding /home/rusa/tools/intelFPGA/17.0/hld/host/linux64/lib to LD_LIBRARY_PATH
Adding /home/rusa/tools/intelFPGA/17.0/hld/board/s5_ref/linux64/lib to LD_LIBRARY_PATH
rusa@emma ~/dev/IntelFPGA/OpenCL/examples/hello_world $ aoc --list-boardsBoard list:
s5_ref