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

libjulia exports #4949

Closed
tknopp opened this issue Nov 26, 2013 · 9 comments
Closed

libjulia exports #4949

tknopp opened this issue Nov 26, 2013 · 9 comments

Comments

@tknopp
Copy link
Contributor

tknopp commented Nov 26, 2013

Is there a reason why only some functions are exported in libjulia? For instance the boxing functions for floats are not exported while the unboxing functions are. Is there a reason to limit the exports at all?

It might make sense to somehow split julia.h in an internal and an public part. In the public julia.h then all symbols could be exported.

@JeffBezanson
Copy link
Member

I just defaulted to leaving all symbols private until they were needed. At this point a separation like you describe starts to make sense.

@tknopp
Copy link
Contributor Author

tknopp commented Nov 27, 2013

Ok, do you have some masterplan for the future development of the public julia C API or can I give this a go (in form of a PR)?

Might it make sense to remove the expmap and only use DLLEXPORT for making functions visible? This is required for Windows anyway and one then would only need one place to toggle the visibility of symbols.

So the concrete proposal would be:

  • Compile under unix with -fvisibility=hidden so that all symbols are hidden
  • Define DLLEXPORT on unix as "attribute((visibility("public"))))" (in libsupport/dtype.h:63)
  • Remove julia.expmap

In a further step one could then split julia.h into julia_internal.h and julia.h

@JeffBezanson
Copy link
Member

That sounds good.

@tknopp
Copy link
Contributor Author

tknopp commented Nov 27, 2013

Actually the DLLEXPORT definition is already fine visibility("default") seems to be "public". The visibility was also already hidden. And when I remove julia.expmap everything still builds fine. Will make a PR shortly.

@Keno
Copy link
Member

Keno commented Nov 27, 2013

The expmap is only relevant on Linux. What OS are you on?

@tknopp
Copy link
Contributor Author

tknopp commented Nov 27, 2013

OSX. But the visibility is controlled via the visibility attribute on linux as well. It is redundant to have both

@Keno
Copy link
Member

Keno commented Nov 27, 2013

Right, but there's subtle differences. In particular, julia does not compile properly if the expmap is missing entries.

@tknopp
Copy link
Contributor Author

tknopp commented Nov 27, 2013

Why that? Could you post some more details about the build failure on linux. Unfortunately, I currently only have access to OSX and Windows.

@tknopp
Copy link
Contributor Author

tknopp commented Jan 31, 2014

This implemented by #4955 an #4997.

@tknopp tknopp closed this as completed Jan 31, 2014
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