rust-or / highs-sys

Rust binding for the HiGHS linear programming solver
https://docs.rs/highs-sys
10 stars 16 forks source link

Build Error when building release with debug info for profiling. #11

Closed Thell closed 8 months ago

Thell commented 1 year ago
-- Build files have been written to: C:/Users/thell/Workspaces/bdo/housecraft/target/release/build/highs-sys-92234839f67e8789/out/build
  running: "cmake" "--build" "." "--target" "install" "--config" "RelWithDebInfo" "--parallel" "16"
  MSBuild version 17.5.1+f6fdcf537 for .NET Framework

    Checking Build System
    Building Custom Rule C:/Users/thell/.cargo/git/checkouts/highs-sys-libz-228d8310235e4834/1ed2664/HiGHS/src/CMakeLists.txt
  cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Users\thell\Workspaces\bdo\housecraft\target\release\build\highs-sys-92234839f67e8789\out\build\src\libhighs.vcxproj]

Builds just fine without

[profile.release]
debug = 1

According to MSDN

If you compile your program at the command line using any of the /RTC compiler options, any pragma optimize instructions in your code silently fail. That's because run-time error checks aren't valid in a release (optimized) build. Use /RTC for development builds; Don't use /RTC for a release build. /RTC can't be used with compiler optimizations (/O Options (Optimize Code)). A program image built with /RTC is slightly larger and slightly slower than an image built with /Od (up to 5 percent slower than an /Od build).

Perhaps something could be passed to CMake for the HiGHs build?

galabovaa commented 8 months ago

Fixed in https://github.com/ERGO-Code/HiGHS/tree/latest, will be included in our upcoming release.

Thell commented 8 months ago

Confirmed to be working. See https://github.com/rust-or/highs-sys/issues/13