# Unable to create shared libraries or custom sysimages with PackageCompiler in ubuntu

**URL:** <https://discourse.julialang.org/t/unable-to-create-shared-libraries-or-custom-sysimages-with-packagecompiler-in-ubuntu/44128>\
**Category:** General Usage\
**Tags:** question, package, package-compiler, sysimage, microservice\
**Created:** [August 2, 2020, 12:58pm UTC](https://discourse.julialang.org/t/unable-to-create-shared-libraries-or-custom-sysimages-with-packagecompiler-in-ubuntu/44128 "2020-08-02T12:58:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Alvarado](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jorge_alvarado/32/16708_2.png) [@Jorge\_Alvarado](https://discourse.julialang.org/u/Jorge_Alvarado)\
**Post date:** [August 2, 2020, 12:58pm UTC](https://discourse.julialang.org/t/unable-to-create-shared-libraries-or-custom-sysimages-with-packagecompiler-in-ubuntu/44128/1 "2020-08-02T12:58:09Z")

</div>

I’m trying to create a small app using Julia.  
This is the repo:

> **[GitHub - alvaradojl/julia-microservice: An example of a Julia microservice](https://github.com/alvaradojl/julia-microservice)**
>
> An example of a Julia microservice

I ventured into the packagecompiler.jl documentation, I tried to follow all the steps, unfortunately I get an error:

`$ julia --startup-file=no --output-o myapp.o -J"/opt/julia-1.4.2/lib/julia/sys.so" custom_sysimage.jl`

signal (11): Segmentation fault  
in expression starting at none:0  
uv\_write2 at /workspace/srcdir/libuv/src/unix/stream.c:1397  
uv\_write at /workspace/srcdir/libuv/src/unix/stream.c:1492  
jl\_uv\_write at /buildworker/worker/package\_linux64/build/src/jl\_uv.c:463  
uv\_write\_async at ./stream.jl:967  
uv\_write at ./stream.jl:924  
unsafe\_write at ./stream.jl:1007  
write at ./strings/io.jl:183 [inlined]  
print at ./strings/io.jl:185 [inlined]  
#with\_output\_color#701 at ./util.jl:389  
unknown function (ip: 0x7f797af15856)  
with\_output\_color##kw at ./util.jl:383 [inlined]  
#printstyled#702 at ./util.jl:417 [inlined]  
printstyled##kw at ./util.jl:417  
\_jl\_invoke at /buildworker/worker/package\_linux64/build/src/gf.c:2159 [inlined]  
jl\_apply\_generic at /buildworker/worker/package\_linux64/build/src/gf.c:2323  
display\_error at ./client.jl:102  
\_jl\_invoke at /buildworker/worker/package\_linux64/build/src/gf.c:2159 [inlined]  
jl\_apply\_generic at /buildworker/worker/package\_linux64/build/src/gf.c:2323  
display\_error at ./client.jl:106  
\_jl\_invoke at /buildworker/worker/package\_linux64/build/src/gf.c:2159 [inlined]  
jl\_apply\_generic at /buildworker/worker/package\_linux64/build/src/gf.c:2323  
jl\_apply at /buildworker/worker/package\_linux64/build/src/julia.h:1700 [inlined]  
do\_apply at /buildworker/worker/package\_linux64/build/src/builtins.c:643  
jl\_f\_\_apply\_latest at /buildworker/worker/package\_linux64/build/src/builtins.c:693  
#invokelatest#1 at ./essentials.jl:712 [inlined]  
invokelatest at ./essentials.jl:711 [inlined]  
exec\_options at ./client.jl:290  
\_start at ./client.jl:484  
unknown function (ip: 0x7f797b5cbaec)  
\_jl\_invoke at /buildworker/worker/package\_linux64/build/src/gf.c:2159 [inlined]  
jl\_apply\_generic at /buildworker/worker/package\_linux64/build/src/gf.c:2323  
unknown function (ip: 0x401931)  
unknown function (ip: 0x401533)  
\_\_libc\_start\_main at /lib/x86\_64-linux-gnu/libc.so.6 (unknown line)  
unknown function (ip: 0x4015d4)  
Allocations: 852487 (Pool: 851983; Big: 504); GC: 1  
Segmentation fault (core dumped)

I’m using Ubuntu 18.04 and Julia 1.14:

`$ julia --v`  
julia version 1.4.2

`$ lsb_release -a`  
No LSB modules are available.  
Distributor ID: Ubuntu  
Description: Ubuntu 18.04.4 LTS  
Release: 18.04  
Codename: bionic

I also tried to create simple shared libraby (without the custom image)

```julia-auto
using MyApp
using PackageCompiler
create_sysimage([:MyApp];sysimage_path="sysimage_myapp.dylib")

```

and I also get this error

julia\> create\_sysimage([:MyApp];sysimage\_path=“sysimage\_myapp.dylib”)  
┌ Warning: Package MyApp does not have Dates in its dependencies:  
│ - If you have MyApp checked out for development and have  
│ added Dates as a dependency but haven’t updated your primary  
│ environment’s manifest file, try `Pkg.resolve()`.  
│ - Otherwise you may need to report an issue with MyApp  
└ Loading Dates into MyApp from project dependency, future warnings for MyApp are suppressed.  
[ Info: PackageCompiler: creating system image object file, this might take a while…  
ERROR: LoadError: LoadError: ArgumentError: Package MyApp does not have Dates in its dependencies:

- If you have MyApp checked out for development and have  
added Dates as a dependency but haven’t updated your primary  
environment’s manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with MyApp  
Stacktrace:  
[1] require(::Module, ::Symbol) at ./loading.jl:905  
[2] include(::Module, ::String) at ./Base.jl:377  
[3] include(::String) at /home/jorgedevpc/Code/github/alvaradojl/julia-microservice/src/MyApp.jl:1  
[4] top-level scope at /home/jorgedevpc/Code/github/alvaradojl/julia-microservice/src/MyApp.jl:14  
[5] include(::Module, ::String) at ./Base.jl:377  
[6] \_require(::Base.PkgId) at ./loading.jl:1058  
[7] require(::Base.PkgId) at ./loading.jl:927  
[8] require(::Module, ::Symbol) at ./loading.jl:922  
in expression starting at /home/jorgedevpc/Code/github/alvaradojl/julia-microservice/src/Server.jl:3  
in expression starting at /home/jorgedevpc/Code/github/alvaradojl/julia-microservice/src/MyApp.jl:14  
ERROR: failed process: Process(`/opt/julia-1.4.2/bin/julia --color=yes --startup-file=no --cpu-target=native --sysimage=/opt/julia-1.4.2/lib/julia/sys.so --project=/home/jorgedevpc/Code/github/alvaradojl/julia-microservice --output-o=/tmp/jl\_kbNnQF.o -e 'Base.reinit\_stdio()  
@eval Sys BINDIR = ccall(:jl\_get\_julia\_bindir, Any, ())::String  
Base.init\_load\_path()  
Base.init\_depot\_path()  
import MyApp

# This @eval prevents symbols from being put into Main

@eval Module() begin  
PrecompileStagingArea = Module()  
for (\_pkgid, \_mod) in Base.loaded\_modules  
if !(\_pkgid.name in (“Main”, “Core”, “Base”))  
eval(PrecompileStagingArea, :(const (Symbol(\_mod)) = \_mod))  
end  
end  
precompile\_statements = String  
append!(precompile\_statements, readlines(“/tmp/jl\_cNE87Y”))

```
for statement in sort(precompile_statements)
    # println(statement)
    try
        Base.include_string(PrecompileStagingArea, statement)
    catch
        # See julia issue #28808
        @debug "failed to execute $statement"
    end
end

```

end # module  
empty!(LOAD\_PATH)  
empty!(DEPOT\_PATH)  
'`, ProcessExited(1)) [1]

Stacktrace:  
[1] pipeline\_error at ./process.jl:525 [inlined]  
[2] run(::Cmd; wait::Bool) at ./process.jl:440  
[3] run at ./process.jl:438 [inlined]  
[4] create\_sysimg\_object\_file(::String, ::Array{String,1}; project::String, base\_sysimage::String, precompile\_execution\_file::Array{String,1}, precompile\_statements\_file::Array{String,1}, cpu\_target::String, script::Nothing, isapp::Bool) at /home/jorgedevpc/.julia/packages/PackageCompiler/vsMJE/src/PackageCompiler.jl:292  
[5] create\_sysimage(::Array{Symbol,1}; sysimage\_path::String, project::String, precompile\_execution\_file::Array{String,1}, precompile\_statements\_file::Array{String,1}, incremental::Bool, filter\_stdlibs::Bool, replace\_default::Bool, cpu\_target::String, script::Nothing, base\_sysimage::Nothing, isapp::Bool) at /home/jorgedevpc/.julia/packages/PackageCompiler/vsMJE/src/PackageCompiler.jl:423  
[6] top-level scope at REPL[4]:1

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [August 7, 2020, 10:37am UTC](https://discourse.julialang.org/t/unable-to-create-shared-libraries-or-custom-sysimages-with-packagecompiler-in-ubuntu/44128/2 "2020-08-07T10:37:03Z")

</div>

> [@Jorge\_Alvarado](#):
>
> ERROR: LoadError: LoadError: ArgumentError: Package MyApp does not have Dates in its dependencies:

can you fix this error?

I can’t see `Dates` in [https://github.com/alvaradojl/julia-microservice/blob/master/Project.toml](https://github.com/alvaradojl/julia-microservice/blob/master/Project.toml)
