Cross compiling OSQP for DS1403

Hi,

I was successful with cross-compiling for cards with spouses, however, I failed with osqp with the following error:

[ 97%] Built target osqpstatic
[ 98%] Building C object external/osqp/CMakeFiles/osqp_demo.dir/examples/osqp_demo.c.obj
[ 98%] Linking C executable out/osqp_demo
c:/program files/dspace rcphil 2024-a/compiler/linux_4.14_gcc_10.3/target/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/10.3.0/../../../../arm-linux-gnueabihf/bin/ld.exe: out/libosqp.a(lib_handler.c.obj): in function `lh_load_lib':
lib_handler.c:(.text+0x10): undefined reference to `dlopen'
c:/program files/dspace rcphil 2024-a/compiler/linux_4.14_gcc_10.3/target/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/10.3.0/../../../../arm-linux-gnueabihf/bin/ld.exe: lib_handler.c:(.text+0x38): undefined reference to `dlerror'
c:/program files/dspace rcphil 2024-a/compiler/linux_4.14_gcc_10.3/target/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/10.3.0/../../../../arm-linux-gnueabihf/bin/ld.exe: out/libosqp.a(lib_handler.c.obj): in function `lh_unload_lib':
lib_handler.c:(.text+0xa8): undefined reference to `dlclose'
c:/program files/dspace rcphil 2024-a/compiler/linux_4.14_gcc_10.3/target/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/10.3.0/../../../../arm-linux-gnueabihf/bin/ld.exe: out/libosqp.a(lib_handler.c.obj): in function `lh_load_sym':
lib_handler.c:(.text+0x134): undefined reference to `dlsym'
c:/program files/dspace rcphil 2024-a/compiler/linux_4.14_gcc_10.3/target/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/10.3.0/../../../../arm-linux-gnueabihf/bin/ld.exe: lib_handler.c:(.text+0x13c): undefined reference to `dlerror'
c:/program files/dspace rcphil 2024-a/compiler/linux_4.14_gcc_10.3/target/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/10.3.0/../../../../arm-linux-gnueabihf/bin/ld.exe: lib_handler.c:(.text+0x1a8): undefined reference to `dlsym'
c:/program files/dspace rcphil 2024-a/compiler/linux_4.14_gcc_10.3/target/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/10.3.0/../../../../arm-linux-gnueabihf/bin/ld.exe: lib_handler.c:(.text+0x1b0): undefined reference to `dlerror'
collect2.exe: error: ld returned 1 exit status

OPUS MAKE: Shell line exit status 1. Stop.

OPUS MAKE: Shell line exit status 3. Stop.

OPUS MAKE: Shell line exit status 3. Stop.

Any idea how this can be fixed?

The undefined references being reported are used in the OSQP integration with the MKL Pardiso solver. When cross compiling, you won’t need MKL (or have it available). There is a CMake option in OSQP called ENABLE_MKL_PARDISO that you can set to off to disable this integration.

I believe you can just pass this on the standard ACADOS CMake command and OSQP will see it and disable the MKL integration.