Forum Discussion

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

Build a shared library for DS5

I am trying to run the Armadillo Linear Algebra package on my Cyclone V.

I get it to work with general Linux GCC

Invoking: GCC C++ Compiler
g++ -I/usr/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Armadillo_Test.d" -MT"src/Armadillo_Test.d" -o "src/Armadillo_Test.o" "../src/Armadillo_Test.cpp"
Finished building: ../src/Armadillo_Test.cpp
 
Building target: Armadillo_Test
Invoking: GCC C++ Linker
g++ -L/usr/lib64 -o "Armadillo_Test"  ./src/Armadillo_Test.o   -lm  -larmadillo  -llapack  -lblas  -larpack
Finished building target: Armadillo_Test

Then I try to build for DS5 and the cyclone board

Invoking: GCC C++ Compiler
arm-linux-gnueabihf-g++ -I/usr/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Armadillo_Test.d" -MT"src/Armadillo_Test.d" -o "src/Armadillo_Test.o" "../src/Armadillo_Test.cpp"
Finished building: ../src/Armadillo_Test.cpp
 
Building target: Armadillo_Test
Invoking: GCC C++ Linker
arm-linux-gnueabihf-g++ -L/usr/lib64 -o "Armadillo_Test"  ./src/Armadillo_Test.o   -lm  -larmadillo  -llapack  -lblas  -larpack
/usr/lib64/libarmadillo.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

Any ideas what I could try?

2 Replies

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

    That error indicates that GCC can't find one of the files it needs to do compiling. It isn't related to the library you are trying to build. You will find that you can't compile anything.

    I've seen that error before when environment variables GCC needs weren't set correctly. Unfortunately, I don't know how to fix this for Yocto. Is there a script you need to run to set it up?