cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
213 Views
Registered: ‎06-01-2020

Libmetal build error "error: 'METAL_MUTEX_INIT' undeclared"

I am trying to compile libemtal_v1_4. But facing problem while it tried to build tests. The build is able to generate libmetal.a and libmetal.so

[ 42%] Building C object test/CMakeFiles/test-metal-static.dir/system/linux/mutex.c.o
/opt/libmetal_v1_4/src/libmetal/test/system/linux/mutex.c: In function 'mutex':
/opt/libmetal_v1_4/src/libmetal/test/system/linux/mutex.c:56:23: error: 'METAL_MUTEX_INIT' undeclared (first use in this function); did you mean 'METAL_LOG_INFO'?
  metal_mutex_t lock = METAL_MUTEX_INIT;
                       ^~~~~~~~~~~~~~~~
                       METAL_LOG_INFO
/opt/libmetal_v1_4/src/libmetal/test/system/linux/mutex.c:56:23: note: each undeclared identifier is reported only once for each function it appears in
test/CMakeFiles/test-metal-static.dir/build.make:110: recipe for target 'test/CMakeFiles/test-metal-static.dir/system/linux/mutex.c.o' failed
make[2]: *** [test/CMakeFiles/test-metal-static.dir/system/linux/mutex.c.o] Error 

 Please help me solve the above issue.

Thank you for support.

0 Kudos
2 Replies
Highlighted
Moderator
Moderator
162 Views
Registered: ‎05-10-2017

Re: Libmetal build error "error: 'METAL_MUTEX_INIT' undeclared"

How are you building the libraries? In SDK/Vitis? Can you please provide the steps

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
130 Views
Registered: ‎06-01-2020

Re: Libmetal build error "error: 'METAL_MUTEX_INIT' undeclared"

I am building libmetal without using petalinux. I have taken libmetal which is availble in ultra96v2_oob_2018_3

1] I have created aarch64 sysroot it contains libmetal dependencies

2] Below is my toolchain.cmake file

3] command used to build : cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/toolchain.cmake

set (CMAKE_SYSTEM_PROCESSOR "aarch64" CACHE STRING "")
set (CROSS_PREFIX "aarch64-linux-gnu-" CACHE STRING "")
set(CMAKE_FIND_ROOT_PATH /home/ubuntu/aarch64/arm64-ubuntu)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

include (cross-linux-gcc)

# vim: expandtab:ts=2:sw=2:smartindent

0 Kudos