Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with Cl and C++20 #368

Open
wants to merge 6 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 25 additions & 53 deletions .github/workflows/ci-linux-osx-win-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ jobs:
os: macos-latest
- name: macos-14
os: macos-14
# proxsuite doesn't build with vs2019, so we use clang-cl instead
- name: windows-2019-clang-cl
os: windows-2019
compiler: clang-cl
# proxsuite should work with vs2022
- name: windows-latest
os: windows-latest
compiler: cl
- name: macos-latest
os: macos-latest
build_type: Debug
Expand Down Expand Up @@ -59,21 +62,17 @@ jobs:

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: proxsuite
channels: conda-forge
conda-remove-defaults: "true"
environment-file: .github/workflows/conda/environment.yml
auto-activate-base: false
auto-update-conda: true


- name: Install dependencies [Conda]
- name: Install dependencies [Conda/Windows-latest]
if: contains(matrix.os, 'windows-latest')
shell: bash -l {0}
run: |
# Compilation related dependencies
conda install cmake compilers make pkg-config doxygen ninja graphviz typing_extensions llvm-openmp clang
# Main dependencies
conda install eigen simde
# Test dependencies
conda install libmatio numpy scipy
# Use VS2022 on Windows-latest
conda install vs2022_win-64

- name: Install julia [Linux]
if: contains(matrix.os, 'ubuntu')
Expand All @@ -95,7 +94,7 @@ jobs:
env

- name: Configure [Conda/Linux&macOS]
if: contains(matrix.os, 'macos-latest') || contains(matrix.os, 'ubuntu')
if: contains(matrix.os, 'macos-') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
echo $(whereis ccache)
Expand All @@ -105,18 +104,6 @@ jobs:
cd build
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

- name: Configure [Conda/macOS14]
if: contains(matrix.os, 'macos-14')
shell: bash -l {0}
run: |
echo $(whereis ccache)
echo $(which ccache)
git submodule update --init
mkdir build
cd build
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


- name: Configure [Conda/macOS-debug/CheckMalloc]
if: contains(matrix.os, 'macos-latest') && contains(matrix.build_type, 'Debug')
shell: bash -l {0}
Expand All @@ -126,44 +113,29 @@ jobs:
cd build
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

- name: Configure [Conda/Windows-2019]
if: contains(matrix.os, 'windows-2019')
shell: bash -l {0}
- name: Configure [Conda/Windows]
if: contains(matrix.os, 'windows-')
# It's better to use CMD to have all VS variables setup
shell: cmd /C CALL {0}
run: |
echo $(where ccache)
git submodule update --init
mkdir build
cd build
export CXX=clang-cl
export CC=clang-cl
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
set CC=${{ matrix.compiler }}
set CXX=${{ matrix.compiler }}
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

- name: Configure [Conda/Windows-latest]
if: contains(matrix.os, 'windows-latest') && contains(matrix.cxx_std, '20')
- name: Build [Conda/Linux&macOS]
if: contains(matrix.os, 'macos-') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
echo $(where ccache)
git submodule update --init
mkdir build
cd build
export CXX=clang-cl
export CC=clang-cl
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

- name: Configure [Conda/Windows-latest]
if: contains(matrix.os, 'windows-latest') && contains(matrix.cxx_std, '17')
shell: bash -l {0}
run: |
echo $(where ccache)
git submodule update --init
mkdir build
cd build
export CXX=clang-cl
export CC=clang-cl
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
cmake --build . --config ${{ matrix.build_type }} -v -j 1

- name: Build [Conda]
shell: bash -l {0}
- name: Build [Conda/Windows]
if: contains(matrix.os, 'windows-')
# It's better to use CMD to have all VS variables setup
shell: cmd /C CALL {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -v -j 1
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/conda/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: proxsuite
channels:
- conda-forge
- nodefaults
dependencies:
- cmake
- compilers
- make
- pkg-config
- doxygen
- ninja
- graphviz
- typing_extensions
- llvm-openmp
- clang
- eigen
- simde
- libmatio
- numpy
- scipy
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Fixed
* Fix Windows build with MSVC compiler and C++20 standard ([#368](https://github.com/Simple-Robotics/proxsuite/pull/368))

## [0.7.0] - 2025-01-21

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion include/proxsuite/linalg/veg/internal/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
#define __VEG_IMPL_PREFIX_explicit

#define __VEG_IMPL_PARAM_EXPAND(I, _, Param) \
__VEG_PP_TAIL Param __VEG_PP_HEAD Param
__VEG_PP_ID(__VEG_PP_TAIL Param) __VEG_PP_ID(__VEG_PP_HEAD Param)
#if VEG_HAS_CONCEPTS
#define __VEG_IMPL_TEMPLATE(Attr_Name, TParams, Constraint, ...) \
template<__VEG_PP_REMOVE_PAREN(TParams)> \
Expand Down
Loading