-
Notifications
You must be signed in to change notification settings - Fork 22
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
#include <linalg> causes compiler error in VS2022 #266
Comments
@QuantDevHacks Thanks for reporting! Regarding the "ugly hack," I have a PR pending with the MSVC work-around: #242 . You mentioned that you tried a fix for it, so I'm guessing that the above PR won't help you -- though it's certainly worth a try. I checked out that PR's branch. Then, I created a file #include <experimental/mdspan>
#include <experimental/linalg>
#include <vector>
#include <cstdlib>
#include <iostream>
#include <format>
using std::vector, std::size_t, std::cout, std::format;
namespace stdex = std::experimental;
int main()
{
} I then rebuilt with the CMake option
I noticed also that I was using The CMake build system for stdBLAS automatically downloads mdspan for you if you don't specify a path for it. It pulls from the Another thing that could be happening is that since you're not running stdBLAS's CMake build process, then you're not getting its CMake-generated
If you have In general, I'm not sure what happens if you just include the headers directly, instead of letting CMake install them. We don't test that use case. |
Putting
#include <linalg>
in a source file in Visual Studio 2022, using the VS compiler, results in a compiler error. There is no error when I switch to the LLVM Platform Toolset in my project settings, however.
Details and repro follow:
My VS project name is lin_alg_examples (VS creates a directory of the same name). Under this directory, I created the following subdirectory:
...lin_alg_examples\kokkos\experimental
Under experimental, I placed the mdspan and linalg header files, and the __p0009_bits and __p1673_bits directories:
In the project settings, I am using the VS compiler with the latest C++ working draft:
I then write an empty main() function:
When I build the project, I get the following compiler error messages:
It identifies lines 253 and 255 in transposed.hpp; lines 252-255 are as follows:
I tried inserting the "ugly hack" referenced in Issue #242, but this did not fix the problem, even though it seemed it might be related.
If I comment out
#include <experimental/linalg>
, however, the project builds successfully.Furthermore, if I restore the file so that the linalg file is included again, and I change the compiler Platform Toolset to the LLVM setting:
the code will compile successfully.
One final remark is that the exact same behavior is seen after changing the C++ Language Standard setting to C++20:
The text was updated successfully, but these errors were encountered: