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

#0: Fix ttnn shared libs build #17127

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Conversation

sankarmanoj-tt
Copy link
Contributor

@sankarmanoj-tt sankarmanoj-tt commented Jan 27, 2025

Problem description

Build using --ttnn-shared-sublibs was broken

What's changed

Pybind uses hidden visibility, which causes a linker error for functions defined in *.cpp files.
Defintions moved to header file.

Checklist

@sankarmanoj-tt sankarmanoj-tt marked this pull request as ready for review January 27, 2025 15:37
@@ -62,8 +62,9 @@ class type_caster<ttnn::SimpleShape> {
public:
PYBIND11_TYPE_CASTER(ttnn::SimpleShape, _("SimpleShape"));

bool load(handle src, bool);
static handle cast(const ttnn::SimpleShape& src, return_value_policy /* policy */, handle /* parent */);
PYBIND11_EXPORT bool load(handle src, bool);
Copy link
Member

Choose a reason for hiding this comment

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

Don’t need to export the class itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried making the whole namespace visible initially, but that didn't work.
The error I got was that the function was an undefined hidden symbol. Just exporting the function made it work.

@sankarmanoj-tt sankarmanoj-tt merged commit 0a8fefb into main Jan 29, 2025
195 checks passed
@sankarmanoj-tt sankarmanoj-tt deleted the smanoj/fix_ttnn_shared_libs branch January 29, 2025 13:31
williamlyTT pushed a commit that referenced this pull request Jan 30, 2025
### Problem description
Build using `--ttnn-shared-sublibs` was broken

### What's changed
Pybind uses hidden visibility, which causes a linker error for functions
defined in *.cpp files.
Defintions moved to header file. 

### Checklist
- [ ] Post commit CI
[passes](https://github.com/tenstorrent/tt-metal/actions/runs/13003713246)
yieldthought pushed a commit that referenced this pull request Jan 31, 2025
### Problem description
Build using `--ttnn-shared-sublibs` was broken

### What's changed
Pybind uses hidden visibility, which causes a linker error for functions
defined in *.cpp files.
Defintions moved to header file. 

### Checklist
- [ ] Post commit CI
[passes](https://github.com/tenstorrent/tt-metal/actions/runs/13003713246)
nikileshx pushed a commit to nikileshx/tt-metal that referenced this pull request Feb 3, 2025
### Problem description
Build using `--ttnn-shared-sublibs` was broken

### What's changed
Pybind uses hidden visibility, which causes a linker error for functions
defined in *.cpp files.
Defintions moved to header file. 

### Checklist
- [ ] Post commit CI
[passes](https://github.com/tenstorrent/tt-metal/actions/runs/13003713246)
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