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

Add build script for OSX and .pkg installer #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ mlpack Jenkins configuration and test support
---------------------------------------------

This repository contains a number of scripts which are used by Jenkins
(http://big.cc.gt.atl.ga.us) in order to build and test mlpack.
(http://big.mlpack.org:7780/) in order to build and test mlpack.
35 changes: 35 additions & 0 deletions build-on-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Install mlpack on OSX 10.11 (EI Capitan)

# assume we are in the root of mlpack project
# CMake and Xcode Command Line Tools are required

# git clone https://github.com/mlpack/mlpack
# cd mlpack

mkdir build
cd build

# compile armadillo and install for all user
curl -O http://tenet.dl.sourceforge.net/project/arma/armadillo-6.500.5.tar.gz
tar zxvf armadillo-6.500.5.tar.gz
cd armadillo-6.500.5
./configure
make -j4
make install
cd ..

# compile boost and and install for all user
curl -O http://netcologne.dl.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.gz
tar zxvf boost_1_60_0.tar.gz
cd boost_1_60_0
sh bootstrap.sh
./b2 install
cd ..

# compile mlpack
cmake -DDEBUG=OFF -DPROFILE=OFF ..
make -j4

# we do not need performance install on a build server
# make install
24 changes: 24 additions & 0 deletions packaging/build-osx-pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Build OS X .pkg installer
rm -rf res
mkdir res
cp -r ../build/bin res/
cp -r ../build/lib res/
cp -r ../build/include res/

cp ../README.md docs/
cp ../LICENSE.txt docs/

rm -rf pkg
mkdir pkg
pkgbuild --identifier org.mlpack.pkg \
--root ./res \
--version 2.0.1 \
--ownership recommended \
pkg/mlpacktools.pkg

productbuild --distribution distribution.plist \
--resources docs \
--package-path pkg \
--version 2.0.1 \
mlpack.pkg
26 changes: 26 additions & 0 deletions packaging/distribution.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="2">
<pkg-ref id="org.mlpack.pkg.osx"/>
<title>mlpack</title>
<organization>mlpack.org</organization>
<options customize="never" require-scripts="false"/>
<!-- <welcome file="README.md" mime-type="text/html" /> -->
<license file="LICENSE.txt" mime-type="text/html" />
<conclusion file="conclusion.txt" mime-type="text/html" />

<volume-check>
<allowed-os-versions>
<os-version min="10.9"/>
</allowed-os-versions>
</volume-check>
<choices-outline>
<line choice="install"/>
</choices-outline>

<choice id="install" visible="true" title="Install mlpack" description="Install mlpack command-line programs, library and header files"
customLocation="/usr/local">
<pkg-ref id="org.mlpack.install"/>
</choice>

<pkg-ref id="org.mlpack.install" version="0" onConclusion="none">mlpacktools.pkg</pkg-ref>
</installer-gui-script>
13 changes: 13 additions & 0 deletions packaging/docs/conclusion.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mlpack was installed at

/usr/local/bin

mlpack lib was installed at

/usr/local/lib

mlpack header file was installed at

/usr/local/include/mlpack

Make sure that /usr/local/bin is in your $PATH.