Skip to content

Commit

Permalink
Update Win builds (#77)
Browse files Browse the repository at this point in the history
* use newer commands

* update cibuildwheel

* Update scripts/build_glpk.py

Co-authored-by: Moritz E. Beber <[email protected]>

* fix build again

* fix build again

Co-authored-by: Moritz E. Beber <[email protected]>
  • Loading branch information
cdiener and Midnighter authored Oct 2, 2022
1 parent 372a217 commit b4d0218
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
echo "::set-output name=swigplk_version::$(python scripts/find_swiglpk_version.py)"
- name: Build wheels
uses: joerick/cibuildwheel@v2.9.0
uses: joerick/cibuildwheel@v2.10.2
env:
NEW_GLPK_VERSION: ${{ steps.version.outputs.glpk_version }}
GLPK_HEADER_PATH: glpk-${{ steps.version.outputs.glpk_version }}/src
Expand Down
13 changes: 8 additions & 5 deletions scripts/build_glpk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import struct
import shutil
import setuptools.msvc
try:
import urllib2
except ImportError: # python 3
import urllib.request as urllib2
import urllib.request as urllib2
import subprocess

# these need to be set to the latest glpk version
glpk_version = os.getenv('NEW_GLPK_VERSION')
Expand All @@ -19,6 +17,7 @@
glpk_build_dir = "glpk_build/glpk-%s" % glpk_version
url = "http://ftp.gnu.org/gnu/glpk/glpk-%s.tar.gz" % glpk_version
bitness = struct.calcsize("P") * 8
arch = "x86_amd64" if bitness == 64 else "x86"


# def md5(fname):
Expand Down Expand Up @@ -55,7 +54,11 @@ def get_vcvarsall_cmd():
os.chdir("%s/w%d" % (glpk_build_dir, bitness))
if not os.path.isfile("glpk.lib"):
shutil.copy2("config_VC", "config.h")
os.system(get_vcvarsall_cmd() + "& nmake /f Makefile_VC")
os.environ.update(setuptools.msvc.msvc14_get_vc_env(arch))
subprocess.run(
["nmake", "/f", "Makefile_VC"],
check=True,
)
shutil.copy2("glpk.lib", "../../..")
os.chdir("../../..")
shutil.copy2(glpk_build_dir + "/src/glpk.h", ".")

0 comments on commit b4d0218

Please sign in to comment.