Closed zhli12 closed 3 years ago
Weird, I would have expected the build script to panic if it couldn't find Gurobi. I have a couple of questions:
GUROBI_HOME
, and to what?cargo clean && cargo build -v
, what are the rustc
invocations for grb
and grb-sys2
? There should be output lines like:
Running `rustc --crate-name grb_sys2 ...
Running `rustc --crate-name grb ...
Thanks for your reply!
GUROBI_HOME
in the file .bash_profile
. The codes I used are
export GRB_LICENSE_FILE="/Users/zhli12/gurobi.lic" export GUROBI_HOME="/Library/gurobi912/mac64"
gurobi = "0.3.4"
in the toml filecargo run --verbose
, there was one line showing
Running
rustc --crate-name gurobi_demo`. I'm not sure this is what you are referring to, though where "gurobi_demo" happens to be the folder namae that contains the rs file. error: linking with
ccfailed: exit code: 1 | = note: "cc" "-m64" "-arch" "x86_64" "-L" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.0.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.1.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.10.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.11.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.12.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.13.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.14.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.15.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.2.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.3.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.4.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.5.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.6.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.7.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.8.rcgu.o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.gurobi_demo.4izfv2id-cgu.9.rcgu.o" "-o" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/gurobi_demo.ld2itfaztnvkbmt.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps" "-L" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/libgurobi-b899937133421dfd.rlib" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/libitertools-74607c886604da7d.rlib" "/Users/zhli12/Desktop/gurobi_demo-main/target/debug/deps/libgurobi_sys-86dcb0d310a1deaa.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-9225b8e469c32698.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-2fe2b8cd4fa63c34.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-80083cf4ee7ee3ff.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-ddf3832e718029e6.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-ba92c986e8ef2ca8.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-acd0bd456d8da820.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-55608c4156e4ecbb.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-4be618026614fdc7.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-fee25922260aa100.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-38ba3c5cc408e14d.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-899852a009fbe35f.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-5687564a0ccea916.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-9ed2c58b16cff4ee.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-244bf5611f93ff45.rlib" "/Users/zhli12/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-70df686e6b4ebf5b.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv"
It looks like you are using the gurobi
crate, not the grb
crate (this crate). I forked the gurobi
crate because it had issues and didn't seem to be maintained. If you want to try compiling with this crate, change the gurobi = 0.3.4
line in your Cargo.toml
to grb = ^1.0.4
.
The version of the Gurobi solver (most recent is 9.1) won't be in Cargo.toml
, but will be in the output of gurobi_cl --version
.
Thank you! I solved the problem by resetting the environmental variable
Hi,
I am using MacOS and I have set
GUROBI_HOME
to Gurobi's path. However, when running it on Rust, I received an error saying" linking with
cc
failed: exit code: 1 "with a note starting with " note: "cc" "-m64" "-arch" "x86_64" "-L" ".
After some researching online I'm still unable to pinpoint or fix the problem, so I'd really appreciate any help with it.