Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error :"libsuitesparse_wrapper\"\n/usr/lib64/libcholmod.so.2: undefined symbol: amd_printf") #34667

Closed
yzcj105 opened this issue Feb 5, 2020 · 12 comments
Labels
building Build system, or building Julia or its dependencies sparse Sparse arrays

Comments

@yzcj105
Copy link

yzcj105 commented Feb 5, 2020

I've tried to compile julia. However, I've received the following error. I've tried gcc 5 gcc 7 gcc 9 . all failed.

It's related to /usr/lib64/libcholmod.so.2 file.

I've tried several versions.
v.1.3.0
v.1.3.1
v.1.4.0-rc1

error during bootstrap:
LoadError("sysimg.jl", 16, LoadError("/mnt/home/jchen/usr/julia/usr/share/julia/stdlib/v1.3/SuiteSparse/src/SuiteSparse.jl", 24, LoadError("/mnt/home/jchen/usr/julia/usr/share/julia/stdlib/v1.3/SuiteSparse/src/umfpack.jl", 66, 
ErrorException("error compiling top-level scope: could not load library **\"libsuitesparse_wrapper\"\n/usr/lib64/libcholmod.so.2: undefined symbol: amd_printf"))))**
rec_backtrace at /mnt/home/jchen/usr/julia/src/stackwalk.c:94
jl_throw at /mnt/home/jchen/usr/julia/src/task.c:224
jl_rethrow_with_add at /mnt/home/jchen/usr/julia/src/codegen.cpp:791
jl_compile_linfo at /mnt/home/jchen/usr/julia/src/codegen.cpp:1205
jl_compile_method_internal at /mnt/home/jchen/usr/julia/src/gf.c:1881
...
main at /mnt/home/jchen/usr/julia/ui/repl.c:217
__libc_start_main at /usr/lib64/libc.so.6 (unknown line)
_start at /mnt/home/jchen/usr/julia/usr/bin/julia (unknown line)

*** This error might be fixed by running `make clean`. If the error persists, try `make cleanall`. ***
make[1]: *** [/mnt/home/jchen/usr/julia/usr/lib/julia/sys.ji] Error 1
make: *** [julia-sysimg-ji] Error 2
@yzcj105
Copy link
Author

yzcj105 commented Feb 5, 2020

I've also tried to download binary julia package. When first run, there comes out some errors.

> 
┌ Error: Error during initialization of module CHOLMOD
│   exception =
│    could not load library "libsuitesparse_wrapper"
│    /usr/lib64/libcholmod.so.2: undefined symbol: amd_printf
│    Stacktrace:
│     [1] __init__() at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/SuiteSparse/src/cholmod.jl:130
└ @ SuiteSparse.CHOLMOD /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/SuiteSparse/src/cholmod.jl:176
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.3.1 (2019-12-30)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia>
> 

@ViralBShah ViralBShah added building Build system, or building Julia or its dependencies sparse Sparse arrays labels Feb 5, 2020
@ViralBShah
Copy link
Member

ViralBShah commented Feb 5, 2020

For the binary release, do you have some LD_LIBRARY_PATH or other environment settings that are interfering? It is not finding the right headers when you are compiling and the right library when you are using binaries for the same AMD library which ships with suitesparse.

Also presumably you are using BINARYBUILDER=0, because at least for 1.4, it shouldn't try to build it by default.

@yzcj105
Copy link
Author

yzcj105 commented Feb 5, 2020

For the binary release, do you have some LD_LIBRARY_PATH or other environment settings that are interfering? It is not finding the right headers when you are compiling and the right library when you are using binaries for the same AMD library which ships with suitesparse.

Yes. I've setup LD_LIBRARY_PATH.
including /usr/lib64 folder, which contains libcholmod.so.2.

It seems very risky to remove that folder from LD_LIBRARY_PATH

For the binary version, if I alias julia='LD_LIBRARY_PATH="" ./julia' it works.
However, when I try to add packages. There will be errors like the following.

ERROR: SystemError: opening file "/mnt/home/jchen/.julia/registries/General/Registry.toml": No such file or directory
Stacktrace:
[1] #systemerror#44(::Nothing, ::typeof(systemerror), ::String, ::Bool) at ./error.jl:134
[2] systemerror at ./error.jl:134 [inlined]
[3] #open#512(::Bool, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::typeof(open), ::String) at ./iostream.jl:254
[4] #open at ./none:0 [inlined]
[5] open(::String, ::String) at ./iostream.jl:310
[6] #open#271(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(open), ::typeof(Pkg.TOML.parse), ::String, ::Vararg{String,N} where N) at ./io.jl:296
[7] open at ./io.jl:296 [inlined]
[8] parsefile at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/ext/TOML/src/TOML.jl:50 [inlined]
[9] #read_registry#128(::Bool, ::typeof(Pkg.Types.read_registry), ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1075
[10] read_registry at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1070 [inlined]
[11] clone_or_cp_registries(::Pkg.Types.Context, ::Array{Pkg.Types.RegistrySpec,1}, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1047
[12] clone_or_cp_registries at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1013 [inlined] (repeats 2 times)
[13] clone_default_registries() at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:963
[14] find_registered!(::Pkg.Types.EnvCache, ::Array{String,1}, ::Array{Base.UUID,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1244
[15] registry_resolve!(::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:880
[16] #add#25(::Bool, ::Pkg.BinaryPlatforms.Linux, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:95
[17] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:72
[18] do_add!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:505
[19] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Base.invokelatest), ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:709
[20] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:708
[21] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:412
[22] #do_cmd#23(::Bool, ::typeof(Pkg.REPLMode.do_cmd), ::REPL.LineEditREPL, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:391
[23] do_cmd at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:387 [inlined]
[24] (::Pkg.REPLMode.var"#28#31"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:619
[25] #invokelatest#1 at ./essentials.jl:709 [inlined]
[26] invokelatest at ./essentials.jl:708 [inlined]
[27] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/LineEdit.jl:2306
[28] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:1045
[29] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:201
[30] (::Base.var"#770#772"{Bool,Bool,Bool,Bool})(::Module) at ./client.jl:382
[31] #invokelatest#1 at ./essentials.jl:709 [inlined]
[32] invokelatest at ./essentials.jl:708 [inlined]
[33] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:366
[34] exec_options(::Base.JLOptions) at ./client.jl:304
[35] _start() at ./client.jl:460

@yzcj105
Copy link
Author

yzcj105 commented Feb 5, 2020

LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core

The so file is soft linked to

/usr/lib64/ libcholmod.so.2.0.1

@yzcj105
Copy link
Author

yzcj105 commented Feb 5, 2020

readelf -a libcholmod.so.2

https://gist.github.com/yzcj105/f45c29c96a64d57a41a31da286be2387

@ViralBShah
Copy link
Member

It would be better paste that long output from readelf in a gist. It seems here that you are doing something non-standard with libcholmod - and doesn't appear to be a julia build problem.

@yzcj105
Copy link
Author

yzcj105 commented Feb 5, 2020

I do not have su/sudo. So I am not able to change or modify the /usr/lib64 folder.
In my home dir I've installed the package manager homebrew.
And use module load command to load or switch different gcc packages

@ViralBShah
Copy link
Member

ViralBShah commented Feb 5, 2020

It would help to understand why you need a different libcholmod instead of the one provided by Julia.

@yzcj105
Copy link
Author

yzcj105 commented Feb 5, 2020

It's my institute's cluster. I do not know why it is in that folder, either.

@ViralBShah
Copy link
Member

I see - so you perhaps need some other libraries in /usr/lib64 and it also includes a suitesparse installation, which is somehow interfering with the Julia one when you build.

Can you try using the generic Julia binaries and avoid compiling anything (and also remove the LD_LIBRARY_PATH)? At least that will tell us if Julia works. You can then troubleshoot from there.

@yzcj105
Copy link
Author

yzcj105 commented Feb 5, 2020

It works. But when add packages, there is additional errors

registry add General
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: SystemError: opening file "/mnt/home/jchen/.julia/registries/General/Registry.toml": No such file or directory

I've checked the ownership and permissions of the .julia folder recursively. drwxrwxr-x

I tried to delete .julia folder and restart julia. I got

(v1.3) pkg> add Colors
Cloning default registries into ~/.julia
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: IOError: open: permission denied (EACCES)

@ViralBShah
Copy link
Member

Ok, but building from source won't help you with these errors. I wonder if these are issues with NFS or some distributed filesystem.

Perhaps this is a question to ask on discourse to further resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies sparse Sparse arrays
Projects
None yet
Development

No branches or pull requests

2 participants