Skip to content

fix RPATH issue with BinDeps install #7

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

Merged
merged 1 commit into from
May 10, 2015
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
34 changes: 14 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
language: julia

os:
- osx
- linux

julia:
- release

before_install:
- unset DYLD_LIBRARY_PATH
- if [ `uname` == "Linux" ]; then sudo apt-get install -y cmake; fi
#- if [ `uname` == "Darwin" ]; then brew --config; brew update; fi
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi

install:
# Install ASL.
#- if [ `uname` == "Darwin" ]; then brew tap homebrew/science; brew install asl; fi
- julia -e 'versioninfo()'
- julia -E 'Pkg.clone("https://github.com/optimizers/NLP.jl.git")'
- julia -E 'Pkg.clone(pwd())';
- julia -E 'Pkg.build("ampl");'
- julia -E 'using BinDeps; BinDeps.debug("ampl")'

- nightly
script:
- julia --check-bounds=yes -e 'Pkg.test("ampl"; coverage=true)'

# - if [ `uname` == "Linux" ]; then sudo apt-add-repository ppa:kalakris/cmake -y; fi
# - if [ `uname` == "Linux" ]; then sudo apt-get update -qq -y; fi
# - if [ `uname` == "Linux" ]; then sudo apt-get install -y cmake; fi
- if [ `uname` == "Linux" ]; then
wget http://www.cmake.org/files/v3.2/cmake-3.2.1-Linux-x86_64.tar.gz;
tar -xzf cmake-3.2.1-Linux-x86_64.tar.gz;
sudo cp -fR cmake-3.2.1-Linux-x86_64/* /usr;
export PATH=`pwd`/cmake-3.2.1-Linux-x86_64/bin:$PATH; fi
- which cmake
- cmake --version
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone("https://github.com/optimizers/NLP.jl.git")'
- julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build("ampl"); Pkg.test("ampl"; coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("ampl")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'

15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ OSX and Linux: [![Build Status](https://travis-ci.org/dpo/ampl.jl.svg?branch=mas

## How to Install

This is a rudimentary Julia interface to the AMPL Solver Library (ASL). Installing on OSX and Linux should be easy using [Homebrew](http://brew.sh) and [LinuxBrew](http://brew.sh/linuxbrew):

Make sure you have the ASL:

brew tap homebrew/science
brew install asl

At the Julia prompt, clone this repository and build:

````JULIA
Expand All @@ -20,13 +13,7 @@ julia> Pkg.clone("https://github.com/dpo/ampl.jl.git")
julia> Pkg.build("ampl")
````

In order for Julia to find the AMPL interface library, its location must
appear on your `LD_LIBRARY_PATH`:
````
export LD_LIBRARY_PATH=$(julia -E 'Pkg.dir()' | sed -e 's/"//g')/ampl/src:$LD_LIBRARY_PATH
````

Place the above in your `~/.bashrc` to make it permanent.
This will automatically use BinDeps to download and install the AMPL interface library.

## Testing

Expand Down
4 changes: 2 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ provides(SimpleBuild,
(@build_steps begin
ChangeDirectory(srcdir)
(@build_steps begin
`cmake -DCMAKE_INSTALL_PREFIX=$prefix -DBUILD_SHARED_LIBS=True`
`cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_INSTALL_RPATH=$prefix/lib -DBUILD_SHARED_LIBS=True`
`make all`
`make test`
`make install`
end)
end)
end), [libasl, libmp], os = :Unix)

@BinDeps.install
@BinDeps.install [:libasl => :libasl]
3 changes: 1 addition & 2 deletions src/ampl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ else
end

# Convenience macro.
const asl = "libasl";
macro asl_call(func, args...)
quote
ccall(($func, $asl), $(args...))
ccall(($func, libasl), $(args...))
end
end

Expand Down