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

cython extensions are compiled to c++ source code. #828

Open
rainwoodman opened this issue Nov 14, 2017 · 5 comments
Open

cython extensions are compiled to c++ source code. #828

rainwoodman opened this issue Nov 14, 2017 · 5 comments

Comments

@rainwoodman
Copy link
Contributor

It appears that halotools doesn't really need c++. If that's the case, using C makes life of downstream packaging a lot easier.

@aphearin
Copy link
Contributor

I'd love to get rid of the c++ compilation @rainwoodman - The only place where any cpp-specific feature is used is in the pairwise distance engines: pairwise_distance_3d_engine, pairwise_distance_xy_z_engine and conditional_pairwise_distances. In particular, these functions use libcpp.vector. I have not looked into how much the algorithm would need to change if this dependence were dropped - @duncandc could you comment to that effect?

@duncandc
Copy link
Contributor

I agree that it would be ideal to get rid of the C++ dependency. Let me take a look at those functions to see if we can get around using the libcpp.vector library without any significant penalty.

@rainwoodman
Copy link
Contributor Author

rainwoodman commented Nov 14, 2017 via email

@aphearin
Copy link
Contributor

Those three functions are the only ones using libcpp.vector in the entire repo @rainwoodman - if you know of common workarounds for this, I would happily use those instead. These three functions do not need to be ultra-high performance.

@rainwoodman
Copy link
Contributor Author

If there is a reasonably sized upper bound, can you simply allocate according to the bound and update a size variable?

incremental growth of around 1.5x with realloc() is not very hard too, you only need to keep size and maxsize.

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