The bleow script runs perfectly fine on my Macbook Pro with Julia-1.7.1, but the same program does not run at all on Ubuntu (20.04) (Julia-1.7.1) and gives me the below error message. Not sure if it is due to Julia itself or the package GibbsSeaWater.jl
.
Here is a MAT file with some sample data: test.mat - Google Drive
Here is my code:
using MAT, GibbsSeaWater;
F1 = matopen("test.mat");
SP = read(F1, "SP");
P = read(F1, "P");
Lon = read(F1, "Lon");
Lat = read(F1, "Lat");
close(F1);
SA = gsw_sa_from_sp.(SP, P, Lon, Lat); # calculate the Absolute salinity
Here is the error message.
signal (11): Segmentation fault
in expression starting at /home/leon/Desktop/LQ/Julia_models/ESM4/A06_unit_conv_historical.jl:38
gsw_saar at /home/leon/.julia/packages/GibbsSeaWater/vq3GE/deps/usr/lib/libgswteos-10.so (unknown line)
gsw_sa_from_sp at /home/leon/.julia/packages/GibbsSeaWater/vq3GE/deps/usr/lib/libgswteos-10.so (unknown line)
gsw_sa_from_sp at /home/leon/.julia/packages/GibbsSeaWater/vq3GE/src/gen_gswteos10.jl:534 [inlined]
_broadcast_getindex_evalf at ./broadcast.jl:670 [inlined]
_broadcast_getindex at ./broadcast.jl:643 [inlined]
getindex at ./broadcast.jl:597 [inlined]
macro expansion at ./broadcast.jl:961 [inlined]
macro expansion at ./simdloop.jl:77 [inlined]
copyto! at ./broadcast.jl:960 [inlined]
copyto! at ./broadcast.jl:913 [inlined]
copy at ./broadcast.jl:885 [inlined]
materialize at ./broadcast.jl:860
unknown function (ip: 0x7fcb1f0a4a5d)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
top-level scope at /home/leon/Desktop/LQ/Julia_models/ESM4/A06_unit_conv_historical.jl:41
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:876
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:830
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:944
eval at ./boot.jl:373 [inlined]
include_string at ./loading.jl:1196
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
_include at ./loading.jl:1253
include at ./Base.jl:418
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
exec_options at ./client.jl:292
_start at ./client.jl:495
jfptr__start_40531.clone_1 at /opt/julia-1.7.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:559
jl_repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:701
main at julia (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x400808)
Allocations: 8021244 (Pool: 8018757; Big: 2487); GC: 7
Segmentation fault (core dumped)
This does not seem to be a performance related issue. It ran on my Mac super fast. On Ubuntu, however, it reported the error message without even trying.