Skip to content

Commit ce3c417

Browse files
authored
Merge pull request #17 from jcarpent/devel
Fix packaging issues and add more packaging test
2 parents df1930c + 896bcff commit ce3c417

File tree

14 files changed

+131
-93
lines changed

14 files changed

+131
-93
lines changed

.github/workflows/ci-linux-osx-with-conda.yml renamed to .github/workflows/ci-linux-osx-win-conda.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,15 @@ jobs:
120120
# g++ -std=c++17 examples/cpp/overview-simple.cpp -o overview-simple $(pkg-config --cflags proxsuite)
121121
# ./overview-simple
122122

123-
# - name: Test CMake pacakging [Conda]
124-
# shell: bash -l {0}
125-
# run: |
126-
# cd build
127-
# g++ -std=c++17 examples/cpp/overview-simple.cpp -o overview-simple $(pkg-config --cflags proxsuite)
128-
# ./overview-simple
123+
- name: Test CMake pacakging [Conda/Linux&macOS]
124+
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
125+
shell: bash -l {0}
126+
run: |
127+
cd test/packaging/cmake
128+
mkdir build && cd build
129+
cmake .. -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
130+
cmake --build . --config ${{ matrix.build_type }} --target all
131+
./run-proxqp
129132
130133
- name: Uninstall [Conda]
131134
shell: bash -l {0}

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,20 @@ set(SIMDE_HINT_FAILURE
9191
"Set BUILD_WITH_VECTORIZATION_SUPPORT=OFF or install Simde on your system.\n If Simde is already installed, ensure that the CMake variable CMAKE_MODULE_PATH correctly points toward the location of FindSimde.cmake file."
9292
)
9393
if(BUILD_WITH_VECTORIZATION_SUPPORT)
94-
add_project_dependency(Simde REQUIRED)
94+
add_project_dependency(Simde REQUIRED FIND_EXTERNAL "Simde")
9595
endif()
9696

9797
# Build the main library
9898
file(GLOB_RECURSE ${PROJECT_NAME}_HEADERS ${PROJECT_SOURCE_DIR}/include/*.hpp)
9999

100-
add_library(proxsuite INTERFACE ${${PROJECT_NAME}_HEADERS})
100+
add_library(proxsuite INTERFACE)
101101
target_link_libraries(
102102
proxsuite
103103
PUBLIC
104104
INTERFACE Eigen3::Eigen)
105+
target_include_directories(
106+
proxsuite INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
107+
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
105108
set(EXPORTED_TARGETS_LIST proxsuite)
106109

107110
add_header_group(${PROJECT_NAME}_HEADERS)
@@ -133,9 +136,6 @@ endif()
133136
install(
134137
TARGETS ${EXPORTED_TARGETS_LIST}
135138
EXPORT ${TARGETS_EXPORT_NAME}
136-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}
137-
INCLUDES
138-
DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}
139139
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
140140
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
141141
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})

bindings/python/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ function(CREATE_PYTHON_TARGET target_name COMPILE_OPTIONS dependencies)
5858
"\$ORIGIN/../../..")
5959
endif()
6060

61-
install(
62-
TARGETS ${target_name}
63-
EXPORT ${TARGETS_EXPORT_NAME}
64-
DESTINATION ${${PYWRAP}_INSTALL_DIR})
61+
install(TARGETS ${target_name} DESTINATION ${${PYWRAP}_INSTALL_DIR})
6562
endfunction()
6663

6764
create_python_target(proxsuite_pywrap "" proxsuite-not-vectorized)

cmake-external/FindSimde.cmake

Lines changed: 0 additions & 26 deletions
This file was deleted.

include/proxsuite/proxqp/utils/random_qp_problems.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,6 @@ sparse_matrix_rand_not_compressed(isize nrows, isize ncols, Scalar p)
330330
return A;
331331
}
332332

333-
LDLT_EXPLICIT_TPL_DECL(2, matrix_rand<f32>);
334-
LDLT_EXPLICIT_TPL_DECL(1, vector_rand<f32>);
335-
LDLT_EXPLICIT_TPL_DECL(2, positive_definite_rand<f32>);
336-
LDLT_EXPLICIT_TPL_DECL(1, orthonormal_rand<f32>);
337-
LDLT_EXPLICIT_TPL_DECL(3, sparse_matrix_rand<f32>);
338-
LDLT_EXPLICIT_TPL_DECL(3, sparse_positive_definite_rand<f32>);
339-
340-
LDLT_EXPLICIT_TPL_DECL(2, matrix_rand<f64>);
341-
LDLT_EXPLICIT_TPL_DECL(1, vector_rand<f64>);
342-
LDLT_EXPLICIT_TPL_DECL(2, positive_definite_rand<f64>);
343-
LDLT_EXPLICIT_TPL_DECL(1, orthonormal_rand<f64>);
344-
LDLT_EXPLICIT_TPL_DECL(3, sparse_matrix_rand<f64>);
345-
LDLT_EXPLICIT_TPL_DECL(3, sparse_positive_definite_rand<f64>);
346333
} // namespace rand
347334
using proxqp::usize;
348335

test/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ add_library(cnpy OBJECT src/cnpy.cpp)
77
target_link_libraries(cnpy Eigen3::Eigen)
88
target_include_directories(cnpy PUBLIC ./include)
99

10-
add_library(proxsuite-test-util STATIC ./src/util_f64.cpp ./src/util_f32.cpp)
10+
file(GLOB_RECURSE TEST_HEADERS ./include/*.hpp)
11+
add_header_group(TEST_HEADERS)
12+
13+
add_library(proxsuite-test-util STATIC ./src/util_f64.cpp ./src/util_f32.cpp
14+
${TEST_HEADERS})
1115
target_include_directories(proxsuite-test-util PUBLIC ./include)
1216
if(BUILD_WITH_VECTORIZATION_SUPPORT)
1317
target_link_libraries(proxsuite-test-util proxsuite-vectorized matio)

test/include/util_f32.hpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#pragma once
2+
3+
#include <proxsuite/proxqp/utils/random_qp_problems.hpp>
4+
5+
namespace proxsuite {
6+
namespace proxqp {
7+
namespace utils {
8+
9+
namespace eigen {
10+
LDLT_EXPLICIT_TPL_DECL(2, llt_compute<Mat<f32, colmajor>>);
11+
LDLT_EXPLICIT_TPL_DECL(2, ldlt_compute<Mat<f32, colmajor>>);
12+
LDLT_EXPLICIT_TPL_DECL(2, llt_compute<Mat<f32, rowmajor>>);
13+
LDLT_EXPLICIT_TPL_DECL(2, ldlt_compute<Mat<f32, rowmajor>>);
14+
} // namespace eigen
15+
namespace rand {
16+
LDLT_EXPLICIT_TPL_DECL(2, matrix_rand<f32>);
17+
LDLT_EXPLICIT_TPL_DECL(1, vector_rand<f32>);
18+
LDLT_EXPLICIT_TPL_DECL(2, positive_definite_rand<f32>);
19+
LDLT_EXPLICIT_TPL_DECL(1, orthonormal_rand<f32>);
20+
LDLT_EXPLICIT_TPL_DECL(3, sparse_matrix_rand<f32>);
21+
LDLT_EXPLICIT_TPL_DECL(3, sparse_positive_definite_rand<f32>);
22+
} // namespace rand
23+
24+
LDLT_EXPLICIT_TPL_DECL(2, matmul_impl<long double>);
25+
LDLT_EXPLICIT_TPL_DECL(1, mat_cast<proxqp::f32, long double>);
26+
27+
} // namespace utils
28+
} // namespace proxqp
29+
} // namespace proxsuite

test/include/util_f64.hpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#pragma once
2+
3+
#include <proxsuite/proxqp/utils/random_qp_problems.hpp>
4+
5+
namespace proxsuite {
6+
namespace proxqp {
7+
namespace utils {
8+
9+
namespace eigen {
10+
LDLT_EXPLICIT_TPL_DECL(2, llt_compute<Mat<f64, colmajor>>);
11+
LDLT_EXPLICIT_TPL_DECL(2, ldlt_compute<Mat<f64, colmajor>>);
12+
LDLT_EXPLICIT_TPL_DECL(2, llt_compute<Mat<f64, rowmajor>>);
13+
LDLT_EXPLICIT_TPL_DECL(2, ldlt_compute<Mat<f64, rowmajor>>);
14+
} // namespace eigen
15+
16+
namespace rand {
17+
LDLT_EXPLICIT_TPL_DECL(2, matrix_rand<f64>);
18+
LDLT_EXPLICIT_TPL_DECL(1, vector_rand<f64>);
19+
LDLT_EXPLICIT_TPL_DECL(2, positive_definite_rand<f64>);
20+
LDLT_EXPLICIT_TPL_DECL(1, orthonormal_rand<f64>);
21+
LDLT_EXPLICIT_TPL_DECL(3, sparse_matrix_rand<f64>);
22+
LDLT_EXPLICIT_TPL_DECL(3, sparse_positive_definite_rand<f64>);
23+
} // namespace rand
24+
25+
LDLT_EXPLICIT_TPL_DECL(1, mat_cast<f64, long double>);
26+
27+
} // namespace utils
28+
} // namespace proxqp
29+
} // namespace proxsuite

test/include/utils.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#pragma once
2+
3+
#include "util_f32.hpp"
4+
#include "util_f64.hpp"

0 commit comments

Comments
 (0)