Sys.WORD_SIZE gives wrong bit size

I was trying to use ODE solvers from MATLAB using the MATLABDiffEq package, however i find a load error due to matlab path not being found. I found that the function matlab_libpath gets the the MATLAB path variable using the Sys.WORD_SIZE:

matlab_home = matlab_homepath()
matlab_lib_dir = if islinux()
    Sys.WORD_SIZE == 32 ? "glnx86" : "glnxa64"
elseif isapple()
    Sys.WORD_SIZE == 32 ? "maci" : "maci64"
elseif iswindows()
    Sys.WORD_SIZE == 32 ? "win32" : "win64"
end
matlab_libpath = joinpath(matlab_home, "bin", matlab_lib_dir)
if !isdir(matlab_libpath)
    error("The MATLAB library path could not be found.")
end
return matlab_libpath

However my system is 64 bit and hence the right value for matlab_lib_dir should be glnx64 but Sys.WORD_SIZE returns 32. Why is it spitting out the wrong system bit information?

I am using Ubuntu 18.04 in 64bit AMD chipset.
Thanks

Is there any chance you installed a 32-bit version of Julia?

2 Likes

Related to the question above, how did you install julia?

Yup, my bad…got it from snapstore instead of the Julia official package. And 32bit version was installed.
Corrected it now. Thanks for the help !