Skip to content

Commit

Permalink
Merge pull request #8 from zivnevo/or_tools_mac_support
Browse files Browse the repository at this point in the history
Or tools mac support
  • Loading branch information
shlomitk1 authored Dec 15, 2022
2 parents 03ea624 + 2c2aef4 commit faa5432
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*.exe
*.exe~
*.dll
*.so
*.so*
*.dylib
bin

Expand Down
1 change: 1 addition & 0 deletions hack/make-rules/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ $(TOOLBIN)/json-schema-generator:
install-tools: $(INSTALL_TOOLS)
go mod tidy
ls -l $(TOOLS_DIR)/bin
ls -l $(TOOLS_DIR)/lib

.PHONY: uninstall-tools
uninstall-tools:
Expand Down
12 changes: 7 additions & 5 deletions hack/tools/install_or_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ source ./common.sh
case ${os} in
linux)
target_os=ubuntu-18.04
dyn_lib_ext=so
;;
darwin)
arch=""
target_os=MacOsX-12.2.1
arch=`uname -m`
target_os=macOS-13.0.1
dyn_lib_ext=dylib
;;
esac

Expand All @@ -24,11 +26,11 @@ header_text "Installing bin/fzn-or-tools ${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}"
mkdir -p ./bin
mkdir -p ./lib

download_file=or-tools_${arch}_flatzinc_${target_os}_v${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}.tar.gz
download_file=or-tools_${arch}_${target_os}_cpp_v${OR_TOOLS_VERSION}.${OR_TOOLS_BUILD}.tar.gz
curl -L -O https://github.com/google/or-tools/releases/download/v${OR_TOOLS_VERSION}/${download_file}
trap "rm ${download_file}" err exit
tmp=$(mktemp -d /tmp/or-tools.XXXXXX)
tar -zxvf ./${download_file} -C $tmp
mv $tmp/*/bin/fzn-or-tools ./bin
mv $tmp/*/lib/lib*.so ./lib
mv $tmp/*/bin/fzn-ortools ./bin/fzn-or-tools
mv $tmp/*/lib/lib*.${dyn_lib_ext}* ./lib
chmod +x ./bin/fzn-or-tools
4 changes: 2 additions & 2 deletions hack/tools/requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ KUBE_VERSION=1.22.0
KUSTOMIZE_VERSION=3.2.0
OC_VERSION=4.2.19
OPA_VERSION=0.41.0
OR_TOOLS_VERSION=9.2
OR_TOOLS_BUILD=9972
OR_TOOLS_VERSION=9.5
OR_TOOLS_BUILD=2237
VAULT_VERSION=1.8.9
YQ_VERSION=4.6.0
KUBEVAL_VERSION=0.16.1
Expand Down
2 changes: 1 addition & 1 deletion pkg/optimizer/optimizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestOptimizer(t *testing.T) {
opt := NewOptimizer(env, getDataInfo(env), os.Getenv("CSP_PATH"), &testLog)
solution, err := opt.Solve()
if err != nil {
t.Fatalf("Failed solving constraint problem: %s", err)
t.Fatalf("Failed solving constraint problem: %v", err)
}

solutionLen := len(solution.DataPath)
Expand Down

0 comments on commit faa5432

Please sign in to comment.