Skip to content

Commit

Permalink
or-tools: use gcc on linux to avoid abseil/abseil-cpp#1747
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Dec 8, 2024
1 parent 6e276a8 commit b6ec7d1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
in {
or-tools_9_11 = callPackage ./nix/or-tools_9_11.nix {
inherit (pkgs'.darwin) DarwinTools;
clangStdenv =
stdenv =
if pkgs'.system == "x86_64-darwin"
then (pkgs'.overrideSDK pkgs'.clangStdenv "11.0")
else pkgs'.clangStdenv;
then (pkgs'.overrideSDK pkgs'.stdenv "11.0")
else pkgs'.stdenv;
};
colab-env = callPackage ./nix/colab-env.nix {};
opensta = callPackage ./nix/opensta.nix {};
Expand Down
5 changes: 3 additions & 2 deletions nix/openroad.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
ninja,
git,
rev ? "1d610077e69607c430ffedd0dc6034c6af701a39",
rev-date ? "2024-12-05",
sha256 ? "sha256-jkyugDqA5I54Xozdf6xbajCmghNt3rF0srzGMzcKxQ8=",
# environments,
openroad,
Expand All @@ -54,8 +55,8 @@
stdenv = llvmPackages_17.stdenv;
in
stdenv.mkDerivation (finalAttrs: {
name = "openroad";
inherit rev;
pname = "openroad";
version = rev-date;

src = fetchFromGitHub {
owner = "The-OpenROAD-Project";
Expand Down
14 changes: 8 additions & 6 deletions nix/or-tools_9_11.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@
pkg-config,
protobuf,
re2,
clangStdenv,
stdenv,
swig,
unzip,
zlib,
highs,
}:
clangStdenv.mkDerivation (finalAttrs: {
# can't use clang on linux: https://github.com/abseil/abseil-cpp/issues/1747
stdenv.mkDerivation (finalAttrs: {
pname = "or-tools";
version = "9.11";

Expand All @@ -68,16 +69,17 @@ clangStdenv.mkDerivation (finalAttrs: {

cmakeFlags =
[
"-DBUILD_DEPS=OFF"
"-DBUILD_absl=OFF"
"-DBUILD_DEPS:BOOL=OFF"
"-DBUILD_SAMPLES:BOOL=OFF"
"-DBUILD_EXAMPLES:BOOL=OFF"
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DUSE_GLPK=ON"
"-DUSE_SCIP=OFF"
"-DPROTOC_PRG=${protobuf}/bin/protoc"
]
++ lib.optionals clangStdenv.hostPlatform.isDarwin ["-DCMAKE_MACOSX_RPATH=OFF"];
++ lib.optionals stdenv.hostPlatform.isDarwin ["-DCMAKE_MACOSX_RPATH=OFF"];

strictDeps = true;

Expand All @@ -89,7 +91,7 @@ clangStdenv.mkDerivation (finalAttrs: {
swig
unzip
]
++ lib.optionals clangStdenv.hostPlatform.isDarwin [
++ lib.optionals stdenv.hostPlatform.isDarwin [
DarwinTools
];

Expand Down

0 comments on commit b6ec7d1

Please sign in to comment.