Skip to content

Commit

Permalink
update python interface compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Gravey committed Nov 12, 2019
1 parent a7f6447 commit d57e75e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/python-build/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
print(numpy.distutils.misc_util.get_numpy_include_dirs())

setup(name='G2S',
version='0.94.0',
version=open('../../version', 'r').read(),
description='G2S interface',
author='Mathieu Gravey',
author_email='mathieu.gravey@unil.ch',
Expand Down
5 changes: 3 additions & 2 deletions build/python-build/setup_Win.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
#py setup_Win.py bdist --format=wininst

from distutils.core import setup, Extension
import platform
import numpy

setup(name='G2S',
version='0.94.0',
version=open('../../version', 'r').read(),
description='G2S interface',
author='Mathieu Gravey',
author_email='mathieu.gravey@unil.ch',
url='https://github.com/GAIA-UNIL/G2S',
ext_modules=[Extension("g2s", sources=["../../src_interfaces/python3_interface.cpp","jsoncpp-master/dist/jsoncpp.cpp"],
language="c++",
extra_compile_args=["/std:c++17","-DNOMINMAX",'-DVERSION=\"'+open('../../version', 'r').read()+'\"','-DPYTHON_VERSION=\"'+platform.python_version()+'\"'],
extra_compile_args=["/std:c++17","-DNOMINMAX",'/DVERSION=\\\"'+open('../../version', 'r').read()+'\\\"','/DPYTHON_VERSION=\\\"'+platform.python_version()+'\\\"'],
extra_link_args=[],
include_dirs=["../../include","./cppzmq-master","jsoncpp-master/include", "../../include_interfaces", "C:\Program Files\ZeroMQ 4.0.4\include", "jsoncpp-master\\jsoncpp-master\\include", "/usr/include","/usr/include/jsoncpp","/opt/local/include"],
libraries = ['libzmq-v120-mt-4_0_4'],
Expand Down
22 changes: 22 additions & 0 deletions build/python-build/setup_Win_compile_all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
if NOT exist "C:\Program Files\ZeroMQ 4.0.4" (
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://miru.hk/archive/ZeroMQ-4.0.4~miru1.0-x64.exe', 'ZeroMQ-4.0.4~miru1.0-x64.exe')"
start /w ZeroMQ-4.0.4~miru1.0-x64.exe
)
if NOT exist "cppzmq-master" (
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://codeload.github.com/zeromq/cppzmq/zip/master', 'cppzmq-master.zip')"
powershell Expand-Archive cppzmq-master.zip -DestinationPath .
)
if NOT exist "jsoncpp-master" (
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://codeload.github.com/open-source-parsers/jsoncpp/zip/master', 'jsoncpp-master.zip')"
powershell Expand-Archive jsoncpp-master.zip -DestinationPath .
cd jsoncpp-master
py amalgamate.py
cd ..
)

for %%x in ( 3.8, 3.7, 3.6, 3.5) do (
py -%%x -m pip install --upgrade pip
py -%%x -m pip install numpy setuptools wheel
py -%%x setup_Win.py bdist --format=wininst
del build /s /f /q
)

0 comments on commit d57e75e

Please sign in to comment.