forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from AirspaceTechnologies/AT-8842
AT-8842: README + SWIG 4.0.1
- Loading branch information
Showing
3 changed files
with
60 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Airspace Golang Wrapper Repo for OR-Tools | ||
|
||
This is a fork of [Google's OR-Tools repo](https://github.com/google/or-tools). | ||
It has Go bindings and binaries for use with Go projects. | ||
|
||
## Mac Setup for Local Go Development | ||
1. Download binaries for Mac: | ||
`https://github.com/AirspaceTechnologies/or-tools/releases/download/v7.6-go1.14.1/or-tools_MacOsX-10.15.4_v7.6.7696.tar.gz` | ||
1. Install/extract to rpath (e.g. `/usr/local`) | ||
1. Download and install Go package `go get github.com/airspace/technologies/or-tools/gen/ortools/go/constraintsolver` | ||
1. Use in Go code. E.g. `import github.com/airspacetechnologies/or-tools/gen/ortools/go/constraintsolver` | ||
|
||
## Mac Setup for Local OR-tools Development (Extending/Wrapping OR-tools) | ||
1. Install XCode: | ||
`xcode-select install` | ||
1. Install C++ tools: | ||
`brew install cmake wget pkg-config` | ||
1. Install SWIG 4.0.1: | ||
`brew install swig` | ||
1. Install protobuf for Go: | ||
`go get github.com/golang/protobuf/[email protected]` | ||
1. Clone Airspace OR-tools: | ||
`git clone [email protected]:AirspaceTechnologies/or-tools.git` | ||
1. Make third party: | ||
`make third_party` | ||
1. Make go: | ||
`make clean_go go` | ||
1. Make go tests: | ||
`make test_go` | ||
|
||
## Build and Release | ||
1. Follow steps above (`Mac Setup for Local OR-tools Development`) | ||
1. Make Debian binary archive (takes ~45 mins, uses Docker to build everything from scratch): | ||
`make --directory=makefiles debian_go_export` | ||
1. Make local Mac binary archive: | ||
`make golib_archive` | ||
1. Log into Github and create a release with the resulting binaries | ||
|
||
## TODO | ||
1. Make `IntVar`->`IntExpr` casting cleaner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,26 @@ LABEL maintainer="[email protected]" | |
# Install system build dependencies | ||
ENV PATH=/usr/local/bin:$PATH | ||
RUN apt-get update -qq \ | ||
&& apt-get install -yq \ | ||
git wget libssl-dev pkg-config build-essential \ | ||
autoconf libtool zlib1g-dev lsb-release \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
&& apt-get install -yq \ | ||
git wget libssl-dev pkg-config build-essential \ | ||
autoconf libtool zlib1g-dev lsb-release \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
# Install CMake 3.16.4 | ||
RUN wget "https://cmake.org/files/v3.16/cmake-3.16.4-Linux-x86_64.sh" \ | ||
&& chmod a+x cmake-3.16.4-Linux-x86_64.sh \ | ||
&& ./cmake-3.16.4-Linux-x86_64.sh --prefix=/usr/local/ --skip-license \ | ||
&& rm cmake-3.16.4-Linux-x86_64.sh | ||
&& chmod a+x cmake-3.16.4-Linux-x86_64.sh \ | ||
&& ./cmake-3.16.4-Linux-x86_64.sh --prefix=/usr/local/ --skip-license \ | ||
&& rm cmake-3.16.4-Linux-x86_64.sh | ||
CMD [ "/bin/bash" ] | ||
|
||
# Install SWIG 4.0.1 (currently testing) | ||
FROM base AS swig | ||
RUN echo 'Package: * \nPin: release a=stable \nPin-Priority: 900' > /etc/apt/preferences.d/stable.pref \ | ||
&& echo 'Package: * \nPin: release a=testing \nPin-Priority: 400' > /etc/apt/preferences.d/testing.pref \ | ||
&& mv /etc/apt/sources.list /etc/apt/sources.list.d/stable.list \ | ||
&& echo 'deb http://deb.debian.org/debian testing main \ndeb http://deb.debian.org/debian testing-updates main' \ | ||
> /etc/apt/sources.list.d/testing.list | ||
RUN apt-get update -qq \ | ||
&& apt-get install -yq swig \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
&& apt-get install -yq swig/testing \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,12 @@ ENV GOROOT=/usr/local/go | |
ENV GOPATH=/home/go | ||
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin | ||
ENV GO111MODULE=on | ||
RUN apt-get update -qq \ | ||
&& wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz \ | ||
RUN wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz \ | ||
&& mkdir -p /usr/local/go \ | ||
&& mkdir -p /home/go \ | ||
&& tar -xvf go1.14.1.linux-amd64.tar.gz -C /usr/local \ | ||
&& rm -rf go1.14.1.linux-amd64.tar.gz \ | ||
&& go get github.com/golang/protobuf/[email protected] \ | ||
&& apt-get install -yq \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
&& go get github.com/golang/protobuf/[email protected] | ||
RUN make -version | ||
|
||
FROM env AS devel | ||
|
@@ -21,7 +17,7 @@ COPY . . | |
|
||
FROM devel AS build | ||
RUN make third_party | ||
RUN make clean_go install_go | ||
RUN make clean_go go | ||
RUN ldconfig | ||
|
||
FROM build AS test | ||
|