Skip to content

Commit

Permalink
Search for libgfortran.so and put it in deps/usr/lib
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsiqueira committed Dec 19, 2016
1 parent 5022817 commit b9a37de
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ libgsl = library_dependency("libgsl", aliases=["libgsl-0"])
#provides(Pacman, "gsl", libgsl)

if is_apple()
if Pkg.installed("Homebrew") === nothing
error("Homebrew package not installed, please run Pkg.add(\"Homebrew\")")
end
using Homebrew
provides(Homebrew.HB, "homebrew/versions/gsl1", libgsl, os = :Darwin)
if Pkg.installed("Homebrew") === nothing
error("Homebrew package not installed, please run Pkg.add(\"Homebrew\")")
end
using Homebrew
provides(Homebrew.HB, "homebrew/versions/gsl1", libgsl, os = :Darwin)
end

# build from source
Expand All @@ -25,6 +25,34 @@ provides(BuildProcess, Autotools(libtarget = "libgsl.la"), libgsl)

@BinDeps.install Dict(:libgsl => :libgsl)

# gfortran search
here = dirname(@__FILE__)

@static if is_linux()
found_libgfortran = false
if Libdl.find_library("libgfortran") == ""
locations = ["/usr/local/lib", "/usr/lib"]
try
gfortran_version = chomp(readstring(`gfortran -dumpversion`))[1:3]
push!(locations, "/usr/lib/gcc/x86_64-linux-gnu/$gfortran_version")
end
for d in locations
isdir(d) || continue
f = joinpath(d, "libgfortran.so")
if isfile(f)
run(`ln -s $f $(joinpath(here, "usr", "lib"))`)
found_libgfortran = true
break
end
end
else
found_libgfortran = true
end
if !found_libgfortran
error("libgfortran.so not found. Did you install it?")
end
end

## BinDeps end

function validate_libcutest()
Expand Down Expand Up @@ -52,7 +80,6 @@ function check_env()
nothing
end

here = dirname(@__FILE__)
cutestenv = joinpath(here, "cutestenv.jl")

if validate_libcutest()
Expand Down

0 comments on commit b9a37de

Please sign in to comment.