This commit is contained in:
Laurent Perron
2016-09-21 11:55:48 +02:00
12 changed files with 83 additions and 161 deletions

View File

@@ -8,7 +8,7 @@ help:
@echo " - all: all test clean"
OR_TOOLS_MAJOR = 4
OR_TOOLS_MINOR = 3
OR_TOOLS_MINOR = 4
# OR_ROOT is the minimal prefix to define the root of or-tools, if we
# are compiling in the or-tools root, it is empty. Otherwise, it is

8
README
View File

@@ -1,7 +1,7 @@
These libraries have been tested under:
- Ubuntu 12.04 and up (32- and 64-bit).
- Mac OS X Mavericks and Yosemite with Xcode 5.x (64 bit).
- Microsoft Windows with Visual Studio 2013 (32- and 64-bit)
These modules have been tested under:
- Ubuntu 14.04 and 16.04 up (64-bit).
- Mac OS X El Capitan with Xcode 7.x (64 bit).
- Microsoft Windows with Visual Studio 2013 and 2015 (64-bit)
Upon checking out the repository, you will get the following structure:

View File

@@ -1,5 +1,7 @@
archive: $(LIB_DIR)$S$(LIB_PREFIX)ortools.$(LIB_SUFFIX) csharp java create_dirs cc_archive dotnet_archive java_archive $(PATCHELF)
archive: $(INSTALL_DIR)$(ARCHIVE_EXT)
$(INSTALL_DIR)$(ARCHIVE_EXT): $(LIB_DIR)$S$(LIB_PREFIX)ortools.$(LIB_SUFFIX) csharp java create_dirs cc_archive dotnet_archive java_archive $(PATCHELF)
ifeq "$(SYSTEM)" "win"
cd temp && ..$Stools$Szip.exe -r ..$S$(INSTALL_DIR).zip $(INSTALL_DIR)
else
@@ -145,6 +147,7 @@ java_archive:
ifeq "$(SYSTEM)" "win"
fz_archive: fz
-$(DELREC) temp
mkdir temp
mkdir temp$S$(FZ_INSTALL_DIR)
mkdir temp$S$(FZ_INSTALL_DIR)$Sbin
@@ -200,9 +203,7 @@ ifeq "$(SYSTEM)" "win"
else
tar -x -v -f $(INSTALL_DIR).tar.gz -C temp
endif
cd temp$S$(INSTALL_DIR) && $(MAKE) test
-$(DELREC) $(INSTALL_DIR)
$(RENAME) lib2 lib
cd temp$S$(INSTALL_DIR) && $(MAKE) test && cd ../.. && $(RENAME) lib2 lib && echo "archive test succeeded" || ( cd ../.. && $(RENAME) lib2 lib && echo "archive test failed" && exit 1)
test_fz_archive: $(FZ_INSTALL_DIR)$(ARCHIVE_EXT)
-$(DELREC) temp
@@ -214,6 +215,52 @@ ifeq "$(SYSTEM)" "win"
else
tar -x -v -f $(FZ_INSTALL_DIR).tar.gz -C temp
endif
cd temp$S$(FZ_INSTALL_DIR) && .$Sbin$S$(FZ_EXE) examples$Scircuit_test.fzn
-$(DELREC) $(INSTALL_DIR)
$(RENAME) lib2 lib
cd temp$S$(FZ_INSTALL_DIR) && .$Sbin$S$(FZ_EXE) examples$Scircuit_test.fzn && cd ../.. && $(RENAME) lib2 lib && echo "fz archive test succeeded" || ( cd ../.. && $(RENAME) lib2 lib && echo "fz archive test failed" && exit 1)
ifeq "$(PYTHON3)" "true"
build_release: clean python test_python
pre_release: pypi_archive
release: pypi_upload
else #platform check
ifeq "$(SYSTEM)" "win"
ifeq "$(VISUAL_STUDIO_YEAR)" "2013"
build_release: clean all test
pre_release: archive test_archive
release:
else
ifeq "$(VISUAL_STUDIO_YEAR)" "2015"
build_release: clean all test fz
pre_release: archive test_archive fz_archive test_fz_archive python_examples_archive pypi_archive
release: pypi_upload nuget_upload
endif #ifeq "$(VISUAL_STUDIO_YEAR)" "2015"
endif # ifeq"$(VISUAL_STUDIO_YEAR)" "2013"
else # unix
ifeq "$(PLATFORM)" "LINUX"
ifeq "$(DISTRIBUTION_NUMBER)" "14.04"
build_release: clean all test fz
pre_release: archive test_archive fz_archive test_fz_archive python_examples_archive pypi_archive
release: pypi_upload
else
ifeq "$(DISTRIBUTION_NUMBER)" "16.0"
build_release: clean all test fz
pre_release: archive test_archive fz_archive test_fz_archive
release:
endif # ifeq "$(DISTRIBUTION_NUMBER)" "16.04"
endif # ifeq "$(DISTRIBUTION_NUMBER)" "14.04"
endif # ifeq "$(PLATFORM)" "LINUX"
ifeq "$(PLATFORM)" "MACOSX"
build_release: clean all test fz
pre_release: archive test_archive fz_archive test_fz_archive pypi_archive
release: pypi_upload
endif #ifeq "$(PLATFORM)" "MACOSX"
endif #ifeq "$(SYSTEM)" "win"
endif #ifeq "$(PYTHON3)" "true"

View File

@@ -426,8 +426,8 @@ ifeq ("$(SYSTEM)","win")
copy examples\data\survo_puzzle\* temp\or-tools\examples\data\survo_puzzle
copy examples\data\quasigroup_completion\* temp\or-tools\examples\data\quasigroup_completion
copy tools\or-tools.nuspec temp\or-tools
$(SED) -i -e "s/VVVV/$(OR_TOOLS_VERSION)/g" temp\or-tools\or-tools.nuspec
$(SED) -i -e "s/PROTOBUF_TAG/$(PROTOBUF_TAG)/g" temp\or-tools\or-tools.nuspec
$(SED) -i -e "s/VVVV/$(OR_TOOLS_VERSION)/" temp\or-tools\or-tools.nuspec
$(SED) -i -e "s/PROTOBUF_TAG/$(PROTOBUF_TAG)/" temp\or-tools\or-tools.nuspec
cd temp\or-tools && nuget pack or-tools.nuspec
cd temp\or-tools && nuget push Google.OrTools-$(OR_TOOLS_VERSION).nupkg
endif

View File

@@ -234,13 +234,13 @@ python_examples_archive:
-$(DEL) temp$Sortools_examples$Ssetup.py-e
ifeq ($(SYSTEM),win)
cd temp\ortools_examples && ..\..\tools\tar.exe -C ..\.. -c -v --exclude *svn* --exclude *roadef* examples\data | ..\..\tools\tar.exe xvm
cd temp && ..\tools\zip.exe -r ..\or-tools.python.examples_$(OR_TOOLS_VERSION).zip ortools_examples
cd temp && ..\tools\zip.exe -r ..\or-tools_python_examples_v$(OR_TOOLS_VERSION).zip ortools_examples
else
cd temp/ortools_examples && tar -C ../.. -c -v --exclude *svn* --exclude *roadef* examples/data | tar xvm
cd temp && tar -c -v -z --no-same-owner -f ../or-tools.python.examples_$(OR_TOOLS_VERSION).tar.gz ortools_examples
cd temp && tar -c -v -z --no-same-owner -f ../or-tools_python_examples_v$(OR_TOOLS_VERSION).tar.gz ortools_examples
endif
pypi2_archive: python $(PATCHELF)
pypi_archive: python $(PATCHELF)
-$(DELREC) temp
$(MKDIR) temp
$(MKDIR) temp$Sortools
@@ -265,6 +265,11 @@ pypi2_archive: python $(PATCHELF)
$(COPY) tools$SREADME.pypi temp$Sortools$SREADME.txt
$(COPY) LICENSE-2.0.txt temp$Sortools
$(COPY) tools$Ssetup.py temp$Sortools
ifeq ($(PYTHON3),true)
$(SED) -i -e 's/ORTOOLS_PYTHON_VERSION/py3-ortools/' temp$Sortools$Ssetup.py
else
$(SED) -i -e 's/ORTOOLS_PYTHON_VERSION/ortools/' temp$Sortools$Ssetup.py
endif
$(SED) -i -e 's/VVVV/$(OR_TOOLS_VERSION)/' temp$Sortools$Ssetup.py
$(SED) -i -e 's/PROTOBUF_TAG/$(PROTOBUF_TAG)/' temp$Sortools$Ssetup.py
ifeq ($(SYSTEM),win)
@@ -308,68 +313,6 @@ else
endif
endif
pypi3_archive: python $(PATCHELF)
-$(DELREC) temp
$(MKDIR) temp
$(MKDIR) temp$Sortools
$(MKDIR) temp$Sortools$Sortools
$(MKDIR) temp$Sortools$Sortools$Sconstraint_solver
$(MKDIR) temp$Sortools$Sortools$Slinear_solver
$(MKDIR) temp$Sortools$Sortools$Sgraph
$(MKDIR) temp$Sortools$Sortools$Salgorithms
$(MKDIR) temp$Sortools$Sdummy
$(COPY) src$Sgen$Sortools$Sconstraint_solver$S*.py temp$Sortools$Sortools$Sconstraint_solver
$(COPY) src$Sortools$Slinear_solver$S*.py temp$Sortools$Sortools$Slinear_solver
$(COPY) src$Sgen$Sortools$Slinear_solver$S*.py temp$Sortools$Sortools$Slinear_solver
$(COPY) src$Sgen$Sortools$Sgraph$Spywrapgraph.py temp$Sortools$Sortools$Sgraph
$(COPY) src$Sgen$Sortools$Salgorithms$Spywrapknapsack_solver.py temp$Sortools$Sortools$Salgorithms
$(COPY) $(GEN_DIR)$Sortools$S__init__.py temp$Sortools$Sortools$S__init__.py
$(SED) -i -e 's/VVVV/$(OR_TOOLS_VERSION)/' temp$Sortools$Sortools$S__init__.py
$(TOUCH) temp$Sortools$Sortools$Sconstraint_solver$S__init__.py
$(TOUCH) temp$Sortools$Sortools$Slinear_solver$S__init__.py
$(TOUCH) temp$Sortools$Sortools$Sgraph$S__init__.py
$(TOUCH) temp$Sortools$Sortools$Salgorithms$S__init__.py
$(COPY) tools$Sdummy_ortools_dependency.cc temp$Sortools$Sdummy
$(COPY) tools$SREADME.pypi temp$Sortools$SREADME.txt
$(COPY) LICENSE-2.0.txt temp$Sortools
$(COPY) tools$Ssetup_py3.py temp$Sortools$Ssetup.py
$(SED) -i -e 's/VVVV/$(OR_TOOLS_VERSION)/' temp$Sortools$Ssetup.py
$(SED) -i -e 's/PROTOBUF_TAG/$(PROTOBUF_TAG)/' temp$Sortools$Ssetup.py
ifeq ($(SYSTEM),win)
copy src\gen\ortools\constraint_solver\_pywrapcp.pyd temp$Sortools$Sortools$Sconstraint_solver
copy src\gen\ortools\linear_solver\_pywraplp.pyd temp$Sortools$Sortools$Slinear_solver
copy src\gen\ortools\graph\_pywrapgraph.pyd temp$Sortools$Sortools$Sgraph
copy src\gen\ortools\algorithms\_pywrapknapsack_solver.pyd temp$Sortools$Sortools$Salgorithms
$(SED) -i -e 's/\.dll/\.pyd/' temp/ortools/setup.py
$(SED) -i -e '/DELETEWIN/d' temp/ortools/setup.py
$(SED) -i -e 's/DELETEUNIX/ /g' temp/ortools/setup.py
-del temp\ortools\setup.py-e
else
cp lib/_pywrapcp.$(SWIG_LIB_SUFFIX) temp/ortools/ortools/constraint_solver
cp lib/_pywraplp.$(SWIG_LIB_SUFFIX) temp/ortools/ortools/linear_solver
cp lib/_pywrapgraph.$(SWIG_LIB_SUFFIX) temp/ortools/ortools/graph
cp lib/_pywrapknapsack_solver.$(SWIG_LIB_SUFFIX) temp/ortools/ortools/algorithms
cp lib/libortools.$(LIB_SUFFIX) temp/ortools/ortools
$(SED) -i -e 's/\.dll/\.so/' temp/ortools/setup.py
$(SED) -i -e 's/DELETEWIN //g' temp/ortools/setup.py
$(SED) -i -e '/DELETEUNIX/d' temp/ortools/setup.py
$(SED) -i -e 's/DLL/$(LIB_SUFFIX)/g' temp/ortools/setup.py
-rm temp/ortools/setup.py-e
ifeq ($(PLATFORM),MACOSX)
tools/fix_python_libraries_on_mac.sh
endif
ifeq ($(PLATFORM),LINUX)
tools/fix_python_libraries_on_linux.sh
endif
endif
ifeq ($(PYTHON3),true)
PYPI_ARCHIVE=pypi3_archive
else
PYPI_ARCHIVE=pypi2_archive
endif
pypi_archive: $(PYPI_ARCHIVE)
pypi_upload: $(PYPI_UPLOAD)
detect_python:

View File

@@ -333,7 +333,7 @@ dependencies\sources\cbc-$(CBC_TAG)\Cbc\MSVisualStudio\v10\$(CBC_PLATFORM)\cbc.e
tools\upgrade_vs_project.cmd dependencies\\sources\\cbc-$(CBC_TAG)\\Osi\\MSVisualStudio\\v10\\libOsi\\libOsi.vcxproj $(VS_RELEASE)
tools\upgrade_vs_project.cmd dependencies\\sources\\cbc-$(CBC_TAG)\\CoinUtils\\MSVisualStudio\\v10\\libCoinUtils\\libCoinUtils.vcxproj $(VS_RELEASE)
tools\upgrade_vs_project.cmd dependencies\\sources\\cbc-$(CBC_TAG)\\Cgl\\MSVisualStudio\\v10\\libCgl\\libCgl.vcxproj $(VS_RELEASE)
sed -i 's/CBC_BUILD;/CBC_BUILD;CBC_THREAD_SAFE;CBC_NO_INTERRUPT;/g' dependencies\\sources\\cbc-$(CBC_TAG)\\Cbc\\MSVisualStudio\\v10\\libCbcSolver\\libCbcSolver.vcxproj
tools\sed -i 's/CBC_BUILD;/CBC_BUILD;CBC_THREAD_SAFE;CBC_NO_INTERRUPT;/g' dependencies\\sources\\cbc-$(CBC_TAG)\\Cbc\\MSVisualStudio\\v10\\libCbcSolver\\libCbcSolver.vcxproj
cd dependencies\sources\cbc-$(CBC_TAG)\Cbc\MSVisualStudio\v10 && msbuild Cbc.sln /t:cbc /p:Configuration=Release;BuildCmd=ReBuild
dependencies\sources\cbc-$(CBC_TAG)\configure:

BIN
tools/Google.Protobuf.dll Executable file → Normal file

Binary file not shown.

View File

@@ -4,9 +4,9 @@ archive.
OR-Tools is located at https://developers.google.com/optimization
These modules have been tested under:
- ubuntu 14.04 and up (32 and 64 bit).
- Mac OS X El Capitan and up with xcode 4.x (64 bit).
- Microsoft Visual studio 2013 and 2015 (32 and 64 bit).
- Ubuntu 14.04 and 16.04 up (64-bit).
- Mac OS X El Capitan with Xcode 7.x (64 bit).
- Microsoft Windows with Visual Studio 2013 and 2015 (64-bit)
Upon decompressing the archive, you will get the following structure:

View File

@@ -3,9 +3,9 @@ This file describes how to use the or-tools .NET binary archive.
OR-Tools is located at https://developers.google.com/optimization
These modules have been tested under:
- ubuntu 14.04 and up (32 and 64 bit).
- Mac OS X El Capitan and up with xcode 4.x (64 bit).
- Microsoft Visual studio 2013 and 2015 (32 and 64 bit).
- Ubuntu 14.04 and 16.04 up (64-bit).
- Mac OS X El Capitan with Xcode 7.x (64 bit).
- Microsoft Windows with Visual Studio 2013 and 2015 (64-bit)
Upon decompressing the archive, you will get the following structure:

View File

@@ -3,9 +3,9 @@ This file describes how to install the or-tools python binary archive.
OR-Tools is located at https://developers.google.com/optimization
These modules have been tested under:
- ubuntu 14.04 and up (32 and 64 bit).
- Mac OS X El Capitan with xcode 4.x (64 bit).
- Microsoft Windows with Visual Studio 2013 and 2015 (64 bit).
- Ubuntu 14.04 and 16.04 up (64-bit).
- Mac OS X El Capitan with Xcode 7.x (64 bit).
- Microsoft Windows with Visual Studio 2013 and 2015 (64-bit)
Upon decompressing the archive, you will get the following structure:

View File

@@ -26,7 +26,7 @@ DELETEUNIX extra_link_args=['/MANIFEST'],
)
setup(
name='ortools',
name='ORTOOLS_PYTHON_VERSION',
version='VVVV',
packages=[
'ortools',
@@ -63,6 +63,9 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Office/Business :: Scheduling',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',

View File

@@ -1,71 +0,0 @@
from sys import executable
setuptools_import_error_message = """setuptools is not installed for """ + executable + """
Please follow this link for installing instructions :
https://pypi.python.org/pypi/setuptools
make sure you use \"""" + executable + """\" during the installation"""
try:
from setuptools import setup, Extension
except ImportError:
raise ImportError(setuptools_import_error_message)
from os.path import join as pjoin
from os.path import dirname
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(pjoin(dirname(__file__), fname)).read()
dummy_module = Extension('dummy_ortools_dependency',
sources = ['dummy/dummy_ortools_dependency.cc'],
DELETEUNIX extra_link_args=['/MANIFEST'],
)
setup(
name='py3-ortools',
version='VVVV',
packages=[
'ortools',
'ortools.algorithms',
'ortools.constraint_solver',
'ortools.graph',
'ortools.linear_solver',],
ext_modules = [dummy_module],
install_requires = [
'protobuf >= PROTOBUF_TAG'],
package_data = {
'ortools.constraint_solver' : ['_pywrapcp.dll'],
'ortools.linear_solver' : ['_pywraplp.dll'],
'ortools.graph' : ['_pywrapgraph.dll'],
'ortools.algorithms' : ['_pywrapknapsack_solver.dll'],
DELETEWIN 'ortools' : ['libortools.DLL']
},
license='Apache 2.0',
author = 'Google Inc',
author_email = 'lperron@google.com',
description = 'Google OR-Tools python libraries and modules',
keywords = ('operations research, constraint programming, ' +
'linear programming,' + 'flow algorithms,' +
'python'),
url = 'https://developers.google.com/optimization/',
download_url = 'https://github.com/google/or-tools/releases',
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Office/Business :: Scheduling',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development :: Libraries :: Python Modules'],
long_description = read('README.txt'),
)