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

Compilation error on Windows with VS2022 and C++ 20 #367

Open
olivier-roussel opened this issue Jan 22, 2025 · 1 comment
Open

Compilation error on Windows with VS2022 and C++ 20 #367

olivier-roussel opened this issue Jan 22, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@olivier-roussel
Copy link

I'm trying to integrate proxsuite into the SOFA framework and more specifically the SoftRobots.Inverse plugin.
The SOFA CI on Windows is based on the MSVC CL compiler (v19.42) from Visual Studio 2022 toolkit. Also, SOFA now requires C++20 standard support.
When trying to compile using proxsuite with this build chain, I ran into this kind of error:

   Microsoft (R) C/C++ Optimizing Compiler Version 19.42.34435 for x64
  Copyright (C) Microsoft Corporation.  All rights reserved.
  cl /c /ID:\a\proxsuite\proxsuite\build /ID:\a\proxsuite\proxsuite\build\include /ID:\a\proxsuite\proxsuite\include /ID:\a\proxsuite\proxsuite\bindings\python\external\nanobind\include /W3 /WX- /diagnostics:column /MP /O2 /Ob2 /Os /D _WINDLL /D _MBCS /D _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE /D WIN32 /D _WINDOWS /D NDEBUG /D PYTHON_MODULE_NAME=proxsuite_pywrap /D PROXSUITE_PYTHON_INTERFACE_WITH_OPENMP /D NOMINMAX /D Py_GIL_DISABLED=1 /D "CMAKE_INTDIR=\"Release\"" /D proxsuite_pywrap_EXPORTS /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /std:c++20 /permissive- /Fo"proxsuite_pywrap.dir\Release\\" /Fd"proxsuite_pywrap.dir\Release\vc143.pdb" /external:W0 /Gd /TP /wd4101 /wd4250 /wd4251 /wd4275 /wd4355 /errorReport:queue  /external:I "D:/a/proxsuite/proxsuite/external/cereal/include" /external:I "C:/Users/runneradmin/miniconda3/envs/proxsuite/Include" /external:I "C:/Users/runneradmin/miniconda3/envs/proxsuite/Library/include/eigen3" /Zc:__cplusp
  expose-all.cpp
D:\a\proxsuite\proxsuite\include\proxsuite\linalg\veg\util\defer.hpp(43,1): error C2061: syntax error: identifier '__VEG_PP_TAIL' [D:\a\proxsuite\proxsuite\build\bindings\python\proxsuite_pywrap.vcxproj]
  (compiling source file '../../../bindings/python/src/expose-all.cpp')

See full log here: https://github.com/olivier-roussel/proxsuite/actions/runs/12912111683/job/36006147877#step:14:343

Unfortunately, SOFA framework does not support yet compilation on Windows using the Clang-cl compiler, which seems to be how proxsuite handles for now the C++20 standard support.

Do you have any hint or perspectives on how to handle this bug ?

@olivier-roussel olivier-roussel added the bug Something isn't working label Jan 22, 2025
@jorisv
Copy link
Contributor

jorisv commented Jan 23, 2025

This build issue can be fixed by setting the /Zc:preprocessor compile option.

I don't think it's a good idea to add this definition, because it will propagate to consumers. I will try to find which macro should be patched instead…

@jorisv jorisv mentioned this issue Jan 23, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants