Skip to content

Commit d9b4dea

Browse files
authored
Merge pull request #368 from jorisv/topic/fix-cl-build
Fix build with Cl and C++20
2 parents 293068e + a383d12 commit d9b4dea

File tree

4 files changed

+49
-54
lines changed

4 files changed

+49
-54
lines changed

.github/workflows/ci-linux-osx-win-conda.yml

Lines changed: 25 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ jobs:
2626
os: macos-latest
2727
- name: macos-14
2828
os: macos-14
29+
# proxsuite doesn't build with vs2019, so we use clang-cl instead
2930
- name: windows-2019-clang-cl
3031
os: windows-2019
3132
compiler: clang-cl
33+
# proxsuite should work with vs2022
3234
- name: windows-latest
3335
os: windows-latest
36+
compiler: cl
3437
- name: macos-latest
3538
os: macos-latest
3639
build_type: Debug
@@ -59,21 +62,17 @@ jobs:
5962

6063
- uses: conda-incubator/setup-miniconda@v3
6164
with:
62-
miniforge-version: latest
6365
activate-environment: proxsuite
64-
channels: conda-forge
65-
conda-remove-defaults: "true"
66+
environment-file: .github/workflows/conda/environment.yml
67+
auto-activate-base: false
68+
auto-update-conda: true
6669

67-
68-
- name: Install dependencies [Conda]
70+
- name: Install dependencies [Conda/Windows-latest]
71+
if: contains(matrix.os, 'windows-latest')
6972
shell: bash -l {0}
7073
run: |
71-
# Compilation related dependencies
72-
conda install cmake compilers make pkg-config doxygen ninja graphviz typing_extensions llvm-openmp clang
73-
# Main dependencies
74-
conda install eigen simde
75-
# Test dependencies
76-
conda install libmatio numpy scipy
74+
# Use VS2022 on Windows-latest
75+
conda install vs2022_win-64
7776
7877
- name: Install julia [Linux]
7978
if: contains(matrix.os, 'ubuntu')
@@ -95,7 +94,7 @@ jobs:
9594
env
9695
9796
- name: Configure [Conda/Linux&macOS]
98-
if: contains(matrix.os, 'macos-latest') || contains(matrix.os, 'ubuntu')
97+
if: contains(matrix.os, 'macos-') || contains(matrix.os, 'ubuntu')
9998
shell: bash -l {0}
10099
run: |
101100
echo $(whereis ccache)
@@ -105,18 +104,6 @@ jobs:
105104
cd build
106105
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON -DTEST_JULIA_INTERFACE:BOOL=OFF -DOpenMP_ROOT=$CONDA_PREFIX
107106
108-
- name: Configure [Conda/macOS14]
109-
if: contains(matrix.os, 'macos-14')
110-
shell: bash -l {0}
111-
run: |
112-
echo $(whereis ccache)
113-
echo $(which ccache)
114-
git submodule update --init
115-
mkdir build
116-
cd build
117-
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON -DTEST_JULIA_INTERFACE:BOOL=OFF -DOpenMP_ROOT=$CONDA_PREFIX
118-
119-
120107
- name: Configure [Conda/macOS-debug/CheckMalloc]
121108
if: contains(matrix.os, 'macos-latest') && contains(matrix.build_type, 'Debug')
122109
shell: bash -l {0}
@@ -126,44 +113,29 @@ jobs:
126113
cd build
127114
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCHECK_RUNTIME_MALLOC:BOOL=ON -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON -DTEST_JULIA_INTERFACE:BOOL=OFF -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DOpenMP_ROOT=$CONDA_PREFIX
128115
129-
- name: Configure [Conda/Windows-2019]
130-
if: contains(matrix.os, 'windows-2019')
131-
shell: bash -l {0}
116+
- name: Configure [Conda/Windows]
117+
if: contains(matrix.os, 'windows-')
118+
# It's better to use CMD to have all VS variables setup
119+
shell: cmd /C CALL {0}
132120
run: |
133-
echo $(where ccache)
134121
git submodule update --init
135122
mkdir build
136123
cd build
137-
export CXX=clang-cl
138-
export CC=clang-cl
139-
cmake .. -G"Ninja" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_SITELIB=${CONDA_PREFIX}/Lib/site-packages -DPYTHON_EXECUTABLE=${CONDA_PREFIX}/python.exe -DOpenMP_ROOT=$CONDA_PREFIX -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON
124+
set CC=${{ matrix.compiler }}
125+
set CXX=${{ matrix.compiler }}
126+
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_SITELIB=%CONDA_PREFIX%/Lib/site-packages -DPYTHON_EXECUTABLE=%CONDA_PREFIX%/python.exe -DOpenMP_ROOT=%CONDA_PREFIX% -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON
140127
141-
- name: Configure [Conda/Windows-latest]
142-
if: contains(matrix.os, 'windows-latest') && contains(matrix.cxx_std, '20')
128+
- name: Build [Conda/Linux&macOS]
129+
if: contains(matrix.os, 'macos-') || contains(matrix.os, 'ubuntu')
143130
shell: bash -l {0}
144131
run: |
145-
echo $(where ccache)
146-
git submodule update --init
147-
mkdir build
148132
cd build
149-
export CXX=clang-cl
150-
export CC=clang-cl
151-
cmake .. -G"Ninja" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_SITELIB=${CONDA_PREFIX}/Lib/site-packages -DPYTHON_EXECUTABLE=${CONDA_PREFIX}/python.exe -DOpenMP_ROOT=$CONDA_PREFIX -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON
152-
153-
- name: Configure [Conda/Windows-latest]
154-
if: contains(matrix.os, 'windows-latest') && contains(matrix.cxx_std, '17')
155-
shell: bash -l {0}
156-
run: |
157-
echo $(where ccache)
158-
git submodule update --init
159-
mkdir build
160-
cd build
161-
export CXX=clang-cl
162-
export CC=clang-cl
163-
cmake .. -G"Ninja" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_SITELIB=${CONDA_PREFIX}/Lib/site-packages -DPYTHON_EXECUTABLE=${CONDA_PREFIX}/python.exe -DOpenMP_ROOT=$CONDA_PREFIX -DBUILD_WITH_OPENMP_SUPPORT:BOOL=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON -DINSTALL_DOCUMENTATION:BOOL=ON
133+
cmake --build . --config ${{ matrix.build_type }} -v -j 1
164134
165-
- name: Build [Conda]
166-
shell: bash -l {0}
135+
- name: Build [Conda/Windows]
136+
if: contains(matrix.os, 'windows-')
137+
# It's better to use CMD to have all VS variables setup
138+
shell: cmd /C CALL {0}
167139
run: |
168140
cd build
169141
cmake --build . --config ${{ matrix.build_type }} -v -j 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: proxsuite
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- cmake
7+
- compilers
8+
- make
9+
- pkg-config
10+
- doxygen
11+
- ninja
12+
- graphviz
13+
- typing_extensions
14+
- llvm-openmp
15+
- clang
16+
- eigen
17+
- simde
18+
- libmatio
19+
- numpy
20+
- scipy

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
### Fixed
10+
* Fix Windows build with MSVC compiler and C++20 standard ([#368](https://github.com/Simple-Robotics/proxsuite/pull/368))
11+
912
## [0.7.0] - 2025-01-21
1013

1114
### Fixed

include/proxsuite/linalg/veg/internal/macros.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@
477477
#define __VEG_IMPL_PREFIX_explicit
478478

479479
#define __VEG_IMPL_PARAM_EXPAND(I, _, Param) \
480-
__VEG_PP_TAIL Param __VEG_PP_HEAD Param
480+
__VEG_PP_ID(__VEG_PP_TAIL Param) __VEG_PP_ID(__VEG_PP_HEAD Param)
481481
#if VEG_HAS_CONCEPTS
482482
#define __VEG_IMPL_TEMPLATE(Attr_Name, TParams, Constraint, ...) \
483483
template<__VEG_PP_REMOVE_PAREN(TParams)> \

0 commit comments

Comments
 (0)