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

Bindeps again #105

Merged
merged 6 commits into from
Jan 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ matrix:
osx_image: xcode7.3


addons:
apt_packages:
- gfortran

branches:
only:
- master
Expand All @@ -34,6 +38,9 @@ branches:
sudo: required

before_install:
- if [ `uname` == "Linux" ]; then
unset DY_LIBRARY_PATH;
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/$(gfortran -dumpversion | cut -f1,2 -d.)/libgfortran.so /usr/local/lib; fi
- if [ `uname` == "Darwin" ]; then brew install gcc; fi
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi

Expand Down
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
BinDeps
julia 0.4
Compat 0.7.15
@osx Homebrew 0.4.0
Expand Down
32 changes: 29 additions & 3 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# We don't use BinDeps because we couldn't make it work

using Compat
using BinDeps

@BinDeps.setup

libgsl = library_dependency("libgsl", aliases=["libgsl-0"])

# package managers - currently with error on sudo
# https://discourse.julialang.org/t/installing-dependencies-error-sudo-no-tty-present-and-no-askpass-program-specified/778
#provides(AptGet, Dict("libgsl0ldbl"=>libgsl, "libgsl0-dev" =>libgsl, "gsl-bin"=>libgsl))
#provides(Yum, "gsl-devel", libgsl)
#provides(Pacman, "gsl", libgsl)

if is_apple()
if Pkg.installed("Homebrew") === nothing
error("Homebrew package not installed, please run Pkg.add(\"Homebrew\")")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unnecessary and redundant with @osx Homebrew in the REQUIRE file - all the packages you see this in have cargo-cult copy pasted it despite it being incorrect

end
using Homebrew
provides(Homebrew.HB, "homebrew/versions/gsl1", libgsl, os = :Darwin)
end

# build from source
provides(Sources, URI("http://ftp.gnu.org/gnu/gsl/gsl-1.16.tar.gz"), libgsl)
provides(BuildProcess, Autotools(libtarget = "libgsl.la"), libgsl)

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

## BinDeps end

function validate_libcutest()
env_cutest = get(ENV, "CUTEST", "")
Expand Down Expand Up @@ -76,7 +101,8 @@ else
cd("files") do
lnxurl = "https://raw.githubusercontent.com/abelsiqueira/linux-cutest/master/install.sh"
run(`wget $lnxurl -O install.sh`)
run(`bash install.sh --install-deps`)
ENV["C_INCLUDE_PATH"] = joinpath(here, "usr", "include")
run(`bash install.sh`)

open(cutestenv, "w") do cenv
open("cutest_env.bashrc") do f
Expand Down
19 changes: 16 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,22 @@ initial point, the bounds, an so on.

## Installing

On Linux, you'll need to install `wget`, `gfortran` and `gsl-1.16`. See [this
page](https://github.com/abelsiqueira/linux-cutest#requirements) for how to
install the requirements on some linux distributions.
On Linux, you'll need to install `wget` and `gfortran`, and possibly have to fix the location of `libgfortran.so`.

On Ubuntu 14.04, you can do this with
```
sudo apt-get install wget gfortran
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/$(gfortran -dumpversion | cut -f1,2 -d.)/libgfortran.so /usr/local/lib
```
On Ubuntu 16.04,
```
sudo apt-get install wget gfortran
sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so /usr/local/lib
```
On Archlinux, do
```
sudo pacman -S wget gfortran
```

The following commands should automatically download NLPModels.jl and CUTEst,
and install them.
Expand Down