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

Python binding should be conditional on a special option, not on BUILD_SHARED_LIBS #911

Closed
yurivict opened this issue Apr 11, 2023 · 6 comments

Comments

@yurivict
Copy link
Contributor

This code makes add_subdirectory(python) conditional on BUILD_SHARED_LIBS.

I think that this is a mistake.

Version: 1.54

@alaindargelas
Copy link
Collaborator

@Thomasb81 can you take a look at this and #901

@yurivict
Copy link
Contributor Author

yurivict commented Apr 12, 2023

python binding should be conditional on a special option, like option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON), or it should ideally be a separate project, because bindings are essentially separate projects that people tend to bundle together with the main project.

@Thomasb81
Copy link
Contributor

I can probably provide a PR for an option as suggest by @yurivict but not sure to understand the separate project option.

Are you referring to cmake project or git dependency ?

@yurivict
Copy link
Contributor Author

Are you referring to cmake project or git dependency ?

I am referring to a separate git project for the Python binding.

For example, there is a Heyoka C++ project here: https://github.com/bluescarni/heyoka
And there is it's Python binding here: https://github.com/bluescarni/heyoka.py

If you would look at the Python binding itself - it has nothing to do with the C++ project, except that it links to it like any other dependency would. The Python binding is not a "part" of UHDM: The rest of UHDM does not use the Python binding code. The Python binding is a separate project that actually can be installed multiple times for multiple concurrent Python versions.

@Thomasb81
Copy link
Contributor

The Python binding is a separate project that actually can be installed multiple times for multiple concurrent Python versions.

What you say make sense, in particular if this additional project is host by chipsalliance.
But sorry I don't feel concerned by this need. Also I see in the past weeks so many commit to fine tune the cmake build system between uhdm and surelog ... With my knowledge and understanding of cmake ; that's not a task for me. :)

@alaindargelas
Copy link
Collaborator

Fixed by #924.
To build the python API, please use:
make release-shared UHDM_WITH_PYTHON=ON

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

No branches or pull requests

3 participants