-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: ccall using clang (structs 2) #2236
Conversation
#2154 is not really a problem for v0.1. I've changed complex |
Very impressive!! Jameson you are a beast. |
Yes! This is great. We'll merge it immediately after the 0.1 branch is forked. |
We might want to just revert to using the Faddeeva wrapper then for 0.1 and make ccall with Structs an error (and fix the null pointer bug in alloc.c) I wanted to get this done so that @sebastien-villemot could comment on how to package clang for this (since we need to compile against some internal clang headers) |
Such packaging issues are exactly why we won't aim to put this in 0.1. Those kinds of things are much more problematic than a few thousand lines of code :) If there are bug fixes here that apply to what's already in master, let's pull them over. Reverting to using the Faddeeva wrapper seems annoying, and these functions aren't crucial. |
I would much rather revert to Faddeeva wrapper, and not ship code that we know will segfault. Alternatively, we can disable this functionality altogether for 0.1. It can easily be got rid of after 0.1. |
The complex Faddeeva functions have been disabled for 32 bit systems. Hence no segfaults. |
I did notice WORD_SIZE==64 check in math.jl. This means that the Faddeeva functions are only available on 64-bit until ccall is fixed. |
I did that. I think it's a good compromise. |
Yes, I think it is a good compromise. |
In addition to (I'm running into this in the NumPy C API, in which a lot of functions are actually macros to access fields from a |
clang isn't necessarily required to support that, although it does have the potential benefit of parsing header files for you I still need to add this to the documentation, but |
… struct return (disabled). unfortunately this breaks ComplexPair{Int} (ComplexPair{Float64} seems OK)"" This reverts commit 4fa9364.
remaining known issues:
|
|
@vtjnash What's the status of this? |
I think clang is just too large a dependency. But if we want to include it, we can get things like parsing header files, and automatically handling packages that come with C code. It's a big decision. |
And calling C++ |
I'm waiting for Jeff to decide he is OK with it, then I'll rebase and update to handle immutable types. Although adding clang is a bit much for just call-by-value structs, it has some nice benefits posible if it is installed (like CIndex https://github.com/ihnorton/Clang.jl) |
It seems like this would hugely simplify distribution of external packages that wrap C or C++ code, which is an enormous headache right now because you can't rely on Mac or Windows systems having a compiler. |
You also can't rely on them having header files, so it only helps so much, but yes, it would be better. |
@StefanKarpinski, good point. Without libc header files a compiler is basically useless for Pkg dependencies. |
This supports all struct types for ccall. I know it needs a rebase before merging. Note that the required clang headers are not typically installed (and clang is not available at all in Travis so that fails).
@JeffBezanson