Hey everyone,
I have a similar problem while trying to cross-compile acados for DS1401 and i can’t find the fault. The Installation of acados worked without any problems and I was able to solve acados optimization problems in Matlab as well using the S-Function in Simulink.
Can someone please help me? I am almost in dispair…
First, I adapted the Toolchain-dSpaceDS1401 cmake-file as follows:
SET(CMAKE_SYSTEM_NAME "dSpaceDS1401")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
SET(CMAKE_SYSTEM_PROCESSOR "ppc")
# TODO: cmake_path instead?
# cmake_path(CONVERT "C:\\ProgramData\\dSPACE\\AD52223F-E7EC-4A16-97FB-8ADC3C426EE0\\Compiler\\PPCTools" TO_CMAKE_PATH_LIST DSPACE_DS1401_COMPILER_DIR NORMALIZE)
#
file(TO_CMAKE_PATH "C:/ProgramData/dSPACE/7290F786-B6F7-4BA3-9178-C21B0382F310" DSPACE_TOOLS)
set(DSPACE_RTLIB "C:/Program Files/dSPACE RCPHIL 2021-A/DS1401/RTLib")
set(DSPACE_PPCTOOLS "${DSPACE_TOOLS}/Compiler/PPCTools")
# C Compiler
find_program(CMAKE_C_COMPILER NAMES ${DSPACE_PPCTOOLS}/bin/mccppc.exe)
# C++ Compiler -- not used
find_program(CMAKE_CXX_COMPILER NAMES ${DSPACE_PPCTOOLS}/bin/mccppc.exe)
# Assembler
find_program(CMAKE_ASM_COMPILER NAMES ${DSPACE_PPCTOOLS}/bin/asmppc.exe)
set(CMAKE_RANLIB ":")
find_program(CMAKE_MAKE_PROGRAM NAMES "C:/Program Files/dSPACE RCPHIL 2021-A/Exe/DSMAKE.EXE")
SET(CMAKE_FIND_ROOT_PATH ${DSPACE_PPCTOOLS})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
add_definitions(-D__MABX2__ -D__DSPACE__)
# Compiler flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -H -J{DSPACE_RTLIB}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -H -J{DSPACE_RTLIB}")
set(CMAKE_C_FLAGS "-Ot -Oi -Or -Ox -D_INLINE" CACHE STRING "" FORCE)
# acados flags
set(BLASFEO_TARGET "GENERIC" CACHE STRING "BLASFEO Target architecture")
set(HPIPM_TARGET "GENERIC" CACHE STRING "HPIPM Target architecture")
set(BUILD_SHARED_LIBS OFF CACHE STRING "Build shared libraries")
set(BLASFEO_EXAMPLES OFF CACHE BOOL "Examples disabled")
set(EXT_DEP OFF CACHE BOOL "Compile external dependencies in BLASFEO")
set(ACADOS_INSTALL_DIR "install" CACHE PATH "Installation path to ACADOS_INSTALL_DIR")
# import from platform folder
set(CMAKE_IMPORT_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SHARED_MODULE_PREFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_EXECUTABLE_SUFFIX ".exe")
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".lib")
set(CMAKE_SHARED_MODULE_SUFFIX ".lib")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
# set(CMAKE_C_FLAGS "\"-J${DSPACE_RTLIB}\"")
set(CMAKE_INCLUDE_FLAG_C "-J")
set(CMAKE_INCLUDE_FLAG_CXX "-J")
# add_definitions(-D__MABX2__)
remove_definitions(-DLINUX)
remove_definitions(-DOS_WINDOWS)
remove_definitions(-D__LINUX__)
After running the cmake command
cmake -D CMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-dSpaceDS1401.cmake -G "Unix Makefiles" -S ../ -B ./
I get the following output - I think it’s the same which hy_lyy got :
-- 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:/ProgramData/dSPACE/7290F786-B6F7-4BA3-9178-C21B0382F310/Compiler/PPCTools/bin/mccppc.exe - skipped
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/ProgramData/dSPACE/7290F786-B6F7-4BA3-9178-C21B0382F310/Compiler/PPCTools/bin/mccppc.exe - skipped
-- Build type is Release
-- ACADOS_WITH_OPENMP: OFF
CMake Deprecation Warning at external/blasfeo/CMakeLists.txt:36 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The ASM compiler identification is unknown
-- Found assembler: C:/ProgramData/dSPACE/7290F786-B6F7-4BA3-9178-C21B0382F310/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
CMake Deprecation Warning at external/hpipm/CMakeLists.txt:36 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- 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: .../acados/buildDS1401
I don’t know if this is really an error, as I don’t know how this output should look like. But for me it seems like the compiler cannot be found or is incompatible. But the path to the PPCTools compiler is definitely correct.
However, when I run the next command from the Embedded Workflow instructions, I receive the following error:
PS ...\acados\buildDS1401> cmake --build ./
Scanning dependencies of target blasfeo
[ 1%] Building C object external/blasfeo/CMakeFiles/blasfeo.dir/auxiliary/blasfeo_processor_features.c.obj
[ 1%] Building C object external/blasfeo/CMakeFiles/blasfeo.dir/auxiliary/blasfeo_stdlib.c.obj
(E) C0513; "...\acados\external\blasfeo\auxiliary\blasfeo_stdlib.c", line 59 pos 7; a value of type "int" cannot be assigned to an entity of type "void *"
*ptr = _aligned_malloc( size, CACHE_LINE_SIZE );
^
1 Error 2 Informationals (2 suppressed)
OPUS MAKE: Shell line exit status 1. Stop.
OPUS MAKE: Shell line exit status 3. Stop.
OPUS MAKE: Shell line exit status 3. Stop.
So if any of you did have the same errors and solved them or can tell me more about the errors, please help me. I would be very thankful!
Thanks in advance,
Jasper