Homebrew.jl icon indicating copy to clipboard operation
Homebrew.jl copied to clipboard

mpicc: No such file or directory

Open dpo opened this issue 7 years ago • 8 comments

When opening an issue, please ping @staticfloat.

Now that homebrew/science is deprecated I moved mumps.rb to the dpo/openblas tap. Homebrew also removed the generic :mpi dependency and replaced it with a simple dependency on open-mpi. The MPICC environment variable is no longer set when building a formula, and mpicc should be called directly instead. Here's an example in mumps.rb: https://github.com/dpo/homebrew-openblas/blob/master/mumps.rb#L87

If I issue ~/.julia/v0.6/Homebrew/deps/usr/bin/brew install mumps from the shell, all goes well, but Pkg.build("MUMPS") now results in

mpicc -fPIC -I../include -O  -c graph.c -o graph.o
make[2]: mpicc: No such file or directory

However:

$ ls -l ~/.julia/v0.6/Homebrew/deps/usr/bin/mpicc
lrwxr-xr-x  1 dpo  staff    36B Feb  4 20:52 /Users/dpo/.julia/v0.6/Homebrew/deps/usr/bin/mpicc -> ../Cellar/open-mpi/3.0.0_2/bin/mpicc

Here's the full output:

INFO: Building MUMPS
WARNING: The following packages do not have relocatable bottles, installation may fail!
Please report these packages to https://github.com/JuliaLang/Homebrew.jl:
  dpo/openblas/mumps
==> Installing open-mpi from staticfloat/juliatranslated
==> Downloading https://homebrew.bintray.com/bottles/open-mpi-3.0.0_2.sierra.bot
Already downloaded: /Users/dpo/Library/Caches/Homebrew.jl/open-mpi-3.0.0_2.sierra.bottle.tar.gz
==> Pouring open-mpi-3.0.0_2.sierra.bottle.tar.gz
🍺  /Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cellar/open-mpi/3.0.0_2: 715 files, 9.7MB
Warning: Already linked: /Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cellar/open-mpi/3.0.0_2
==> Installing mumps from dpo/openblas
==> Downloading http://mumps.enseeiht.fr/MUMPS_5.1.2.tar.gz
Already downloaded: /Users/dpo/Library/Caches/Homebrew.jl/mumps-5.1.2.tar.gz
==> make alllib LIBEXT=.dylib AR=gfortran -dynamiclib -Wl,-install_name -Wl,/Use
Last 15 lines from /Users/dpo/Library/Logs/Homebrew/mumps/01.make:
SCALAP=-L/Users/dpo/.julia/v0.6/Homebrew/deps/usr/opt/scalapack/lib -lscalapack
INCPAR=
LIBPAR=$(SCALAP)
LIBBLAS=-L/Users/dpo/.julia/v0.6/Homebrew/deps/usr/opt/openblas/lib -lopenblas

/Library/Developer/CommandLineTools/usr/bin/make ARITH=c mumps_lib
if [ "./PORD/lib/" != "" ] ; then \
          cd ./PORD/lib/; \
          /Library/Developer/CommandLineTools/usr/bin/make CC="mpicc -fPIC" CFLAGS="-O" AR="gfortran -dynamiclib -Wl,-install_name -Wl,/Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cellar/mumps/5.1.2/lib/libpord.dylib -undefined dynamic_lookup -o " RANLIB="echo" OUTC="-o " LIBEXT=.dylib; \
        fi;
mpicc -fPIC -I../include -O  -c graph.c -o graph.o
make[2]: mpicc: No such file or directory
make[2]: *** [graph.o] Error 1
make[1]: *** [lib/libpord.dylib] Error 2
make: *** [c] Error 2

dpo avatar Feb 04 '18 19:02 dpo

Just to add to the issue, Homebrew.add("dpo/openblas/mumps") fails with the error above but Homebrew.brew(`install dpo/openblas/mumps`) succeeds. While I would expect both commands to have the same effect, the PATH doesn't seem to be the same.

dpo avatar Feb 04 '18 21:02 dpo

Very interesting. This is probably because there is a residual mumps formula in the homebrew-julia tap. We will need to delete that before it will let you install mumps from somewhere else (because the idea behind the homebrew-julia tap is that it overrides any other formula automatically) On Sun, Feb 4, 2018 at 1:02 PM Dominique [email protected] wrote:

Just to add to the issue, Homebrew.add("dpo/openblas/mumps") fails with the error above but Homebrew.brew(install dpo/openblas/mumps) succeeds. While I would expect both commands to have the same effect, the PATH doesn't seem to be the same.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JuliaPackaging/Homebrew.jl/issues/222#issuecomment-362939395, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH_aMgSexB4pGOwkpg2vVzPGezACXKvks5tRhr-gaJpZM4R4soT .

--

-E

staticfloat avatar Feb 04 '18 21:02 staticfloat

I don't see a mumps formula in homebrew/julia though. Overriding brew when I fully qualify the tap would seem like tricking the user...

dpo avatar Feb 04 '18 21:02 dpo

Sorry, I meant homebrew/juliadeps, but it doesn't appear that it exists in there either.

I just tried this locally, and Homebrew.brew(install dpo/openblas/mumps) failed for me. Are you certain it works for you?

staticfloat avatar Feb 04 '18 22:02 staticfloat

Yes it works for me but I had to brew open-mpi from source. Brewing with -v revealed that the mpicc error above was actually due to another error:

Cannot open configuration file /usr/local/Cellar/open-mpi/3.0.0_2/share/openmpi/mpicc-wrapper-data.txt

dpo avatar Feb 04 '18 23:02 dpo

julia> using Homebrew

julia> Homebrew.brew(`install dpo/openblas/mumps`)
==> Installing mumps from dpo/openblas
==> Installing dependencies for dpo/openblas/mumps: open-mpi, scalapack
==> Installing dpo/openblas/mumps dependency: open-mpi
==> Downloading https://www.open-mpi.org/software/ompi/v3.0/downloads/openmpi-3.0.0.ta
Already downloaded: /Users/dpo/Library/Caches/Homebrew.jl/open-mpi-3.0.0.tar.bz2
==> ./configure --prefix=/Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cellar/open-mpi/3.0.
==> make all
==> make check
==> make install
🍺  /Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cellar/open-mpi/3.0.0_2: 715 files, 9.7MB, built in 12 minutes 26 seconds
==> Installing dpo/openblas/mumps dependency: scalapack
==> Downloading https://homebrew.bintray.com/bottles/scalapack-2.0.2_10.sierra.bottle.
Already downloaded: /Users/dpo/Library/Caches/Homebrew.jl/scalapack-2.0.2_10.sierra.bottle.tar.gz
==> Pouring scalapack-2.0.2_10.sierra.bottle.tar.gz
🍺  /Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cellar/scalapack/2.0.2_10: 25 files, 5.7MB
==> Installing dpo/openblas/mumps
==> Downloading http://mumps.enseeiht.fr/MUMPS_5.1.2.tar.gz
Already downloaded: /Users/dpo/Library/Caches/Homebrew.jl/mumps-5.1.2.tar.gz
==> make alllib LIBEXT=.dylib AR=gfortran -dynamiclib -Wl,-install_name -Wl,/Users/dpo
==> make alllib RANLIB=echo OPTF=-O CDEFS=-DAdd_ ORDERINGSF=-Dpord CC=mpicc -fPIC FC=m
==> Downloading https://github.com/dpo/mumps_simple/archive/v0.4.tar.gz
Already downloaded: /Users/dpo/Library/Caches/Homebrew.jl/mumps--mumps_simple-0.4.tar.gz
==> make SHELL=/bin/bash CC=mpicc prefix=/Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cell
==> Caveats
MUMPS was built with shared libraries. If required,
static libraries are available in
  /Users/dpo/.julia/v0.6/Homebrew/deps/usr/opt/mumps/libexec/lib
==> Summary
🍺  /Users/dpo/.julia/v0.6/Homebrew/deps/usr/Cellar/mumps/5.1.2: 60 files, 15.3MB, built in 2 minutes 12 seconds

dpo avatar Feb 04 '18 23:02 dpo

Another issue is that Pkg.test("MUMPS") then fails with

ERROR: LoadError: LoadError: error compiling Type: could not load library "libmumps_simple"
dlopen(libmumps_simple.dylib, 1): image not found

while the library is present. The tests pass if I explicitly add $HOME/.julia/v0.6/Homebrew/deps/usr/lib to my LD_LIBRARY_PATH. But isn't Homebrew supposed to do that for me?

dpo avatar Feb 04 '18 23:02 dpo

Just to add to this,

julia> ENV["MPI_BASE_DIR"] = joinpath(Pkg.dir("Homebrew"), "deps", "usr", "opt", "open-mpi")
julia> using Homebrew
julia> Homebrew.brew(`install dpo/openblas/mumps`)

works, but provides(Homebrew.HB, "dpo/openblas/mumps", ...) doesn't, even when setting MPI_BASE_DIR. So something's off. Pkg.test() still doesn't work (it used to). Any ideas?

dpo avatar Mar 30 '18 14:03 dpo