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

Hi @gibor

were you able to solve this? I managed to compile it yesterday with some help of @FreyJo , feel free to bug me about this. I am happy to help.

Cheers,
Alex

I Alex !
Yesterday I finally managed to cross compile acados and then compile my s function for DS1401! :smiley: Soon I will start doing some banchmarking of its performance on the dspace!
Thanks for your time and we keep in touch! :slight_smile:

1 Like

Awesome, happy to hear!
Feel free to share results. :slight_smile:

Alex

Hi,@gibor @AlexWin @bmasterk

In the first step, I finished cross compiling and compile my s function for DS1401:
image

but when I download into the dspace by control desk,it cannot run in hardware:

image

I don’t know how to find the problem.

Thanks in advance for the patience.

Best regards
Gaofei

Hi Gaofei,
I still couldn’t upload the code into dspace/control desk. I will let you know if I have the same problem.
Giulio

Thanks. I hope you can run smoothly.

Hi gibor. It’s happy to hear your success. I meet the similar problem when cross-compile acados for dspace 1401. The versions are Matlab 2016b, dspace 2017 A, and cmake 3.23.1 respectively.
When I run the command " D:\acados_root_folder\buildDS1401> cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “MinGW Makefiles” -S …/ -B ./" in the powershell of windows, I get the similar error:
The C compiler identification is unknown
– The CXX compiler identification is unknown …(and so on)
When I run the command “D:\acados_root_folder\buildDS1401> cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “Unix Makefiles” -S …/ -B ./” in the powershell of windows, I get the following error:
CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
– Configuring incomplete, errors occurred!
Do you have any idea about this error? Thanks you in advance

Hi AlexWin. It’s happy to hear your success. I meet the some problem when cross-compile acados for dspace 1401. The versions are Matlab 2016b, dspace 2017 A, and cmake 3.23.1 respectively.
When I run the command " D:\acados_root_folder\buildDS1401> cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “MinGW Makefiles” -S …/ -B ./" in the powershell of windows, I get the similar error:
The C compiler identification is unknown
– The CXX compiler identification is unknown …(and so on)
When I run the command “D:\acados_root_folder\buildDS1401> cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “Unix Makefiles” -S …/ -B ./” in the powershell of windows, I get the following error:
CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
– Configuring incomplete, errors occurred!
Do you have any idea about this error? Thanks you in advance

Hi hanyu,

Did you adjust the compilers in the Toolchain file, like it is stated in the embedded workflow on the acados webpage?
You have to point to the right MABX power pc compilers. Please check all paths in the Toolchain file.
Let me know if you have made any progress!
There might be an actual problem with some kernel code of blasfeo with the latest acados release. But you definitely should be able to compile and buuikd the model.
If you encounter any errors when uploading to MABX, reset acados to a former release (September 2021) with "git reset --hard “commit sha” " commit sha is from the commit on the acados GitHub page. Then do a “git submodule Update” and redo the cross compilation.

Cheers, Alex

Thanks for your patience. I have checked the compiler in the Toolchain file as the stated in acados webpage. Then run the command:“D:\acados_root_folder\buildDS1401> cmake -D CMAKE_TOOLCHAIN_FILE=…/cmake/Toolchain-dSPACEDS1401.cmake -G “Unix Makefiles” -S …/ -B ./” in the windows powershell, I get the following message:


– The C compiler identification is unknown
– The CXX compiler identification is unknown
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/Program Files/dSPACE RCPHIL 2017-A/Compiler/PPCTools/bin/mccppc.exe - skipped
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/Program Files/dSPACE RCPHIL 2017-A/Compiler/PPCTools/bin/mccppc.exe - skipped
– Build type is Release
– ACADOS_WITH_OPENMP: OFF
– The ASM compiler identification is unknown
– Found assembler: C:/Program Files/dSPACE RCPHIL 2017-A/Compiler/PPCTools/bin/asmppc.exe
– Warning: Did not find file Compiler/-ASM
– Using linear algebra: HIGH_PERFORMANCE
– Using matrix format: PANELMAJ
– Using external BLAS: 0
– Testing target GENERIC: assembly compilation [success]
– Testing target GENERIC: intrinsic compilation [success]
– Compiling for target: GENERIC
– Using BLASFEO path:
– Installation directory: install

– Target: BLASFEO is GENERIC, HPIPM is GENERIC
– Linear algebra: HIGH_PERFORMANCE
– Matlab MEX (OFF)
– Octave MEX (OFF)
– Octave Templates (OFF)
– System name:version dSpaceDS1401:
– Build type is Release
– Installation directory is install
– OpenMP parallelization is OFF

– Configuring done
– Generating done
– Build files have been written to: D:/acados_root_folder/buildDS1401


I googled why the cmake shows " The C compiler identification is unknown", and get answers that I need to install Windows 10 SDK in my visual studio 2017. I have tried this solution, but it turns out not to help. And I can compile and build acados model in Matlab.
Thanks in advance for your kindness and patience!