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

fix: Link conda lib during CIRCT build #1824

Merged
merged 1 commit into from
Mar 15, 2024
Merged

fix: Link conda lib during CIRCT build #1824

merged 1 commit into from
Mar 15, 2024

Conversation

geekLucian
Copy link
Contributor

I am using FireSim x Chipyard on AWS. Unfortunately, libc on AWS is too old to use firtool installed from conda, so I have to build CIRCT from scratch on AWS.

But during CIRCT build, I got following errors:

/home/centos/chipyard/.conda-env/bin/../lib/gcc/x86_64-conda-linux-gnu/11.4.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/centos/chipyard/.conda-env/lib/libicuuc.so.73: undefined reference to `std::condition_variable::wait(std::unique_lock<std::mutex>&)@GLIBCXX_3.4.30'

I am sure the conda lib is in LD_LIBRARY_PATH, but cmake building process somehow is linking against the wrong libstdc++.so. Add link flag -DCMAKE_EXE_LINKER_FLAGS="-L$RDIR/.conda-env/lib" to cmake will resolve this. (Not sure if this is the most correct way to do so, but this fix works even if user doesn't have conda env created during build-setup)

Related PRs / Issues:

Type of change:

  • Bug fix
  • New feature
  • Other enhancement

Impact:

  • RTL change
  • Software change (RISC-V software)
  • Build system change
  • Other

Contributor Checklist:

  • Did you set main as the base branch?
  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you state the type-of-change/impact?
  • Did you delete any extraneous prints/debugging code?
  • Did you mark the PR with a changelog: label?
  • (If applicable) Did you update the conda .conda-lock.yml file if you updated the conda requirements file?
  • (If applicable) Did you add documentation for the feature?
  • (If applicable) Did you add a test demonstrating the PR?
  • (If applicable) Did you mark the PR as Please Backport?

Although conda lib is is LD_LIBRARY_PATH, cmake building process
still ran into erros while linking libstdc++:

```
ld:/home/centos/repo/chipyard/.conda-env/lib/libicuuc.so.73:
undefined reference to `std::condition_variable::wait(
std::unique_lock<std::mutex>&)@GLIBCXX_3.4.30'
```

Add this link flag will resolve this
Copy link
Contributor

@jerryz123 jerryz123 left a comment

Choose a reason for hiding this comment

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

I think this should be ok.

@jerryz123 jerryz123 merged commit 146efa0 into ucb-bar:main Mar 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants