Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4ffa03a
Call `get_compiler_cmd()` at the beginning of `create_sysimage` and `…
DilumAluthge Jan 27, 2023
027fb6b
Test suite: on Julia 1.6, remove `LLVMExtra_jll` from the `MyApp/Proj…
DilumAluthge Jan 28, 2023
6519ab5
CI: Combine the tests and the docs into a single CI workflow (#775)
DilumAluthge Jan 28, 2023
25cd2e4
CI: add the `ci_started` job (#776)
DilumAluthge Jan 28, 2023
f911597
README: Fix the CI status badge (#777)
DilumAluthge Jan 28, 2023
7e47b58
use micromamba_jll rather than MKL_jll to test lazy artifacts (#772)
IanButterworth Jan 28, 2023
8e4c03c
clarify that `project` arg should be a path. (#773)
sjkelly Jan 29, 2023
b6667a6
propagate build flags into sysimg (#774)
sjkelly Feb 7, 2023
df35434
bump version (#782)
KristofferC Feb 7, 2023
9b6b461
suggest using Plots.__init__() (#750)
rdiaz02 Mar 5, 2023
e5a8410
Fix two typos (#797)
goggle Mar 27, 2023
e5a3cee
fail early if both incremental and filter_stdlibs (#800)
baggepinnen Apr 23, 2023
696064c
Build and run `MyLib` (#732)
Apr 23, 2023
168d65c
Some fixes to precompile "replay" (#805)
KristofferC Apr 24, 2023
c87bdcd
Allow the `create_app` function to accept and propagate the `script::…
DilumAluthge Apr 24, 2023
ef46e40
Mention `uuid` too in error (#733)
Apr 24, 2023
33428b2
fix: pass CPU targets as cmd args (#804)
ven-k May 12, 2023
85ebf48
Bump version (#810)
KristofferC May 19, 2023
da05b2f
fix importing executable before trying to compile its `julia_main` (#…
KristofferC May 24, 2023
dff7b2c
bump version (#814)
KristofferC May 24, 2023
a2998ec
warn early about incorrect `sysimage_path`
sjkelly Jun 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/MyLib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build MyLib
on:
pull_request:
branches:
- 'master'
- 'release-*'
push:
branches:
- 'master'
- 'release-*'
tags: '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: julia-actions/julia-buildpkg@v1
with:
project: 'examples/MyLib'
- uses: julia-actions/julia-buildpkg@v1
with:
project: 'examples/MyLib/build'
- run: |
cd examples/MyLib
make
- run: ./examples/MyLib/my_application.out
env:
LD_LIBRARY_PATH: 'examples/MyLib/MyLibCompiled/lib'
21 changes: 20 additions & 1 deletion .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: CI
on:
pull_request:
branches:
Expand All @@ -13,6 +13,11 @@ concurrency:
group: ${{ github.head_ref || github.ref_name || github.run_id }}
cancel-in-progress: true
jobs:
ci_started:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- run: exit 0
test:
timeout-minutes: 90
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -57,3 +62,17 @@ jobs:
- uses: codecov/codecov-action@v3
with:
file: lcov.info
docs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1'
- name: Build and deploy docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
run: julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")'

21 changes: 0 additions & 21 deletions .github/workflows/documenter-workflow.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
.DS_Store
/Manifest.toml
/examples/MyApp/MyApp
/examples/*Compiled
/examples/MyLib/my_application.out
/examples/MyLib/MyLibCompiled
/dev/
*.so
*.dll
Expand Down
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "PackageCompiler"
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
version = "2.1.4"
version = "2.1.7"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand All @@ -19,6 +19,7 @@ julia = "1.6"
[extras]
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[targets]
test = ["Test", "Example"]
test = ["Test", "Example", "TOML"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PackageCompiler

[![Build Status](https://github.com/JuliaLang/PackageCompiler.jl/actions/workflows/test.yml/badge.svg)](https://github.com/JuliaLang/PackageCompiler.jl/actions/workflows/test.yml)
[![Continuous integration](https://github.com/JuliaLang/PackageCompiler.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/JuliaLang/PackageCompiler.jl/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/JuliaLang/PackageCompiler.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaLang/PackageCompiler.jl)
[![][docs-stable-img]][docs-stable-url]

Expand Down
2 changes: 1 addition & 1 deletion docs/src/devdocs/relocatable_part_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

!!! info
This section is for people who want to understand PackageCompiler.jl under
the hood. It is not required reading to use the pacakge.
the hood. It is not required reading to use the package.

In the previous tutorials, we created a custom sysimage and a binary (app) that
did some simple CSV parsing with an (depending on the exact demands) acceptable
Expand Down
6 changes: 5 additions & 1 deletion docs/src/examples/plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ julia> @time display(p);
0.331869 seconds (278.38 k allocations: 7.900 MiB)
```

which is a sizeable speedup.
which is a sizeable speedup.

When using the sysimage, you may need to call `Plots.__init__()` after loading
Plots for the plots to display; otherwise, you might need to use `gui` or
pass argument `show = true` to `plot`.

Note that since we have more stuff in our sysimage, Julia is slightly slower to
start (0.35 seconds on this machine):
Expand Down
2 changes: 1 addition & 1 deletion examples/MyApp/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
HelloWorldC_jll = "dca1746e-5efc-54fc-8249-22745bc95a49"
LLVMExtra_jll = "dad2f222-ce93-54a1-a47d-0025e8a3acab"
MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
micromamba_jll = "f8abcde7-e9b7-5caa-b8af-a437887ae8e4"
8 changes: 4 additions & 4 deletions examples/MyApp/src/MyApp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if VERSION >= v"1.7.0"
using LLVMExtra_jll
end

using MKL_jll
using micromamba_jll

const myrand = rand()

Expand Down Expand Up @@ -93,10 +93,10 @@ function real_main()
end
end

if isfile(MKL_jll.libmkl_core_path)
println("MKL_jll path: ok!")
if isfile(micromamba_jll.micromamba_path)
println("micromamba_jll path: ok!")
else
println("MKL_jll path: fail!")
println("micromamba_jll path: fail!")
end
return
end
Expand Down
16 changes: 13 additions & 3 deletions examples/MyLib/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# Makefile

.DEFAULT_GOAL := all

JULIA ?= julia
DLEXT := $(shell $(JULIA) --startup-file=no -e 'using Libdl; print(Libdl.dlext)')

TARGET="../MyLibCompiled"
TARGET="MyLibCompiled"

MYLIB_INCLUDES = $(TARGET)/include/julia_init.h $(TARGET)/include/mylib.h
MYLIB_PATH := $(TARGET)/lib/libmylib.$(DLEXT)

$(MYLIB_PATH) $(MYLIB_INCLUDES): build/build.jl src/MyLib.jl
build-library: build/build.jl src/MyLib.jl
$(JULIA) --startup-file=no --project=. -e 'using Pkg; Pkg.instantiate()'
$(JULIA) --startup-file=no --project=build -e 'using Pkg; Pkg.instantiate(); include("build/build.jl")'

.PHONY: clean
INCLUDE_DIR = $(TARGET)/include

build-executable:
gcc my_application.c -o my_application.out -I$(INCLUDE_DIR) -L$(TARGET)/lib -ljulia -lmylib

all: build-library build-executable

clean:
$(RM) *~ *.o *.$(DLEXT)
$(RM) -Rf $(TARGET)

.PHONY: build-library build-executable clean all
42 changes: 38 additions & 4 deletions examples/MyLib/build/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[[ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.1"

[[Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand All @@ -14,20 +15,30 @@ deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"

[[FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[LazyArtifacts]]
deps = ["Artifacts", "Pkg"]
uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"

[[LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
version = "0.6.3"

[[LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
version = "7.84.0+0"

[[LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
Expand All @@ -36,6 +47,7 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.10.2+0"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand All @@ -50,22 +62,26 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.28.0+0"

[[MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2022.2.1"

[[NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[PackageCompiler]]
deps = ["Libdl", "Pkg", "UUIDs"]
deps = ["Artifacts", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs"]
path = "../../.."
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
version = "1.4.1"
version = "2.1.0"

[[Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.8.0"

[[Printf]]
deps = ["Unicode"]
Expand All @@ -76,11 +92,24 @@ deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
deps = ["SHA", "Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[RelocatableFolders]]
deps = ["SHA", "Scratch"]
git-tree-sha1 = "90bc7a7c96410424509e4263e277e43250c05691"
uuid = "05181044-ff0b-4ac5-8273-598c1e38db00"
version = "1.0.0"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[Scratch]]
deps = ["Dates"]
git-tree-sha1 = "f94f779c94e58bf9ea243e77a37e16d9de9126bd"
uuid = "6c6a2e73-6563-6170-7368-637461726353"
version = "1.1.1"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Expand All @@ -91,10 +120,12 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
version = "1.0.0"

[[Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.1"

[[UUIDs]]
deps = ["Random", "SHA"]
Expand All @@ -106,11 +137,14 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
[[Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.12+3"

[[nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
version = "1.48.0+0"

[[p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
version = "17.4.0+0"
3 changes: 2 additions & 1 deletion examples/MyLib/build/build.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using PackageCompiler

target_dir = get(ENV, "OUTDIR", "$(@__DIR__)/../../MyLibCompiled")
target_dir = get(ENV, "OUTDIR", "$(@__DIR__)/../MyLibCompiled")
target_dir = replace(target_dir, "\\"=>"/") # Change Windows paths to use "/"

println("Creating library in $target_dir")
Expand All @@ -10,5 +10,6 @@ PackageCompiler.create_library(".", target_dir;
precompile_statements_file=["$(@__DIR__)/additional_precompile.jl"],
incremental=false,
filter_stdlibs=true,
force=true, # Overwrite target_dir.
header_files = ["$(@__DIR__)/mylib.h"],
)
16 changes: 16 additions & 0 deletions examples/MyLib/my_application.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <stdio.h>

#include "julia_init.h"
#include "mylib.h"

int main(int argc, char *argv[])
{
init_julia(argc, argv);

int incremented = increment32(3);
printf("Incremented value: %i", incremented);

shutdown_julia(0);
return 0;
}

Loading