Forum Discussion

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

error loading shared libraries: libaltera_s5_ref_mmd.so: cannot open shared obj

"Emulation Error : ./host: error while loading shared libraries: libaltera_s5_ref_mmd.so: cannot open shared object file: No such file or directory"

I am trying to emulate an openCL design implemented for Cyclone V SoC (Terasic board)

I have compiled hardware kernel.aocx in emulator mode : "aoc -march=emulator device/vector_add.cl -o bin/vector_add.aocx"

I have generated x86 executable for the host by make command for Make file : https://www.altera.com/support/support-resources/design-examples/design-software/opencl/vector-addition.html

but when i try to execute the host " CL_CONTEXT_EMULATOR_DEVICE_ALTERA=1 ./host" , the following error is seen , how to solve this ?

./host: error while loading shared libraries: libaltera_s5_ref_mmd.so: cannot open shared object file: no such file or directory"

FYI: the environment variables set are

export QUARTUS_ROOTDIR=/eda/altera/quartus_16.1_standard/quartus

export ALTERAOCLSDKROOT=/eda/intel/16.1/hld

export AOCL_BOARD_PACKAGE_ROOT=/eda/altera/quartus_16.1_standard/hld/board/terasic/de1soc# export LD_LIBRARY_PATH=/eda/intel/16.1/hld/board/s5_ref/linux64/lib

export LD_LIBRARY_PATH=/eda/altera/quartus_16.1_standard/hld/host/linux64/lib

2 Replies

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

    The missing library file is exactly in the path that you have commented out in your environmental variables (/eda/intel/16.1/hld/board/s5_ref/linux64/lib). Remove the# sign and close your terminal and open a new one to load the new settings. Also make sure the path is correct; some of your paths are pointing to "/altera/quartus_16.1_standard", while others are pointing to "/intel/16.1".

    Also your AOCL_BOARD_PACKAGE_ROOT is pointing to the Terasic BSP, while your LD_LIBRARY_PATH is pointing to Altera's reference S5 board. This is not correct; both should point to the same board. You should probably also add --board=XXXX to your aoc command line to make sure you are targeting the correct board for emulation.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks HRZ , i could eliminate the error with the information provided . It worked when both paths are assigned to LD_LIBRARY_PATH

    I modified the Environment paths as following

    export ALTERAOCLSDKROOT=/eda/intel/16.1/hld

    export AOCL_BOARD_PACKAGE_ROOT=$ALTERAOCLSDKROOT/board/s5_ref

    export LD_LIBRARY_PATH=$ALTERAOCLSDKROOT/host/linux64/lib:$AOCL_BOARD_PACKAGE_ROOT/linux64/lib