-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing `etc/shell.nix`, this is a [flake](https://nixos.wiki/wiki/Flakes) based on the OpenROAD Nix derivation used for OpenLane 2. With Nix installed with flakes enabled, getting an OpenROAD environment is as simple as typing `nix develop`. Also fixes issue with versions of OpenROAD built in the dev environments failing to launch the GUI. Signed-off-by: Mohamed Gaber <[email protected]>
- Loading branch information
Showing
4 changed files
with
201 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
############################################################################### | ||
## | ||
## BSD 3-Clause License | ||
## | ||
## Copyright (c) 2023-2024, Efabless Corporation | ||
## All rights reserved. | ||
## | ||
## Redistribution and use in source and binary forms, with or without | ||
## modification, are permitted provided that the following conditions are met: | ||
## | ||
## * Redistributions of source code must retain the above copyright notice, this | ||
## list of conditions and the following disclaimer. | ||
## | ||
## * Redistributions in binary form must reproduce the above copyright notice, | ||
## this list of conditions and the following disclaimer in the documentation | ||
## and#or other materials provided with the distribution. | ||
## | ||
## * Neither the name of the copyright holder nor the names of its | ||
## contributors may be used to endorse or promote products derived from | ||
## this software without specific prior written permission. | ||
## | ||
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
## POSSIBILITY OF SUCH DAMAGE. | ||
## | ||
############################################################################### | ||
{ | ||
lib, | ||
clangStdenv, | ||
fetchFromGitHub, | ||
libsForQt5, | ||
boost183, | ||
eigen, | ||
cudd, | ||
ninja, | ||
tcl, | ||
python3, | ||
readline, | ||
tclreadline, | ||
spdlog, | ||
libffi, | ||
llvmPackages, | ||
lemon-graph, | ||
or-tools, | ||
glpk, | ||
zlib, | ||
clp, | ||
cbc, | ||
re2, | ||
swig4, | ||
pkg-config, | ||
cmake, | ||
gnumake, | ||
flex, | ||
bison, | ||
clang-tools_14, | ||
# or-tools | ||
stdenv, | ||
overrideSDK, | ||
}: let | ||
or-tools' = | ||
(or-tools.override { | ||
## Alligned alloc not available on the default SDK for x86_64-darwin (10.12!!) | ||
stdenv = | ||
if stdenv.isDarwin | ||
then (overrideSDK stdenv "11.0") | ||
else stdenv; | ||
}) | ||
.overrideAttrs (finalAttrs: previousAttrs: { | ||
# Based on https://github.com/google/or-tools/commit/af44f98dbeb905656b5a9fc664b5fdcffcbe1f60 | ||
# Stops CMake going haywire on reconfigures | ||
postPatch = | ||
previousAttrs.postPatch | ||
+ '' | ||
sed -Ei.bak 's/(NOT\s+\w+_FOUND\s+AND\s+)+//' cmake/ortoolsConfig.cmake.in | ||
sed -Ei.bak 's/NOT absl_FOUND/NOT TARGET absl::base/' cmake/ortoolsConfig.cmake.in | ||
''; | ||
}); | ||
self = clangStdenv.mkDerivation (finalAttrs: { | ||
name = "openroad"; | ||
|
||
src = ./.; | ||
|
||
cmakeFlags = [ | ||
"-DTCL_LIBRARY=${tcl}/lib/libtcl${clangStdenv.hostPlatform.extensions.sharedLibrary}" | ||
"-DTCL_HEADER=${tcl}/include/tcl.h" | ||
"-DUSE_SYSTEM_BOOST:BOOL=ON" | ||
"-DVERBOSE=1" | ||
]; | ||
|
||
qt5Libs = [ | ||
libsForQt5.qt5.qtbase | ||
libsForQt5.qt5.qtcharts | ||
libsForQt5.qt5.qtsvg | ||
libsForQt5.qt5.qtdeclarative | ||
]; | ||
|
||
QT_PLUGIN_PATH = lib.makeSearchPathOutput "bin" "lib/qt-${libsForQt5.qt5.qtbase.version}/plugins" self.qt5Libs; | ||
|
||
buildInputs = self.qt5Libs ++ [ | ||
boost183 | ||
eigen | ||
cudd | ||
tcl | ||
python3 | ||
readline | ||
tclreadline | ||
spdlog | ||
libffi | ||
llvmPackages.openmp | ||
|
||
lemon-graph | ||
or-tools' | ||
glpk | ||
zlib | ||
clp | ||
cbc | ||
re2 | ||
]; | ||
|
||
nativeBuildInputs = [ | ||
swig4 | ||
pkg-config | ||
cmake | ||
ninja | ||
gnumake | ||
flex | ||
bison | ||
libsForQt5.wrapQtAppsHook | ||
clang-tools_14 | ||
]; | ||
}); | ||
in | ||
self |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# To get dependencies and build in a Nix environment: | ||
# 1. Install Nix: https://github.com/DeterminateSystems/nix-installer | ||
# 2. Invoke `nix develop` in your shell. First invocation will | ||
# take around 5 minutes depending on your internet connection and | ||
# CPU speed. | ||
# 3. `cd build` | ||
# 4. `cmake -G Ninja $cmakeFlags ..` | ||
# 5. `ninja` | ||
# 6. `wrapQtApp ./src/openroad` | ||
{ | ||
inputs = { | ||
nixpkgs.url = github:nixos/nixpkgs/nixos-24.05; | ||
}; | ||
|
||
outputs = {nixpkgs, ...}: { | ||
packages = nixpkgs.lib.genAttrs [ | ||
"x86_64-linux" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"aarch64-darwin" | ||
] ( | ||
system: let | ||
pkgs = import nixpkgs {inherit system;}; | ||
self = { | ||
openroad = (nixpkgs.lib.callPackageWith pkgs) ./default.nix {}; | ||
default = self.openroad; | ||
}; | ||
in | ||
self | ||
); | ||
}; | ||
} |