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

MSVC/Flang support (Windows) #56

Merged
merged 10 commits into from
Mar 18, 2020
Merged

Conversation

richardotis
Copy link
Contributor

@richardotis richardotis commented Feb 17, 2020

Checklist

  • Used a fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

This PR switches the Windows build over to the newer compiler infrastructure using MSVC and Flang, retiring the MinGW build. According to a reverse dependency analysis, the only feedstock which will be affected is ipopt (and I have ongoing work to address that in conda-forge/ipopt-feedstock#34).

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@richardotis
Copy link
Contributor Author

richardotis commented Feb 17, 2020

It looks like the way OpenBLAS handles this is forcing the use of clang: https://github.com/conda-forge/openblas-feedstock/blob/631acd1244709ed8872494b1d40d0195b4049e4f/recipe/bld.bat

Specifically, OpenBLAS forces clang-cl, which is "an alternative command-line interface to Clang, designed for compatibility with the Visual C++ compiler, cl.exe." (Details on https://clang.llvm.org/docs/UsersManual.html#clang-cl ). Overall, Clang strives for ABI compatibility with MSVC: https://clang.llvm.org/docs/MSVCCompatibility.html

The inability to use the MSVC compiler is possibly related to flang-compiler/flang-driver#75
The odd thing is I can still let it use the MS link.exe, and everything works. I'll note that I have to use WINDOWS_EXPORT_ALL_SYMBOLS to get the Fortran examples to link, and this appears to crash MSVC, but not clang-cl. If that issue were resolved, perhaps the pure MS toolchain would work here.

I'll test this, but I think it's fine to use Clang here to build shared libraries while downstream uses MSVC. Local testing appears promising.

@richardotis richardotis changed the title WIP: MSVC/Flang support (Windows) MSVC/Flang support (Windows) Feb 17, 2020
@richardotis
Copy link
Contributor Author

This is ready for review.

@isuruf
Copy link
Member

isuruf commented Feb 17, 2020

I'll note that I have to use WINDOWS_EXPORT_ALL_SYMBOLS to get the Fortran examples to link, and this appears to crash MSVC, but not clang-cl.

It's not MSVC that crashes, it's CMake that crashes. See https://github.com/conda-forge/pymdi-feedstock/blob/c620ef2d8069301a194aef0fe41658ac4568fcd8/recipe/bld.bat#L8-L11

@richardotis
Copy link
Contributor Author

Any comments from the feedstock maintainers?

@richardotis
Copy link
Contributor Author

I'd be interested in those using downstream packages to try this packaging of mumps. I packaged this on the pycalphad anaconda.org channel, and while it mostly works, there seems to be a few downstream test failures. The mumps tests themselves seem to pass without a problem, so I'm not sure if it's a downstream issue. (This was never an issue with the MinGW-based builds.)

For me the dependency chain looks like
mumps (tests pass) -> ipopt (6/44 tests fail) -> pycalphad (6/123 tests fail)

I'm still investigating, but I wanted to give a heads up to other maintainers in case they want to test against their own packages.

@minrk
Copy link
Member

minrk commented Feb 21, 2020

I don't have any relevant knowledge of windows builds, so I'd just have to trust you, but it looks AOK to me. I'd like to let @jbweston weight in, but I'm also okay merging this if we don't get any negative feedback soon.

@moorepants
Copy link

Shall this be merged?

@richardotis
Copy link
Contributor Author

By the way, I investigated the downstream test failures and confirmed the exact same ipopt test failures when using the (current) MinGW-based conda-forge mumps.

I still don't know what's causing the downstream failures, but I believe this is safe to merge.

@moorepants
Copy link

@conda-forge/mumps Can an owner of this repo approve and merge this PR? Seems like there aren't any objections.

@basnijholt
Copy link
Contributor

I know too little about Windows builds to make a good judgement.

However, if no one has objections I will merge tomorrow ;)

@basnijholt basnijholt merged commit 0f9512c into conda-forge:master Mar 18, 2020
@moorepants
Copy link

Thanks!

@moorepants
Copy link

It looks like the build on master failed.

@richardotis
Copy link
Contributor Author

@conda-forge-admin please rerender

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 this pull request may close these issues.

6 participants