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

unsupported option '-mwindows' for target 'x86_64-pc-windows-msvc' #631

Closed
jakirkham opened this issue Oct 23, 2023 · 6 comments · Fixed by #632
Closed

unsupported option '-mwindows' for target 'x86_64-pc-windows-msvc' #631

jakirkham opened this issue Oct 23, 2023 · 6 comments · Fixed by #632

Comments

@jakirkham
Copy link

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):

lstopo_win_CFLAGS = $(lstopo_CFLAGS) -mwindows

Initially thought this might be a Clang bug ( llvm/llvm-project#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.

@bgoglin
Copy link
Contributor

bgoglin commented Oct 23, 2023

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.

bgoglin added a commit to bgoglin/hwloc that referenced this issue Oct 24, 2023
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.
-mwindows is the only difference between lstopo-win and lstopo,
so just disable lstopo-win instead of building both identically.

Closes open-mpi#631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
@bgoglin
Copy link
Contributor

bgoglin commented Oct 24, 2023

@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.

bgoglin added a commit to bgoglin/hwloc that referenced this issue Oct 24, 2023
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.
-mwindows is the only difference between lstopo-win and lstopo,
so just disable lstopo-win instead of building both identically.

Closes open-mpi#631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
bgoglin added a commit to bgoglin/hwloc that referenced this issue Oct 24, 2023
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.

Closes open-mpi#631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
bgoglin added a commit to bgoglin/hwloc that referenced this issue Oct 24, 2023
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.
-mwindows is the only difference between lstopo-win and lstopo,
so just disable lstopo-win instead of building both identically.

Closes open-mpi#631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
@bgoglin
Copy link
Contributor

bgoglin commented Nov 20, 2023

@jakirkham Did you have a chance to test this?

bgoglin added a commit that referenced this issue Jun 12, 2024
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.

Closes #631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
bgoglin added a commit that referenced this issue Jun 12, 2024
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.
-mwindows is the only difference between lstopo-win and lstopo,
so just disable lstopo-win instead of building both identically.

Closes #631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
@bgoglin
Copy link
Contributor

bgoglin commented Jun 12, 2024

@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?

@h-vetinari
Copy link

Sorry for the long delay @bgoglin, I just backported #632 on top of 2.11.2 in conda-forge/libhwloc-feedstock#83 and it works like a charm. Thank you very much!

@bgoglin
Copy link
Contributor

bgoglin commented Nov 11, 2024

@h-vetinari It's been a long time, I don't remember well what happened, but the second patch breaks lstopo_win_CFLAGS. I don't see why this CFLAGS would need to change in that commit, hence I am just going to revert that part and assume it still works for you since lstopo_win_CFLAGS isn't used anymore in your case.

bgoglin added a commit to bgoglin/hwloc that referenced this issue Nov 11, 2024
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.

Closes open-mpi#631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
bgoglin added a commit to bgoglin/hwloc that referenced this issue Nov 11, 2024
Clang can be used in "MSVC mode" to build hwloc using autotools.
That mode doesn't support -mwindows just like MSVC doesn't.
-mwindows is the only difference between lstopo-win and lstopo,
and we already remove -mwindows from lstopo-win if building
with MSVC, so just disable lstopo-win instead of building both
identically.

Closes open-mpi#631

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants