Problem with cross-compiling of acados for DS1401

Hi

I’m using Matlab 2018B and my final goal is to create a S-function for a MicroAutobox II (DS1401). However from what I understand from the documentations I firstly need to cross compile acados for DS1401.
I have already follow this thread Updated workflow for DS1401 - MicroAutoBox-II by FreyJo · Pull Request #723 · acados/acados · GitHub and read the last document acados/index.md at master · acados/acados · GitHub here.
In particular, as it is written in the documentation, I skip the step " Define environment variables used within the toolchain file, currently only required for DS1202 " but when I try to execute the command :
cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “Unix Makefiles” -S …/ -B ./
it returns me the error:

– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:42 (project):
The CMAKE_C_COMPILER:

QNX_HOST-NOTFOUND/usr/bin/ntoppc-gcc.exe

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable “CC” or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:42 (project):
The CMAKE_CXX_COMPILER:

QNX_HOST-NOTFOUND/usr/bin/ntoppc-c++.exe

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

– Configuring incomplete, errors occurred!
See also “D:/Acados/acados/buildDS1401/CMakeFiles/CMakeOutput.log”.
See also “D:/Acados/acados/buildDS1401/CMakeFiles/CMakeError.log”.

Thanks you for the help,
Giulio

Hi Giulio,

I think something went wrong when using the pull request. It is necessary to use the code of the pull request. Your error log says something about “QNX_HOST…”. This ist part of the Toolchain file for the DS1202 (please compare the toolchain files for the DS1401 in the pull request and in the main acados path, they are different). If you want to get the pull request locally, you can use the following git commands:

  1. Clone Acados
    a. git clone https://github.com/acados/acados.git

  2. Get Updated workflow for DS1401 - MicroAutoBox-II by FreyJo · Pull Request #723 · acados/acados · GitHub locally (in Acados folder)
    a. git fetch origin pull/723/head:pr723
    b. git checkout pr723

Best regards
Björn

Hi Bjorn,
first of all thanks for the quick response.
Actually, I have already check the toolchain file (the one in my local computer - properly modified in the image below) and the one in the pull request that you suggest me.
However, when I lunch the commmand : cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “Unix Makefiles” -S …/ -B ./ , from the error returned in the shell, it seems that one CMakeList file tries to find the path defined for DS1202.
Have you any other suggestions?
Thanks you in advance,
GIulio

Hi Giulio,

I don’t know why this happens, but maybe you can just copy the correct code in the DS1202 toolchain file or delete this file to check if it is really this file beeing used.

Best regards
Björn

Hi Bjorn,
as always thanks you for the reply :slight_smile:
As you suggest me, removing the Toolchain file for the DS1202 I notice that it recalled that file. For that reason i deleted all the folder “buildDS1401” , launching the cmake command.
Now the error is the following:

D:\Acados\acados\buildDS1401>cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “Unix Makefiles” -S …/ -B ./
– The C compiler identification is unknown
– The CXX compiler identification is unknown
– Detecting C compiler ABI info
– Detecting C compiler ABI info - failed
– Check for working C compiler: C:/ProgramData/dSPACE/AD52223F-E7EC-4A16-97FB-8ADC3C426EE0/Compiler/PPCTools/bin/mccppc.exe
– Check for working C compiler: C:/ProgramData/dSPACE/AD52223F-E7EC-4A16-97FB-8ADC3C426EE0/Compiler/PPCTools/bin/mccppc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message):

  • The C compiler*

  • “C:/ProgramData/dSPACE/AD52223F-E7EC-4A16-97FB-8ADC3C426EE0/Compiler/PPCTools/bin/mccppc.exe”*

  • is not able to compile a simple test program.*

  • It fails with the following output:*

  • Change Dir: D:/Acados/acados/buildDS1401/CMakeFiles/CMakeTmp*

  • Run Build Command(s):D:/Programs/dSPACE RCPHIL 2018-B/Exe/DSMAKE.EXE -f Makefile cmTC_fa976/fast && ‘D:/Programs/dSPACE’ is not recognized as an internal or external command,*

  • operable program or batch file.*

  • OPUS MAKE: Shell line exit status 1. Stop.*

  • CMake will not be able to correctly generate this project.*
    Call Stack (most recent call first):

  • CMakeLists.txt:42 (project)*

– Configuring incomplete, errors occurred!
See also “D:/Acados/acados/buildDS1401/CMakeFiles/CMakeOutput.log”.
See also “D:/Acados/acados/buildDS1401/CMakeFiles/CMakeError.log”.

Of course I have already check that the file mccppc.exe exists, but i’m not very familiar with this type of problem. Any other suggestion ?
Thanks you (as always) in advance,
Giulio

Hi Giulio,

I did not have this error… I am not sure what you could try next, sorry.

If you make progress and get a new error, do not hesitate to ask again :slight_smile:

Best regards
Björn

Hi Bjorn,
I have a question for you: what version of Matlab & dSPACE are you using?
I really don’t understand from where the problem can came from.
Thanks in advance for the patience :slight_smile: :pray:
Giulio

Hi Giulio,

I use the following program versions:
MATLAB R2017b
dSpace 2018b
CMake 3.19.4

Best regards
Björn