Thanks to all for the comments.
My Linux and gcc versions are:
$ gcc --version
gcc (GCC) 8.2.1 20181127
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ uname -a
Linux manjaro 4.19.13-1-MANJARO #1 SMP PREEMPT Sat Dec 29 15:43:56 UTC 2018 x86_64 GNU/Linux
I copied the hello.jl from PackageCompiler:
module Hello
using UnicodePlots
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
println("hello, world")
@show sin(0.0)
println(lineplot(1:100, sin.(range(0, stop=2π, length=100))))
return 0
end
end
The packages of PackageCompiler and UnicodePlots were added yesterday under the same julia version. I just did a gc under pkg and recompiled hello.jl.
Actually, when I first run hello, I got a message saying hello.so not found:
$ ./hello
ERROR: could not load library "/home/user/Software/julia-1.0.3/bin/hello.so"
/home/user/Software/julia-1.0.3/bin/hello.so: cannot open shared object file: No such file or directory
So then I copied hello.so from builddir into /home/user/Software/julia-1.0.3/bin/
, then when I ran hello, I got a core dump. Is there something wrong with my setting?
$ ./hello
signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0xffffffffffffffff)
main at ./hello (unknown line)
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
_start at ./hello (unknown line)
Allocations: 3278 (Pool: 3266; Big: 12); GC: 0
Segmentation fault (core dumped)