Skip to content

Conversation

@kmsquire
Copy link
Member

@kmsquire kmsquire commented Jan 9, 2021

  • Similar to create_app, this function facilitates the creation of
    C shared library bundles using Julia.
  • As with apps, it generates a directory tree with required shared
    libraries and artifacts.
  • In contrast with apps, the julia system image is the main artifact
    generated, and its name should be set to the expected name of
    the library you're creating.
  • One downside of this implementation is that any binaries linking
    to this shared library may need help finding it at runtime. The
    methods for doing so are system dependent.

Probably fixes #257, #350, #392.

Still needs documentation (at least). There is a bit of explanation in the function docs for create_library that should probably be moved elsewhere.

Companion MR in simonbyrne/libcg#18

Cc: @simonbyrne

mkpath(include_dir)

for header_file in header_files
new_file = joinpath(include_dir, basename(header_file))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes all header files are at the top level. For basic use cases, this is probably fine, but it might be good to allow paths relative to the top level include. Not sure of the best way to do this...

@codecov-io
Copy link

codecov-io commented Jan 11, 2021

Codecov Report

Merging #490 (c992bb3) into master (2b70982) will decrease coverage by 2.73%.
The diff coverage is 79.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #490      +/-   ##
==========================================
- Coverage   83.03%   80.29%   -2.74%     
==========================================
  Files           2        2              
  Lines         395      467      +72     
==========================================
+ Hits          328      375      +47     
- Misses         67       92      +25     
Impacted Files Coverage Δ
src/juliaconfig.jl 84.00% <62.50%> (-6.48%) ⬇️
src/PackageCompiler.jl 79.85% <80.76%> (-2.30%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b70982...c992bb3. Read the comment docs.

@kmsquire
Copy link
Member Author

kmsquire commented Jan 12, 2021

Status: based on the PR to @simonbyrne's libcg, this seems to be working on Linux and OSX fine in Julia v1.5. For Windows, the PATH needs to be set, and I'm not quite sure of the right incantation in the ci.yml file yet.

Julia v1.6 can't be tested in CI yet because of this bug, but latest is a reasonable proxy. On the latest master, libcg isn't yet linked to libjulia-internal--need to copy the relevant lines from PackageCompiler.jl and figure out how to condition on the Julia version in the libcg Makefile (any hints welcome!).

Also needs docs (I've started), and tests.

As above, the companion PR in libcg is simonbyrne/libcg#18.

@IanButterworth
Copy link
Member

@kmsquire FYI master now includes CI for the 1.6 beta1, if you wanted to rebase

@kmsquire kmsquire force-pushed the kms/create_library branch 5 times, most recently from e1ca58b to 3edaa28 Compare January 28, 2021 20:39
@kmsquire kmsquire force-pushed the kms/create_library branch 5 times, most recently from 6c138fe to c90d374 Compare February 23, 2021 22:30
* This lets it propagate to binaries that link to it.
* Similar to `create_app`, this function facilitates the creation of
  C shared library bundles using Julia.
* As with apps, it generates a directory tree with required shared
  libraries and artifacts.
* In contrast with apps, the julia system image is the main artifact
  generated, and its name should be set to the expected name of
  the library you're creating.
* One downside of this implementation is that any binaries linking
  to this shared library may need help finding it at runtime.  The
  methods for doing so are system dependent.
Copy link

@Byrth Byrth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just got interested in the PR and skimmed it. Nice work!

kmsquire added 2 commits July 28, 2021 20:36
* `current_version` is used to set the .so/.dylib version (ignored on
  Windows)
* `compatibility_version` is used to set the `compatibility_version` on
 Apple platforms (ignored on other platforms)
* Makes it easier to identify problems in CI
@kmsquire kmsquire force-pushed the kms/create_library branch from 91aa2a3 to c992bb3 Compare July 29, 2021 03:36
@kmsquire kmsquire changed the title RFC: Add create_library function Add create_library function Jul 29, 2021
@KristofferC KristofferC merged commit 3e69bcc into JuliaLang:master Jul 29, 2021
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.

Question: How do we use build_shared_lib function Properly ?

6 participants