Skip to content
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

util, ext: Fix building TLM #1105

Merged
merged 2 commits into from
May 24, 2024
Merged

util, ext: Fix building TLM #1105

merged 2 commits into from
May 24, 2024

Conversation

Lukas-Zenick
Copy link

@Lukas-Zenick Lukas-Zenick commented May 5, 2024

Fixed the issue that did not allow building TLM.

Build commands:

scons build/ARM/gem5.opt
scons setconfig build/ARM USE_SYSTEMC=n
scons --with-cxx-config --without-python --without-tcmalloc build/ARM/libgem5_opt.so
cd util/tlm
scons

Following this README, I tested it succeeds with the simple examples:
https://gem5.googlesource.com/public/gem5/+/master/util/tlm/README

GitHub Issue: #591
Change-Id: If07fae2eb20ad62627e733573f61bc42d594f970

Change-Id: If07fae2eb20ad62627e733573f61bc42d594f970
@giactra
Copy link
Contributor

giactra commented May 6, 2024

Hi @Lukas-Zenick, first of all thank you so much for the fix. I’d like to point out though the title of the issue you addressed is probably not correct. I believe the compilation error happens for non Arm simulations as well, it’s just that lots of the TLM doc has been written with Arm as an example.
For this reason I would consider changing the tags in the PR and commit title from arch-arm to util,ext

@Lukas-Zenick Lukas-Zenick changed the title arch-arm: Fix building TLM with ARM util, ext: Fix building TLM May 6, 2024
@ivanaamit ivanaamit added util Utilities for gem5. Typically found in "util" ext Components external to gem5 such as third-party code. Typically found in "ext" labels May 6, 2024
@Lukas-Zenick
Copy link
Author

Lukas-Zenick commented May 7, 2024

@ivanaamit Would it be possible to get these changes merged into develop by tomorrow? I have a project deadline and it's worth more for my grade if it gets merged in. If it still needs more intensive review then no worries.

Harshil2107
Harshil2107 previously approved these changes May 7, 2024
Copy link
Contributor

@Harshil2107 Harshil2107 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a expert at scons stuff but this lgtm.

Copy link
Contributor

@giactra giactra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Lukas-Zenick we can merge it quickly but there's one actionable item on my side

Comment on lines 69 to 71
AddOption('--duplicate-sources', action='store_true', default=False,
dest='duplicate_sources',
help='Create symlinks to sources in the build directory')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this one as the option is already present below (see --no-duplicate-sources). You just need to bump the option over here before it is used

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "bump the option over here before it is used"? What I was referencing for this code was the main gem5 SConstruct file which has the following on line 145:

AddOption('--duplicate-sources', action='store_true', default=False,
          dest='duplicate_sources',
          help='Create symlinks to sources in the build directory')
AddOption('--no-duplicate-sources', action='store_false',
          dest='duplicate_sources',
          help='Do not create symlinks to sources in the build directory')

so I just assumed that you would always need to define both flags

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to define both options. You just need to move the following code:

AddOption('--no-duplicate-sources', action='store_false',
          dest='duplicate_sources',
          help='Do not create symlinks to sources in the build directory')

To line 69.

@@ -44,6 +44,7 @@ env = Environment()

#Make the gem5 root available in SConscripts
env['GEM5_ROOT'] = gem5_root
env['GEM5BUILD'] = os.path.join(gem5_root, 'build')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note: this won't work with kconfig based builds where the build directory is not necessarily in "build" and can have different names (see https://www.gem5.org/documentation/general_docs/kconfig_build_system/ ). Anyway I am ok on merging this for now as long as we document this issue

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, do I need to do anything specific in terms of documentation aside from having a code comment that specifies that it is not compatible with kconfig builds?

@ivanaamit ivanaamit added this to the v24.0 milestone May 21, 2024
Change-Id: I36da18e8e8f6b587d66bfb33df069d297d0c74d2
@ivanaamit
Copy link
Contributor

Hi @giactra, could you please re-review this PR? I have applied the changes you requested. Let me know if you would like me to create an issue about the code not being compatible with Kconfig builds. Thanks.

@giactra
Copy link
Contributor

giactra commented May 24, 2024

Hi @giactra, could you please re-review this PR? I have applied the changes you requested. Let me know if you would like me to create an issue about the code not being compatible with Kconfig builds. Thanks.

Thanks @ivanaamit .
I think the remaining issue is that both commit are wrongly tagged as arch-arm. They should rather be util or ext or util,ext depending on the affected subdirectories

@ivanaamit
Copy link
Contributor

I am getting a "permission denied" message when trying to rebase.

@giactra, if you could approve this PR, I will then do a "squash and merge" and change the commit message directly on GitHub.

@ivanaamit ivanaamit merged commit 96fbc20 into gem5:develop May 24, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext Components external to gem5 such as third-party code. Typically found in "ext" util Utilities for gem5. Typically found in "util"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants