Skip to content

Commit

Permalink
fix win 3
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf committed Apr 2, 2024
1 parent b56f3be commit 40d6945
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
13 changes: 5 additions & 8 deletions recipe/build_openmm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,21 @@ for %%f in (dist\*.whl) do (

cd openmm-cuda
%PYTHON% -m pip wheel . --wheel-dir=%SRC_DIR%\build\python\dist -vv
cd %SRC_DIR%\build\python\dist
cd %SRC_DIR%\build\python

for %%f in (*.whl) do (
for %%f in (dist\*.whl) do (
echo "fixing %%f"
cd %LIBRARY_PREFIX%
%PYTHON% ^
%RECIPE_DIR%\vendor_wheel.py ^
%SRC_DIR%\build\python\dist\%%f ^
%SRC_DIR%\build\python\%%f ^
lib\plugins\OpenMMCUDA.dll ^
lib\plugins\OpenMMRPMDCUDA.dll ^
lib\plugins\OpenMMAmoebaCUDA.dll ^
lib\plugins\OpenMMDrudeCUDA.dll
if errorlevel 1 exit 1
cd %SRC_DIR%\build\python\dist
set "fname=%%f"
dir
echo %fname% ..\fixed_wheels\%fname:~0,-7%win_amd64.whl
move %fname% ..\fixed_wheels\%fname:~0,-7%win_amd64.whl
cd %SRC_DIR%\build\python
%PYTHON% %RECIPE_DIR%\rename_wheel.py %%f win_amd64.whl fixed_wheels
if errorlevel 1 exit 1
)

Expand Down
12 changes: 12 additions & 0 deletions recipe/rename_wheel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import shutil
import sys

def rename(fname, new_suffix, new_dest):
assert fname.endswith(".whl")
prefix, dash, _ = fname.rpartition("-")
new_fname = os.path.basename(prefix + dash + new_suffix)
shutil.move(fname, os.path.join(new_dest, new_fname))

if __name__ == "__main__":
rename(*sys.argv[1:])

0 comments on commit 40d6945

Please sign in to comment.