hwloc
hwloc copied to clipboard
unsupported option '-mwindows' for target 'x86_64-pc-windows-msvc'
What version of hwloc are you using?
Building 2.9.3 from source
Which operating system and hardware are you running on?
Microsoft Windows Server 2022 (x86_64)
Details of the problem
Attempted to build from source with MSVC + Clang, but ran into an issue with the -mwindows flag (please see line below):
https://github.com/open-mpi/hwloc/blob/fed97f603afc0a8fab2c6f846e3fda9f54f6e0d1/utils/lstopo/Makefile.am#L63
Initially thought this might be a Clang bug ( https://github.com/llvm/llvm-project/issues/69964 ), but was advised that the -mwindows flag was only intended for MinGW (not MSVC).
Additional information
The build script runs this activation script on Windows followed by this shell script using MinGW's bash + Clang.
Here is the full build log.
It should be easy to disable this option when not building with GCC, but it would be nice to have the equivalent option for Clang. Otherwise there's no point in building both lstopo and lstopo-win.
@jakirkham Can you try the tarball available at https://ci.inria.fr/hwloc/job/basic/view/change-requests/job/PR-632/ ? It should disable the build of lstopo-win entirely when it finds that the compiler says it's MSVC.
@jakirkham Did you have a chance to test this?
@jakirkham I updated the pull request, a tarball is available at https://ci.inria.fr/hwloc/job/basic/view/change-requests/job/PR-632/ Can you check if your problem still occurs?