[CMake] Cross compile for ADSP SHARC using the CrossCore toolchain
Merikan Koyun
merikankoyun at gmail.com
Thu Nov 19 04:30:57 EST 2015
Hi,
I am trying extend my CMake toolchain of a C project, to be able to
cross compile for an Analog Devices SHARC DSP, specifically the SC589,
which is a fairly new model.
This C project is split up into several modules, which should each be
build as a separate library.
I saw that people seem to have successfully cross compile with CMake
using the
CMakeADSP toolchain as described in the CMake wiki. This uses the
VisualDSP++ suite from Analog Devices.
However, Analog Devices have released a new IDE/toolchain for developing
on DSPs, which is called
CrossCore Embedded Studio. And that is where I am struggling to make it
work.
What I did was getting the Generic-ADSP-Common.cmake and the
Generic-ADSP-C.cmake files. I modified them
to fit the new folder structure of CrossCore, which is slightly
different to the VisualDSP++ one. So it can find
the correct DSP specific libraries etc.
Then I wrote a toolchain file adsp.cmake:
SET( CMAKE_SYSTEM_NAME ADSP-C )
SET( CMAKE_MAKE_PROGRAM "C:/Analog\ Devices/CrossCore\ Embedded\
Studio\ 2.1.0/make.exe" )
SET( CMAKE_GENERATOR "Unix Makefiles")
SET( ADSP_PROCESSOR "ADSP-SC589" )
SET( ADSP_PROCESSOR_SILICIUM_REVISION "none" )
# specify the cross compiler
SET( CMAKE_C_COMPILER "C:/Analog\ Devices/CrossCore\ Embedded
Studio\ 2.1.0/cc21k.exe" )
SET( CMAKE_CXX_COMPILER "C:/Analog\ Devices/CrossCore\ Embedded
Studio\ 2.1.0/cc21k.exe" )
SET( CMAKE_CXX_COMPILER_ARG1 "-c++" CACHE STRING "First argument" )
SET( CMAKE_ASM_COMPILER "C:/Analog\ Devices/CrossCore\ Embedded\
Studio\ 2.1.0/easm21k.exe" )
SET( CMAKE_LINKER "C:/Analog\ Devices/CrossCore\ Embedded\ Studio\
2.1.0/linker.exe" )
I am not sure, if this is actually even close to being correct. But it
seems from the CMake build output, it actually does something remotely
useful...
Then I invoke CMake via
cmake -DCMAKE_TOOLCHAIN_FILE=../adsp.cmake -G "Unix Makefiles" ..
This is when I get a bunch of errors(see the bottom of the mail). From
the errors, it seems that it wants to link against some 160_hdr.doj. I
looked into the directory
in which all the libraries reside for my DSP and could not find it. Then
I looked for libraries of the older DSPsand found out that only the ADSP
21160 requires this library.
So I assume thatsomehow I could not manage to create a correct
toolchain, because it still searches for the libraries of an older model?
Did anyone manage to cross compile using the new CrossCore toolchain and
can give some info or can anyone elaborate on some steps I am quite
possibly missing here?
Or will it not be possible to use the new ADSP CrossCore toolchain
without performing in depth changes to the CMake code?
Thanks a lot in advance,
Merikan
CMakeError.log:
The C compiler identification could not be found in
"C:/Users/mym/cproj/bin/CMakeFiles/3.3.0-rc2/CompilerIdC/CMakeCCompilerId.dxe"
The C compiler identification could not be found in
"C:/Users/mym/cproj/bin/CMakeFiles/3.3.0-rc2/CompilerIdC/CMakeCCompilerId.doj"
The C compiler identification could not be found in
"C:/Users/mym/cproj/bin/CMakeFiles/3.3.0-rc2/CompilerIdC/CMakeCCompilerId.dxe"
Checking whether the C compiler is IAR using "" did not match
"IAR .+ Compiler":
cc3101: fatal error: No source files specified
The CXX compiler identification could not be found in
"C:/Users/mym/cproj/bin/CMakeFiles/3.3.0-rc2/CompilerIdCXX/CMakeCXXCompilerId.dxe"
The CXX compiler identification could not be found in
"C:/Users/mym/cproj/bin/CMakeFiles/3.3.0-rc2/CompilerIdCXX/CMakeCXXCompilerId.doj"
Checking whether the CXX compiler is IAR using "" did not match
"IAR .+ Compiler":
cc3101: fatal error: No source files specified
Determining if the C compiler works failed with the following
output:
Change Dir: C:/Users/mym/cproj/bin/CMakeFiles/CMakeTmp
Run Build Command:"c:/ANALOG~1/CROSSC~1.0/make.exe"
"cmTC_5c20e/fast"
c:/ANALOG~1/CROSSC~1.0/make.exe -f
CMakeFiles/cmTC_5c20e.dir/build.make CMakeFiles/cmTC_5c20e.dir/build
make.exe[1]: Entering directory
`C:/Users/mym/cproj/bin/CMakeFiles/CMakeTmp'
[0mBuilding C object
CMakeFiles/cmTC_5c20e.dir/testCCompiler.c.doj[0m
"C:/Analog Devices/CrossCore Embedded Studio 2.1.0/cc21k.exe"
-o CMakeFiles/cmTC_5c20e.dir/testCCompiler.c.doj -c
C:/Users/mym/cproj/bin/CMakeFiles/CMakeTmp/testCCompiler.c
[0mLinking C executable cmTC_5c20e.dxe[0m
"C:/Analog Devices/CrossCore Embedded Studio 2.1.0/cc21k.exe"
"CMakeFiles/cmTC_5c20e.dir/testCCompiler.c.doj" -o
cmTC_5c20e.dxe -L"C:/Analog Devices/CrossCore Embedded Studio
2.1.0/SHARC/lib/sc589_rev_none"
[Error li1021] The following symbols referenced in processor
'p0' could not be resolved:
'_dispatcher_CB15I [__dispatcher_CB15I]' referenced
from '160_hdr.doj'
'_dispatcher_CB7I [__dispatcher_CB7I]' referenced from
'160_hdr.doj'
'_dispatcher_EP0I [__dispatcher_EP0I]' referenced from
'160_hdr.doj'
'_dispatcher_EP1I [__dispatcher_EP1I]' referenced from
'160_hdr.doj'
'_dispatcher_EP2I [__dispatcher_EP2I]' referenced from
'160_hdr.doj'
'_dispatcher_EP3I [__dispatcher_EP3I]' referenced from
'160_hdr.doj'
'_dispatcher_FIXI [__dispatcher_FIXI]' referenced from
'160_hdr.doj'
'_dispatcher_FLTII [__dispatcher_FLTII]' referenced
from '160_hdr.doj'
'_dispatcher_FLTOI [__dispatcher_FLTOI]' referenced
from '160_hdr.doj'
'_dispatcher_FLTUI [__dispatcher_FLTUI]' referenced
from '160_hdr.doj'
'_dispatcher_IICDI [__dispatcher_IICDI]' referenced
from '160_hdr.doj'
'_dispatcher_IRQ0I [__dispatcher_IRQ0I]' referenced
from '160_hdr.doj'
'_dispatcher_IRQ1I [__dispatcher_IRQ1I]' referenced
from '160_hdr.doj'
'_dispatcher_IRQ2I [__dispatcher_IRQ2I]' referenced
from '160_hdr.doj'
'_dispatcher_LP0I [__dispatcher_LP0I]' referenced from
'160_hdr.doj'
'_dispatcher_LP1I [__dispatcher_LP1I]' referenced from
'160_hdr.doj'
'_dispatcher_LP2I [__dispatcher_LP2I]' referenced from
'160_hdr.doj'
'_dispatcher_LP3I [__dispatcher_LP3I]' referenced from
'160_hdr.doj'
'_dispatcher_LP4I [__dispatcher_LP4I]' referenced from
'160_hdr.doj'
'_dispatcher_LP5I [__dispatcher_LP5I]' referenced from
'160_hdr.doj'
'_dispatcher_LSRQI [__dispatcher_LSRQI]' referenced
from '160_hdr.doj'
'_dispatcher_SFT0I [__dispatcher_SFT0I]' referenced
from '160_hdr.doj'
'_dispatcher_SFT1I [__dispatcher_SFT1I]' referenced
from '160_hdr.doj'
'_dispatcher_SFT2I [__dispatcher_SFT2I]' referenced
from '160_hdr.doj'
'_dispatcher_SFT3I [__dispatcher_SFT3I]' referenced
from '160_hdr.doj'
'_dispatcher_SOVFI [__dispatcher_SOVFI]' referenced
from '160_hdr.doj'
'_dispatcher_SPR0I [__dispatcher_SPR0I]' referenced
from '160_hdr.doj'
'_dispatcher_SPR1I [__dispatcher_SPR1I]' referenced
from '160_hdr.doj'
'_dispatcher_SPT0I [__dispatcher_SPT0I]' referenced
from '160_hdr.doj'
'_dispatcher_SPT1I [__dispatcher_SPT1I]' referenced
from '160_hdr.doj'
'_dispatcher_TMZHI [__dispatcher_TMZHI]' referenced
from '160_hdr.doj'
'_dispatcher_TMZLI [__dispatcher_TMZLI]' referenced
from '160_hdr.doj'
'_dispatcher_VIRPTI [__dispatcher_VIRPTI]' referenced
from '160_hdr.doj'
'adi_osal_Init [_adi_osal_Init]' referenced from
'160_hdr.doj'
Linker finished with 1 error
cc3089: fatal error: Link failed (code:1)
make.exe[1]: *** [cmTC_5c20e.dxe] Error 1
make.exe[1]: Leaving directory
`C:/Users/mym/cproj/bin/CMakeFiles/CMakeTmp'
make.exe: *** [cmTC_5c20e/fast] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151119/77af894f/attachment-0001.html>
More information about the CMake
mailing list