-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gem5, m5ops: init at 24.1.0.1 #375739
Open
mtoohey31
wants to merge
1
commit into
NixOS:master
Choose a base branch
from
mtoohey31:gem5
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
gem5, m5ops: init at 24.1.0.1 #375739
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,12 @@ | ||
diff --git a/src/base/random.hh b/src/base/random.hh | ||
index 0b287f95052..b3550a0f3df 100644 | ||
--- a/src/base/random.hh | ||
+++ b/src/base/random.hh | ||
@@ -45,6 +45,7 @@ | ||
#ifndef __BASE_RANDOM_HH__ | ||
#define __BASE_RANDOM_HH__ | ||
|
||
+#include <algorithm> | ||
#include <random> | ||
#include <string> | ||
#include <type_traits> |
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,53 @@ | ||
{ | ||
fetchFromGitHub, | ||
glibc, | ||
isa ? "x86", | ||
lib, | ||
scons, | ||
stdenv, | ||
}: | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "m5ops-${isa}"; | ||
version = "24.1.0.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "gem5"; | ||
repo = "gem5"; | ||
tag = "v${finalAttrs.version}"; | ||
hash = "sha256-Q7+LuCGUINvsuF7GyiEC7/veADTVi1FpkUXajl2TDkA="; | ||
}; | ||
|
||
nativeBuildInputs = [ scons ]; | ||
|
||
buildInputs = [ glibc.static ]; | ||
|
||
sourceRoot = "source/util/m5"; | ||
|
||
buildFlags = [ "build/${isa}/out/m5" ]; | ||
|
||
# Needed so the build script doesn't hide all Nix environment variables. | ||
postPatch = '' | ||
substituteInPlace SConstruct \ | ||
--replace-fail "Environment()" "Environment(ENV=os.environ)" | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
|
||
mkdir -p $out/{bin,lib} | ||
cp build/${isa}/out/m5 $out/bin/ | ||
cp build/${isa}/out/libm5.a $out/lib/ | ||
cp -r ../../include $out/include | ||
|
||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "Special instructions for gem5"; | ||
homepage = "https://www.gem5.org/"; | ||
license = lib.licenses.bsd3; | ||
platforms = lib.platforms.linux; | ||
maintainers = [ lib.maintainers.mtoohey ]; | ||
}; | ||
}) |
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,76 @@ | ||
{ | ||
boost, | ||
capstone, | ||
fetchFromGitHub, | ||
gperftools, | ||
hdf5-cpp, | ||
isa ? "X86", | ||
lib, | ||
libpng, | ||
m4, | ||
protobuf_21, | ||
python3, | ||
scons, | ||
stdenv, | ||
variant ? "opt", | ||
zlib, | ||
}: | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "gem5-${isa}-${variant}"; | ||
version = "24.1.0.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "gem5"; | ||
repo = "gem5"; | ||
tag = "v${finalAttrs.version}"; | ||
hash = "sha256-Q7+LuCGUINvsuF7GyiEC7/veADTVi1FpkUXajl2TDkA="; | ||
}; | ||
|
||
# Needed to make the current release compile, see: | ||
# https://github.com/gem5/gem5/pull/1897 (the PR was rejected, but there is no | ||
# release with the fix). | ||
patches = [ ./include-algorithm.patch ]; | ||
|
||
nativeBuildInputs = [ | ||
m4 | ||
python3 | ||
scons | ||
]; | ||
|
||
buildInputs = [ | ||
boost | ||
capstone | ||
gperftools # provides tcmalloc | ||
hdf5-cpp | ||
libpng | ||
protobuf_21 | ||
zlib | ||
]; | ||
|
||
buildFlags = [ "build/${isa}/gem5.${variant}" ]; | ||
|
||
enableParallelBuilding = true; | ||
|
||
preBuild = '' | ||
patchShebangs . | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
|
||
mkdir -p $out/bin | ||
cp build/${isa}/gem5.${variant} $out/bin/ | ||
|
||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "A modular platform for computer-system architecture research"; | ||
homepage = "https://www.gem5.org/"; | ||
license = lib.licenses.bsd3; | ||
platforms = lib.platforms.linux; | ||
mainProgram = "gem5.${variant}"; | ||
maintainers = [ lib.maintainers.mtoohey ]; | ||
}; | ||
}) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried removing it and I get a missing attribute error. I think it's because I'm using a non-standard name within the gem5 parent directory. I put the package in there cause it's very closely related and should pretty much always be used with gem5 even though the builds are separate.
Should I put it in its own directory or is it fine to leave this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right, it needs to be package.nix. To be honest, I'm not sure. It probably needs its own directory, but someone more knowledgeable than me should answer that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 ok. If you search for
by-name.*\{ \}
inall-packages.nix
there are a couple other examples of this, so I'll leave it for now, but if someone has more information about the correct layout lmk.