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

CyLP 0.92.3 Windows wheels? #204

Open
Owen-OptiGrid opened this issue Sep 23, 2024 · 6 comments
Open

CyLP 0.92.3 Windows wheels? #204

Owen-OptiGrid opened this issue Sep 23, 2024 · 6 comments

Comments

@Owen-OptiGrid
Copy link

I'm trying to install cylp 0.92.3 on Windows 11 with Python 3.12.6 - I noted there's no Windows wheels created for this version it appears.

I tried letting pip build from source but I keep getting msbuild errors like this:

"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\OwenLamont\bin\CBC\lib /LIBPATH:. /LIBPATH:.\cylp\cy /LIBPATH:C:\Users\OwenLamont\bin\CBC\lib /LIBPATH:C:\Users\OwenLamont\bin\CBC\lib\intel /LIBPATH:C:\Users\OwenLamont\AppData\Local\uv\cache\builds-v0\.tmps3Whfy\libs /LIBPATH:C:\Users\OwenLamont\AppData\Roaming\uv\python\cpython-3.12.6-windows-x86_64-none\libs /LIBPATH:C:\Users\OwenLamont\AppData\Roaming\uv\python\cpython-3.12.6-windows-x86_64-none /LIBPATH:C:\Users\OwenLamont\AppData\Local\uv\cache\builds-v0\.tmps3Whfy\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" libCbcSolver.lib libCbc.lib libCgl.lib libOsiClp.lib libClp.lib libOsi.lib libCoinUtils.lib libCbcSolver.lib /EXPORT:PyInit_CyClpPrimalColumnPivotBase build\temp.win-amd64-cpython-312\Release\cylp\cpp\IClpPrimalColumnPivotBase.obj build\temp.win-amd64-cpython-312\Release\cylp\cy\CyClpPrimalColumnPivotBase.obj /OUT:build\lib.win-amd64-cpython-312\cylp\cy\CyClpPrimalColumnPivotBase.cp312-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-312\Release\cylp\cpp\CyClpPrimalColumnPivotBase.cp312-win_amd64.lib
libClp.lib(ClpPrimalColumnPivot.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in IClpPrimalColumnPivotBase.obj
   Creating library build\temp.win-amd64-cpython-312\Release\cylp\cpp\CyClpPrimalColumnPivotBase.cp312-win_amd64.lib and object build\temp.win-amd64-cpython-312\Release\cylp\cpp\CyClpPrimalColumnPivotBase.cp312-win_amd64.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
build\lib.win-amd64-cpython-312\cylp\cy\CyClpPrimalColumnPivotBase.cp312-win_amd64.pyd : fatal error LNK1319: 1 mismatches detected
--- stderr:
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe' failed with exit code 1319

I tried building against each of the CBC 2.10.12 windows binary releases here to no avail.

I installed the Visual Studio C++ Build Tools as shown:

image

@tkralphs
Copy link
Member

tkralphs commented Oct 3, 2024

Sorry about this, I forgot to build wheels for Windows last release. I'll try to do that today. Everything has to be built with the correct run-time library and I guess you are getting some mismatches. It's a pain.

@Owen-OptiGrid
Copy link
Author

Owen-OptiGrid commented Oct 3, 2024 via email

@tkralphs
Copy link
Member

tkralphs commented Oct 3, 2024

OK, the Windows wheels are there now. I'm not sure how you did your Windows build but if you used coinbrew, then you need --enable-msvc=MD to get the correct run-time. It looks like the Actions builds use the default, which is MT, although the files are named *-md. I thought we had this sorted, but perhaps not.

@tkralphs
Copy link
Member

tkralphs commented Oct 4, 2024

@jhmgoossens I think I remember that we discussed the --enable-msvc flag when you set up the latest workflows for Github Actions. We evidently decided to only build with the the default \MT, but somehow, we are still naming the Windows archives with a -md suffix. For building C extensions with Python, we need \MD.

I opened two PRs (one for master and one for stable/2.10) that correct the problem with the suffix and add \MD builds. With these builds, it is now possible to pip install CyLP from source by downloading Cbc-w64-msvc17-MD.zip.

Can you take a look and see if you agree? I guess that we only need these additional builds for Cbc and not all the other projects in the stack. Obviously, this violates my principle of having the same workflow files everywhere, but I guess we can realign them next time we do an overhaul.

@tkralphs
Copy link
Member

tkralphs commented Oct 4, 2024

Also, @Owen-OptiGrid , could you test whether these binaries work for you?

@Owen-OptiGrid
Copy link
Author

Sorry I missed your message - I've moved onto other tasks not requiring CyLP for a while but I'll see if I can try the new build files sometime soonish. Thanks for putting up the new builds!

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

No branches or pull requests

2 participants