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

Export functions without def file #303

Merged
merged 7 commits into from
Mar 12, 2019
Merged

Export functions without def file #303

merged 7 commits into from
Mar 12, 2019

Conversation

isuruf
Copy link
Contributor

@isuruf isuruf commented Feb 27, 2019

@fgvanzee, can you confirm that the functions removed from libblis-symbols.def file are not intended to be public API?

Fixes #248

@fgvanzee
Copy link
Member

@fgvanzee, can you confirm that the functions removed from libblis-symbols.def file are not intended to be public API?

@isuruf Yes, I will check. Thanks.

@fgvanzee
Copy link
Member

@isuruf The functions you removed from libblis-symbols.def all appear to be internal/helper functions--no public functions that I could see.

@isuruf
Copy link
Contributor Author

isuruf commented Feb 28, 2019

Ready for review.

CFLAGS="-fvisibility=hidden" ./configure auto should remove those few internal functions from being exported now.

After this PR is merged, BLIS_EXPORT_BLIS macro should be removed from any internal API.

@fgvanzee
Copy link
Member

fgvanzee commented Feb 28, 2019

Ready for review.

Will do. Thanks Isuru.

CFLAGS="-fvisibility=hidden" ./configure auto should remove those few internal functions from being exported now.

I think you are suggesting that we can now adjust the Makefile so that -fvisibility=hidden is always used? Please confirm.

Also, do you know if that compiler option is recognized by all of: gcc, clang, and icc? If we need to use a different option for clang or icc (or both), that's fine. I just need to (eventually) know what the equivalent option(s) is/are.

After this PR is merged, BLIS_EXPORT_BLIS macro should be removed from any internal API.

Got it. I'll add this to my near-term to-do list, though I have a lot on my plate in the next couple days, so it might not be until early next week that I can make significant progress on this.

Also, if you don't mind, I'll wait on merging this PR until I can remove the macros from the internal APIs (I'll push to the PR branch). That way, you can also easily review/comment on it before I merge.

@isuruf
Copy link
Contributor Author

isuruf commented Feb 28, 2019

I think you are suggesting that we can now adjust the Makefile so that -fvisibility=hidden is always used? Please confirm.

A user can easily pass the -fvisibility=hidden option or you can set it in the configure.
I'll leave that up to you to decide what to do.

Also, do you know if that compiler option recognized by all of: gcc, clang, and icc? If we need to use a different option for clang or icc (or both), that's fine. I just need to (eventually) know what the equivalent option(s) is/are.

I know that gcc and clang on unix do. (clang doesn't on windows). Not sure about icc.

Also, if you don't mind, I'll wait on merging this PR until I can remove the macros from the internal APIs (I'll push to the PR branch). That way, you can also easily review/comment on it before I merge.

Sure. I'm not in a hurry.

@fgvanzee
Copy link
Member

A user can easily pass the -fvisibility=hidden option or you can set it in the configure.
I'll leave that up to you to decide what to do.

Understood. I'll probably make it a configure option eventually. But reducing it down to that flag's presence or absence is a great improvement. Thanks again for your efforts.

@fgvanzee
Copy link
Member

fgvanzee commented Mar 8, 2019

@isuruf I was taking a closer look at the use of BLIS_EXPORT_BLIS. It seems that you mostly targeted function prototypes. However, the macro was also inserted into a few function definitions.

Can you briefly explain which one, prototypes or definitions, the macro must be used in front of in order to have the desired effect vis-a-vis hiding/exposing symbols in shared libraries?

@isuruf
Copy link
Contributor Author

isuruf commented Mar 8, 2019

From prototypes I assume you mean function declaration. The macro should be added to the declaration and not the definition. If you can point out the definitions I have used the macro on, I'll fix them

@fgvanzee
Copy link
Member

fgvanzee commented Mar 8, 2019

@isuruf Yes, I mean declaration. Not sure which term is in vogue these days; I call them prototypes since that was what they were called when I learned C. :)

You can find the affected source files by executing grep -R BLIS_EXPORT_BLIS frame | sort | grep "\.c:" | less at the top-level directory.

It may also be good to do the same thing but for BLIS_EXPORT_BLAS.

@fgvanzee
Copy link
Member

@isuruf Your removal of BLIS_EXPORT_BLIS/BLIS_EXPORT_BLAS from function definitions looks good. I also appreciate that you did not leave behind the space after the macro! :)

@fgvanzee fgvanzee merged commit 766769e into flame:master Mar 12, 2019
@fgvanzee
Copy link
Member

fgvanzee commented Mar 12, 2019

@isuruf I am now going to go through all of the remaining occurrences of BLIS_EXPORT_BLIS and remove the ones associated with functions that should always be private/internal.

@isuruf
Copy link
Contributor Author

isuruf commented Mar 12, 2019

Thanks @fgvanzee

@isuruf isuruf deleted the export branch March 12, 2019 17:02
@fgvanzee
Copy link
Member

Interesting observation: Because @isuruf wrote "Fixes #248" in the initial issue posting, merging this PR automatically closed #248. That seems like a generally smart and useful feature in GitHub, though not necessarily for those of us who start out oblivious to the effects of those magic words. :) It took me a little bit of digging to figure out what had happened.

Did you know about this, Isuru?

fgvanzee added a commit that referenced this pull request Mar 12, 2019
Details:
- After merging PR #303, at Isuru's request, I removed the use of
  BLIS_EXPORT_BLIS from all function prototypes *except* those that we
  potentially wish to be exported in shared/dynamic libraries. In other
  words, I removed the use of BLIS_EXPORT_BLIS from all prototypes of
  functions that can be considered private or for internal use only.
  This is likely the last big modification along the path towards
  implementing the functionality spelled out in issue #248. Thanks
  again to Isuru Fernando for his initial efforts of sprinkling the
  export macros throughout BLIS, which made removing them where
  necessary relatively painless. Also, I'd like to thank Tony Kelman,
  Nathaniel Smith, Ian Henriksen, Marat Dukhan, and Matthew Brett for
  participating in the initial discussion in issue #37 that was later
  summarized and restated in issue #248.
- CREDITS file update.
@fgvanzee
Copy link
Member

@isuruf I am now going to go through all of the remaining occurrences of BLIS_EXPORT_BLIS and remove the ones associated with functions that should always be private/internal.

@isuruf Done. Take a look at 5a5f494 for the finished product. (Everything else is merged back to master, now, too.)

@isuruf
Copy link
Contributor Author

isuruf commented Mar 13, 2019

Thanks. 5a5f494 looks good to me. Maybe something in docs asking the user to add -fvisibility=hidden to hide private API would help.

Yes, the fixes word was intentional. Closes and resolves also work.

@fgvanzee
Copy link
Member

Thanks for those pro-tips. I'll work on something for the docs. Or, perhaps we should open a new issue to discuss whether -fvisibility=hidden should be the default for building shared libraries of BLIS. (I am open to it.) Maybe a new configure option would help, too.

pradeeptrgit pushed a commit to amd/blis that referenced this pull request Jan 14, 2020
* Revert "restore bli_extern_defs exporting for now"

This reverts commit 09fb07c.

* Remove symbols not intended to be public

* No need of def file anymore

* Fix whitespace

* No need of configure option

* Remove export macro from definitions

* Remove blas export macro from definitions
pradeeptrgit pushed a commit to amd/blis that referenced this pull request Jan 14, 2020
Details:
- After merging PR flame#303, at Isuru's request, I removed the use of
  BLIS_EXPORT_BLIS from all function prototypes *except* those that we
  potentially wish to be exported in shared/dynamic libraries. In other
  words, I removed the use of BLIS_EXPORT_BLIS from all prototypes of
  functions that can be considered private or for internal use only.
  This is likely the last big modification along the path towards
  implementing the functionality spelled out in issue flame#248. Thanks
  again to Isuru Fernando for his initial efforts of sprinkling the
  export macros throughout BLIS, which made removing them where
  necessary relatively painless. Also, I'd like to thank Tony Kelman,
  Nathaniel Smith, Ian Henriksen, Marat Dukhan, and Matthew Brett for
  participating in the initial discussion in issue flame#37 that was later
  summarized and restated in issue flame#248.
- CREDITS file update.
dzambare pushed a commit to amd/blis that referenced this pull request Mar 15, 2021
* Revert "restore bli_extern_defs exporting for now"

This reverts commit 09fb07c.

* Remove symbols not intended to be public

* No need of def file anymore

* Fix whitespace

* No need of configure option

* Remove export macro from definitions

* Remove blas export macro from definitions
dzambare pushed a commit to amd/blis that referenced this pull request Mar 15, 2021
Details:
- After merging PR flame#303, at Isuru's request, I removed the use of
  BLIS_EXPORT_BLIS from all function prototypes *except* those that we
  potentially wish to be exported in shared/dynamic libraries. In other
  words, I removed the use of BLIS_EXPORT_BLIS from all prototypes of
  functions that can be considered private or for internal use only.
  This is likely the last big modification along the path towards
  implementing the functionality spelled out in issue flame#248. Thanks
  again to Isuru Fernando for his initial efforts of sprinkling the
  export macros throughout BLIS, which made removing them where
  necessary relatively painless. Also, I'd like to thank Tony Kelman,
  Nathaniel Smith, Ian Henriksen, Marat Dukhan, and Matthew Brett for
  participating in the initial discussion in issue flame#37 that was later
  summarized and restated in issue flame#248.
- CREDITS file update.
dzambare pushed a commit to amd/blis that referenced this pull request Jul 6, 2021
* Revert "restore bli_extern_defs exporting for now"

This reverts commit 09fb07c.

* Remove symbols not intended to be public

* No need of def file anymore

* Fix whitespace

* No need of configure option

* Remove export macro from definitions

* Remove blas export macro from definitions
dzambare pushed a commit to amd/blis that referenced this pull request Jul 6, 2021
Details:
- After merging PR flame#303, at Isuru's request, I removed the use of
  BLIS_EXPORT_BLIS from all function prototypes *except* those that we
  potentially wish to be exported in shared/dynamic libraries. In other
  words, I removed the use of BLIS_EXPORT_BLIS from all prototypes of
  functions that can be considered private or for internal use only.
  This is likely the last big modification along the path towards
  implementing the functionality spelled out in issue flame#248. Thanks
  again to Isuru Fernando for his initial efforts of sprinkling the
  export macros throughout BLIS, which made removing them where
  necessary relatively painless. Also, I'd like to thank Tony Kelman,
  Nathaniel Smith, Ian Henriksen, Marat Dukhan, and Matthew Brett for
  participating in the initial discussion in issue flame#37 that was later
  summarized and restated in issue flame#248.
- CREDITS file update.
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

Successfully merging this pull request may close these issues.

2 participants