GraphBLAS icon indicating copy to clipboard operation
GraphBLAS copied to clipboard

build fails on windows 11 using CMake with MinGW

Open ElectroMummyfied opened this issue 3 years ago • 2 comments

  • Windows 11 - CMake with MinGW ... cpu_features/src/hwcaps.c:110:2: error: #error "This platform does not provide hardware capabilities."

  • Windows 11 - CMake with Visual Studio 17 1>GB_binop__first_uint16.c 1>Generating Code... 1>...\Source\Template\GB_sparse_add_template.c(398): fatal error C1001: Internal compiler error. 1>(compiler file '...\vctools\Compiler\Utc\src\p2\main.c', line 220) 1> To work around this problem, try simplifying or changing the program near the locations listed above. 1>If possible please provide a repro here: https://developercommunity.visualstudio.com 1>Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information 1>Done building project "graphblas.vcxproj" -- FAILED.

  • WSL2 - Ubuntu - CMake with Unix Makefiles Compiles successfully.

ElectroMummyfied avatar Aug 16 '22 21:08 ElectroMummyfied

I can disable the cpu_features with MinGW. Try the Source/GB_compiler.h and Source/GB_cpu_features.h files in the latest version of the master branch, which I just pushed. Can you give it a try? I can't test it since I don't have that compiler.

I have no idea how to fix the MS Visual Studio bug. Which version is it? The latest is 17.3. If you don't have 17.3, the bug might be fixed in that VS version.

Line 398 of the Source/Generated/GB_binop__first_uint16.c file is very tame, consisting of this code, when the macro is expanded:

Cx [pC+p] = alpha_scalar ;

where Cx and alpha_scalar are uint16_t, and pC and p are both int64_t. That code can't change -- MicroSoft just needs to fix the bug in their compiler. It could be the compiler is running out of memory, so trying a machine with more RAM might solve the problem.

DrTimothyAldenDavis avatar Aug 17 '22 03:08 DrTimothyAldenDavis

@DrTimothyAldenDavis, can you create a minimal example that reproduces the bug in Microsoft's compiler (maybe using Godbolt)? Then I am willing to file a bug report at Microsoft.

gruenich avatar Aug 29 '22 20:08 gruenich

I think the compiler is likely dying in a nearby file, not first_uint16. The build is parallel, right? VS 2019 triggers a bug in the FIRST_FC32 and SECOND_FC32 binary operators. See:

https://github.com/conda-forge/graphblas-feedstock/issues/47

This compiler bug is likely the same that's being seen in the conda-forge build of GraphBLAS.

DrTimothyAldenDavis avatar Oct 20 '22 12:10 DrTimothyAldenDavis

I disabled the cpu_features for MINGW in a commit on Aug 16: https://github.com/DrTimothyAldenDavis/GraphBLAS/commit/5462e0c372f2116a5bee61eeb174730356bee31e and that is in the latest stable v7.3.0.

The MSC compiler bug might be fixed by my v7.3.1.beta1 pre-release that I just tagged today: https://github.com/DrTimothyAldenDavis/GraphBLAS/releases/tag/v7.3.1.beta1

Can you give v7.3.1.beta1 a try, @ElectroMummyfied ? That might fix this problem.

If it still fails, can you let me know what the error is, and in which file? Turn off any parallel builds, so the error message comes right after the filename. "GB_sparse_add_template.h" isn't enough information. I would need to know the source, like if it's GB_binop__first_fc32.c for example.

DrTimothyAldenDavis avatar Oct 21 '22 17:10 DrTimothyAldenDavis

This is now fixed in v7.3.3.beta*. Thanks for the feedback!

DrTimothyAldenDavis avatar Dec 09 '22 16:12 DrTimothyAldenDavis