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

Generating the interface code for all versions of GSL from a single version is problematic #150

Closed
djerius opened this issue May 3, 2018 · 4 comments

Comments

@djerius
Copy link
Contributor

djerius commented May 3, 2018

Currently a single version of the GSL headers is used to generate the SWIG interface code for all of the versions of GSL supported.

This is problematic, as there is a mismatch between the API's of the different versions. In later versions deprecated functions may be removed. If we use those headers, earlier versions will lose functionality.

Instead, I think that we should use the GSL headers for each specific version and commit those to the repository. We may need to regenerate them if we add missing functionality, but at the least we don't have to worry about incompatible API's.

@djerius
Copy link
Contributor Author

djerius commented Oct 27, 2018

This is causing another failure mode when additional routines in a GSL module are added in a later version of GSL. For example, the sparse matrix support in GSL v 2.2.1 added new routines. Code generated for v 2.0 and v 2.1 now contains wrappers for the new routines which do not exist in those versions, causing runtime undefined symbol errors (see https://travis-ci.org/leto/math--gsl/jobs/446986667)

@djerius
Copy link
Contributor Author

djerius commented Oct 27, 2018

Nope, that failure is caused by ver2func not being updated. Documentation is definitely needed for this part!

@djerius
Copy link
Contributor Author

djerius commented Oct 28, 2018

Currently a single version of the GSL headers is used to generate the SWIG interface code for all of the versions of GSL supported.

This is problematic, as there is a mismatch between the API's of the different versions. In later versions deprecated functions may be removed. If we use those headers, earlier versions will lose functionality.

Deprecated functions are handled via PR #158

@djerius
Copy link
Contributor Author

djerius commented Oct 31, 2018

After working with the codebase for a while, I now understand the tradeoffs better. The existing approach makes it easy to share code across multiple versions of GSL, at the cost of needing to keep track of which features are available in which version. Other than some hackery needed to handle changes in C structs, the approach is sound. I withdraw my uninformed objections.

@djerius djerius closed this as completed Oct 31, 2018
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

1 participant