scipopt/russcip

unable to compile

hangsuUNC opened this issue · 7 comments

Hi,

I was trying to use russcip example in here. I had a compile issue with the following information:

linking with `cc` failed: exit status: 1

ld: library not found for -lscip
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

should I install a library called -lscip somewhere? Could you provide some suggestions about this?

Thanks,

Hang

Hi @hangsuUNC,
Are you using the bundled feature? if not, you could enable it and it would try to include a prebuilt scip library and link to it automatically. If that doesn't work, you can try other installation methods mentioned here.

Hope that helps!

Yes I use the bundled feature, but still have issues when compile it...

Are you running using cargo run or running the built binary?
Could you also maybe share a minimal example of your crate and which operating system are you using?

I'm running cargo build using Mac Os. For now, even I delete the crates in Cargo.toml, it still fails to compile with the same error. Will look into the system to see what's happenning. Thanks for your help!

After install xcode in the system, I finally able to compile the program with russcip. However, when running the example provided in the repo, I got another error:

dyld[73234]: Library not loaded: libscip.9.0.dylib
Reason: tried: 'libscip.9.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibscip.9.0.dylib' (no such file), 'libscip.9.0.dylib' (no such file), 

I used cargo add russcip --features bundled to installed the crates.

Could you provide some suggestions about this library?

Thanks,

Hang

If you are using cargo run, I don't know why it cannot find the library. Anyway, what I would do is to set where the library is in a build.rs file in your crate that would contain the code mentioned in https://github.com/scipopt/scip-sys#finding-libscip-at-runtime

Thank you! Now the example model works!