You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got OSQP-Eigen to build and solve when I build OSQP with its normal linear algebra library, but when I build OSQP with it's CUDA library instead, I get a compilation error for OSQP-Eigen.
Compilation Error:
/usr/bin/ld: CMakeFiles/main.dir/src/main.cpp.o: in function `bool OsqpEigen::SparseMatrixHelper::createOsqpSparseMatrix<Eigen::SparseMatrix<float, 0, int> >(Eigen::SparseCompressedBase<Eigen::SparseMatrix<float, 0, int> > const&, OSQPCscMatrix*&)':
/usr/local/include/OsqpEigen/SparseMatrixHelper.tpp:42: undefined reference to `csc_spalloc'
/usr/bin/ld: /usr/local/lib/libOsqpEigen.so.0.8.1: undefined reference to `csc_spfree'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/main.dir/build.make:99: main] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/main.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Dockerfile:
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
RUN apt-get update -y
RUN apt-get install -y cmake git
RUN apt-get install -y libeigen3-dev
RUN git clone https://github.com/osqp/osqp
RUN cd osqp && mkdir build
RUN cd osqp/build && cmake -G "Unix Makefiles" .. -DOSQP_ALGEBRA_BACKEND=cuda
# RUN cd osqp/build && cmake -G "Unix Makefiles" ..
# Does not fail when using above ^
RUN cd osqp/build && cmake --build . --target install
RUN git clone https://github.com/robotology/osqp-eigen
RUN cd osqp-eigen && mkdir build
RUN cd osqp-eigen/build && cmake ..
RUN cd osqp-eigen/build && make && make install
CMakeLists.txt:
cmake_minimum_required(VERSION 3.5)
project(my_project)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
find_package(OsqpEigen REQUIRED)
find_package(Eigen3)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
include_directories(include)
# Add the executable
add_executable(main src/main.cpp)
target_include_directories(main PUBLIC include)
target_link_libraries(main PUBLIC stdc++ stdc++fs m OsqpEigen::OsqpEigen)
The text was updated successfully, but these errors were encountered:
Thanks a lot for the issue. Just to understand, with the exact version of osqp (not some other version), just changing OSQP_ALGEBRA_BACKEND to builtin (or mkl, if you know how to install that) everything works?
Correct, using OSQP_ALGEBRA_BACKEND=builtin works (as well as using double types for my matrices), but cuda does not. The CUDA backend requires the use of floats instead of doubles.
I have not tried mkl.
I got OSQP-Eigen to build and solve when I build OSQP with its normal linear algebra library, but when I build OSQP with it's CUDA library instead, I get a compilation error for OSQP-Eigen.
Compilation Error:
Dockerfile:
CMakeLists.txt:
The text was updated successfully, but these errors were encountered: