Description
On VS2019, trying to build using MSVC I get errors like the following:
[1/86] Building CXX object OpenMEEGMaths\CMakeFiles\OpenMEEGMaths.dir\src\vector.cpp.obj
FAILED: OpenMEEGMaths/CMakeFiles/OpenMEEGMaths.dir/src/vector.cpp.obj
C:\PROGRA~2\MICROS~1\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe /nologo /TP -DH5_BUILT_AS_DYNAMIC_LIB -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_SHARED_PTR_ARRAY_SUPPORT -DOpenMEEGMaths_EXPORTS -DUSE_OPENBLAS -I%SRC_DIR%\OpenMEEGMaths\include -I%SRC_DIR%\build_Release\OpenMEEGMaths -I%SRC_DIR%\build_Release -I%SRC_DIR%\OpenMEEGMaths\OpenMEEGMaths\src -external:I%PREFIX%\Library\include -external:W0 /wd4275 /wd4101 -openmp /MD /O2 /Ob2 /DNDEBUG -std:c++17 /showIncludes /FoOpenMEEGMaths\CMakeFiles\OpenMEEGMaths.dir\src\vector.cpp.obj /FdOpenMEEGMaths\CMakeFiles\OpenMEEGMaths.dir\ /FS -c %SRC_DIR%\OpenMEEGMaths\src\vector.cpp
%PREFIX%\Library\include\lapack.h(104): error C2143: syntax error: missing ',' before '*'
%PREFIX%\Library\include\lapack.h(106): error C2143: syntax error: missing ',' before '*'
... <hundreds of these>
You can see it on conda-forge here for example, where it uses the OpenBLAS libraries that they build:
And on GitHub actions here from earlier this week, same error -- this is using the OpenBLAS builds SciPy makes with mingw64, but I had the same problem when I tried previously just by downloading the 0.3.20 release binaries from GitHub:
Run cmake --build build --config Release
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Building Custom Rule D:/a/openmeeg/openmeeg/OpenMEEGMaths/CMakeLists.txt
vector.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.16.27023\include\xlocale(319): warning C4[53](https://github.com/openmeeg/openmeeg/runs/6975816876?check_suite_focus=true#step:16:54)0: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [D:\a\openmeeg\openmeeg\build\OpenMEEGMaths\OpenMEEGMaths.vcxproj]
d:\a\openmeeg\openmeeg\openblas\64\include\lapack.h(104): error C2143: syntax error: missing ',' before '*' [D:\a\openmeeg\openmeeg\build\OpenMEEGMaths\OpenMEEGMaths.vcxproj]
d:\a\openmeeg\openmeeg\openblas\64\include\lapack.h(106): error C2143: syntax error: missing ',' before '*' [D:\a\openmeeg\openmeeg\build\OpenMEEGMaths\OpenMEEGMaths.vcxproj]
... <hundreds of these>
I am a bit mystified by this because these lines are protected by an ifdef that should take care of this I think:
Anyone run into this before? I didn't see any mention of anything like this in the Visual Studio wiki docs, but maybe I just missed it. Perhaps it's a cmake+MSVC+CPP issue, and there is some cmake fix...? Not sure.
An identical build configuration using mingw64 doesn't have this problem... but I think for conda-forge I might need to build with MSVC. And in any case it would be nice if it worked...