JuliaSmoothOptimizers / MUMPS.jl

A Julia Interface to MUMPS
Other
43 stars 15 forks source link

cannot build MUMPS in linux #60

Closed maphdze closed 2 years ago

maphdze commented 3 years ago
Pkg.build("MUMPS")
    Building MPI ──→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/0bd36605eea7a4d9c3ae0d7f21c10210dd54cb83/build.log`
    Building MUMPS → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/75577f47d7b430e00a6eadb7cbdd1e4d5772500e/build.log`
ERROR: Error building `MUMPS`: 
ERROR: LoadError: ArgumentError: Package Libdl not found in current path:
- Run `import Pkg; Pkg.add("Libdl")` to install the Libdl package.

Then I add Libdl

(@v1.6) pkg> add Libdl
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.6/Project.toml`
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`

Then build MUMPS again

(@v1.6) pkg> build MUMPS
    Building MPI ──→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/0bd36605eea7a4d9c3ae0d7f21c10210dd54cb83/build.log`
    Building MUMPS → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/75577f47d7b430e00a6eadb7cbdd1e4d5772500e/build.log`
ERROR: Error building `MUMPS`: 
ERROR: LoadError: ArgumentError: Package Libdl not found in current path:
- Run `import Pkg; Pkg.add("Libdl")` to install the Libdl package.

Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:893
 [2] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [3] top-level scope
   @ none:5
in expression starting at /home/maize/.julia/packages/MUMPS/PeP4P/deps/build.jl:1

The same thing happend.

amontoison commented 3 years ago

@maphdze, can you try again with the main branch of MUMPS.jl ?

pkg> add https://github.com/JuliaSmoothOptimizers/MUMPS.jl.git#main

Note that the package has not been updated for a long time. :crossed_fingers:

artkuo commented 2 years ago

On MacOS, I got the same error as @maphdze. I tried adding from github MUMPS.jl.git#main as suggested, and got the error below. I tried setting the MUMPS_PREFIX but that did not help. Part of the problem seems to be locating /usr/local/opt/gcc/lib/gcc/9/libquadmath.0.dylib, whereas I do have /usr/local/opt/gcc/lib/gcc/11/libquadmath.0.dylib. I'm not sure if there is an environment variable for setting the gcc version?

ERROR: Error building `MUMPS`:
ERROR: LoadError: unable to locate libmumps_common.dylib... please install MUMPS or set MUMPS_PREFIX
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] top-level scope
   @ ~/.julia/packages/MUMPS/HRat5/deps/build.jl:29
 [3] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [4] top-level scope
   @ none:5
in expression starting at /Users/artkuo/.julia/packages/MUMPS/HRat5/deps/build.jl:23

caused by: could not load library "libmumps_common.dylib"
dlopen(libmumps_common.dylib, 1): Library not loaded: /usr/local/opt/gcc/lib/gcc/9/libquadmath.0.dylib
  Referenced from: /usr/local/Cellar/mumps/5.1.2_2/lib/libmumps_common.dylib
  Reason: image not found
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:114
 [2] dlopen (repeats 2 times)
   @ ./libdl.jl:114 [inlined]
 [3] top-level scope
   @ ~/.julia/packages/MUMPS/HRat5/deps/build.jl:24
 [4] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [5] top-level scope
   @ none:5
artkuo commented 2 years ago

Following up, I did eventually install MUMPS.jl by installing mumps from source. The problem was that the MacOS Homebrew build was out of date, and could be built from source with brew install -s brewsci-mumps. The script build.jl errors about libmumps_common.dylib, but the actual problem was that it references an older version of libquadmath0.dylib. Rebuilding from source uses the latest gcc (e.g., 11) and mumps now knows to reference the latest libraries. (However, MUMPS.jl still fails tests.)

maphdze commented 2 years ago

Following up, I did eventually install MUMPS.jl by installing mumps from source. The problem was that the MacOS Homebrew build was out of date, and could be built from source with brew install -s brewsci-mumps. The script build.jl errors about libmumps_common.dylib, but the actual problem was that it references an older version of libquadmath0.dylib. Rebuilding from source uses the latest gcc (e.g., 11) and mumps now knows to reference the latest libraries. (However, MUMPS.jl still fails tests.)

I install mumps from linuxbrew too! Maybe that's the problem and I'll have a try.

Yzahran commented 2 years ago

Following up, I did eventually install MUMPS.jl by installing mumps from source. The problem was that the MacOS Homebrew build was out of date, and could be built from source with brew install -s brewsci-mumps. The script build.jl errors about libmumps_common.dylib, but the actual problem was that it references an older version of libquadmath0.dylib. Rebuilding from source uses the latest gcc (e.g., 11) and mumps now knows to reference the latest libraries. (However, MUMPS.jl still fails tests.)

I install mumps from linuxbrew too! Maybe that's the problem and I'll have a try.

I am having the same problem. Did you manage to solve it?

amontoison commented 2 years ago

I updated the artifact MUMPS_jll. If you are on Linux or OSX, the version 5.4.1 is now precompiled for your platform.

I will try to finalize the update of the C interface for this version soon (#62).

dpo commented 2 years ago

@maphdze @artkuo @Yzahran Sorry for the delay. Installations problems using a home brewed MUMPS should be resolved if you use the tap dpo/mumps-jl and build from source using MPICH. That's what is now done in the GitHub Actions configuration: https://github.com/JuliaSmoothOptimizers/MUMPS.jl/blob/main/.github/workflows/ci.yml#L36.

I'll go ahead and close this issue since all builds pass on the VMs. Please feel free to open a new issue if problems persist.

As @amontoison mentioned, changes are coming and we are planning to use artifacts in future releases of MUMPS.jl. All installation issues should then go away.

Thanks for using MUMPS.jl!