Skip to content

Commit

Permalink
mlpack: Fixed packaging, introduce _cli subpackage (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrowerk committed Dec 13, 2017
1 parent bb6892b commit 84f1228
Showing 1 changed file with 106 additions and 101 deletions.
207 changes: 106 additions & 101 deletions sci-libs/mlpack/mlpack-2.2.5.recipe
Expand Up @@ -16,52 +16,8 @@ ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="?x86"

PROVIDES="
mlpack$secondaryArchSuffix = $portVersion
cmd:mlpack_adaboost$secondaryArchSuffix
cmd:mlpack_allkfn$secondaryArchSuffix
cmd:mlpack_allknn$secondaryArchSuffix
cmd:mlpack_allkrann$secondaryArchSuffix
cmd:mlpack_approx_kfn$secondaryArchSuffix
cmd:mlpack_cf$secondaryArchSuffix
cmd:mlpack_dbscan$secondaryArchSuffix
cmd:mlpack_decision_stump$secondaryArchSuffix
cmd:mlpack_decision_tree$secondaryArchSuffix
cmd:mlpack_det$secondaryArchSuffix
cmd:mlpack_emst$secondaryArchSuffix
cmd:mlpack_fastmks$secondaryArchSuffix
cmd:mlpack_gmm_generate$secondaryArchSuffix
cmd:mlpack_gmm_probability$secondaryArchSuffix
cmd:mlpack_gmm_train$secondaryArchSuffix
cmd:mlpack_hmm_generate$secondaryArchSuffix
cmd:mlpack_hmm_loglik$secondaryArchSuffix
cmd:mlpack_hmm_train$secondaryArchSuffix
cmd:mlpack_hmm_viterbi$secondaryArchSuffix
cmd:mlpack_hoeffding_tree$secondaryArchSuffix
cmd:mlpack_kernel_pca$secondaryArchSuffix
cmd:mlpack_kfn$secondaryArchSuffix
cmd:mlpack_kmeans$secondaryArchSuffix
cmd:mlpack_knn$secondaryArchSuffix
cmd:mlpack_krann$secondaryArchSuffix
cmd:mlpack_lars$secondaryArchSuffix
cmd:mlpack_linear_regression$secondaryArchSuffix
cmd:mlpack_local_coordinate_coding$secondaryArchSuffix
cmd:mlpack_logistic_regression$secondaryArchSuffix
cmd:mlpack_lsh$secondaryArchSuffix
cmd:mlpack_mean_shift$secondaryArchSuffix
cmd:mlpack_nbc$secondaryArchSuffix
cmd:mlpack_nca$secondaryArchSuffix
cmd:mlpack_nmf$secondaryArchSuffix
cmd:mlpack_pca$secondaryArchSuffix
cmd:mlpack_perceptron$secondaryArchSuffix
cmd:mlpack_preprocess_binarize$secondaryArchSuffix
cmd:mlpack_preprocess_describe$secondaryArchSuffix
cmd:mlpack_preprocess_imputer$secondaryArchSuffix
cmd:mlpack_preprocess_split$secondaryArchSuffix
cmd:mlpack_radical$secondaryArchSuffix
cmd:mlpack_range_search$secondaryArchSuffix
cmd:mlpack_softmax_regression$secondaryArchSuffix
cmd:mlpack_sparse_coding$secondaryArchSuffix
lib:libmlpack$secondaryArchSuffix = $portVersion compat >= 2.2
mlpack$secondaryArchSuffix = $portVersion compat >= 2
lib:libmlpack$secondaryArchSuffix = $portVersion compat >= 2
"
REQUIRES="
haiku$secondaryArchSuffix
Expand All @@ -77,9 +33,60 @@ REQUIRES="
lib:libsuperlu$secondaryArchSuffix
"

PROVIDES_cli="
cmd:mlpack_adaboost = $portVersion compat >= 2
cmd:mlpack_allkfn = $portVersion compat >= 2
cmd:mlpack_allknn = $portVersion compat >= 2
cmd:mlpack_allkrann = $portVersion compat >= 2
cmd:mlpack_approx_kfn = $portVersion compat >= 2
cmd:mlpack_cf = $portVersion compat >= 2
cmd:mlpack_dbscan = $portVersion compat >= 2
cmd:mlpack_decision_stump = $portVersion compat >= 2
cmd:mlpack_decision_tree = $portVersion compat >= 2
cmd:mlpack_det = $portVersion compat >= 2
cmd:mlpack_emst = $portVersion compat >= 2
cmd:mlpack_fastmks = $portVersion compat >= 2
cmd:mlpack_gmm_generate = $portVersion compat >= 2
cmd:mlpack_gmm_probability = $portVersion compat >= 2
cmd:mlpack_gmm_train = $portVersion compat >= 2
cmd:mlpack_hmm_generate = $portVersion compat >= 2
cmd:mlpack_hmm_loglik = $portVersion compat >= 2
cmd:mlpack_hmm_train = $portVersion compat >= 2
cmd:mlpack_hmm_viterbi = $portVersion compat >= 2
cmd:mlpack_hoeffding_tree = $portVersion compat >= 2
cmd:mlpack_kernel_pca = $portVersion compat >= 2
cmd:mlpack_kfn = $portVersion compat >= 2
cmd:mlpack_kmeans = $portVersion compat >= 2
cmd:mlpack_knn = $portVersion compat >= 2
cmd:mlpack_krann = $portVersion compat >= 2
cmd:mlpack_lars = $portVersion compat >= 2
cmd:mlpack_linear_regression = $portVersion compat >= 2
cmd:mlpack_local_coordinate_coding = $portVersion compat >= 2
cmd:mlpack_logistic_regression = $portVersion compat >= 2
cmd:mlpack_lsh = $portVersion compat >= 2
cmd:mlpack_mean_shift = $portVersion compat >= 2
cmd:mlpack_nbc = $portVersion compat >= 2
cmd:mlpack_nca = $portVersion compat >= 2
cmd:mlpack_nmf = $portVersion compat >= 2
cmd:mlpack_pca = $portVersion compat >= 2
cmd:mlpack_perceptron = $portVersion compat >= 2
cmd:mlpack_preprocess_binarize = $portVersion compat >= 2
cmd:mlpack_preprocess_describe = $portVersion compat >= 2
cmd:mlpack_preprocess_imputer = $portVersion compat >= 2
cmd:mlpack_preprocess_split = $portVersion compat >= 2
cmd:mlpack_radical = $portVersion compat >= 2
cmd:mlpack_range_search = $portVersion compat >= 2
cmd:mlpack_softmax_regression = $portVersion compat >= 2
cmd:mlpack_sparse_coding = $portVersion compat >= 2
"
REQUIRES_cli="
mlpack$secondaryArchSuffix == $portVersion base
$REQUIRES
"

PROVIDES_devel="
mlpack${secondaryArchSuffix}_devel = $portVersion
devel:libmlpack$secondaryArchSuffix = $portVersion compat >= 2.2
mlpack${secondaryArchSuffix}_devel = $portVersion compat >= 2
devel:libmlpack$secondaryArchSuffix = $portVersion compat >= 2
"
REQUIRES_devel="
mlpack$secondaryArchSuffix == $portVersion base
Expand All @@ -102,67 +109,18 @@ BUILD_PREREQUIRES="
cmd:g++$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:strip$secondaryArchSuffix
"

defineDebugInfoPackage mlpack$secondaryArchSuffix \
$libDir/libmlpack.so.2.2 \
$binDir/mlpack_adaboost$secondaryArchSuffix \
$binDir/mlpack_allkfn$secondaryArchSuffix \
$binDir/mlpack_allknn$secondaryArchSuffix \
$binDir/mlpack_allkrann$secondaryArchSuffix \
$binDir/mlpack_approx_kfn$secondaryArchSuffix \
$binDir/mlpack_cf$secondaryArchSuffix \
$binDir/mlpack_dbscan$secondaryArchSuffix \
$binDir/mlpack_decision_stump$secondaryArchSuffix \
$binDir/mlpack_decision_tree$secondaryArchSuffix \
$binDir/mlpack_det$secondaryArchSuffix \
$binDir/mlpack_emst$secondaryArchSuffix \
$binDir/mlpack_fastmks$secondaryArchSuffix \
$binDir/mlpack_gmm_generate$secondaryArchSuffix \
$binDir/mlpack_gmm_probability$secondaryArchSuffix \
$binDir/mlpack_gmm_train$secondaryArchSuffix \
$binDir/mlpack_hmm_generate$secondaryArchSuffix \
$binDir/mlpack_hmm_loglik$secondaryArchSuffix \
$binDir/mlpack_hmm_train$secondaryArchSuffix \
$binDir/mlpack_hmm_viterbi$secondaryArchSuffix \
$binDir/mlpack_hoeffding_tree$secondaryArchSuffix \
$binDir/mlpack_kernel_pca$secondaryArchSuffix \
$binDir/mlpack_kfn$secondaryArchSuffix \
$binDir/mlpack_kmeans$secondaryArchSuffix \
$binDir/mlpack_knn$secondaryArchSuffix \
$binDir/mlpack_krann$secondaryArchSuffix \
$binDir/mlpack_lars$secondaryArchSuffix \
$binDir/mlpack_linear_regression$secondaryArchSuffix \
$binDir/mlpack_local_coordinate_coding$secondaryArchSuffix \
$binDir/mlpack_logistic_regression$secondaryArchSuffix \
$binDir/mlpack_lsh$secondaryArchSuffix \
$binDir/mlpack_mean_shift$secondaryArchSuffix \
$binDir/mlpack_nbc$secondaryArchSuffix \
$binDir/mlpack_nca$secondaryArchSuffix \
$binDir/mlpack_nmf$secondaryArchSuffix \
$binDir/mlpack_pca$secondaryArchSuffix \
$binDir/mlpack_perceptron$secondaryArchSuffix \
$binDir/mlpack_preprocess_binarize$secondaryArchSuffix \
$binDir/mlpack_preprocess_describe$secondaryArchSuffix \
$binDir/mlpack_preprocess_imputer$secondaryArchSuffix \
$binDir/mlpack_preprocess_split$secondaryArchSuffix \
$binDir/mlpack_radical$secondaryArchSuffix \
$binDir/mlpack_range_search$secondaryArchSuffix \
$binDir/mlpack_softmax_regression$secondaryArchSuffix \
$binDir/mlpack_sparse_coding$secondaryArchSuffix
$libDir/libmlpack.so.2.2

BUILD()
{
mkdir -p build && cd "$_"

cmake .. \
-DCMAKE_INSTALL_BINDIR=$binDir \
-DCMAKE_INSTALL_DATADIR=$dataDir \
-DCMAKE_INSTALL_DOCDIR=$docDir \
-DCMAKE_INSTALL_INCLUDEDIR=$includeDir \
-DCMAKE_INSTALL_LIBDIR=$libDir \
-DCMAKE_INSTALL_MANDIR=$manDir
-DCMAKE_INSTALL_PREFIX=$prefix \
-DBUILD_TESTS=OFF

# mlpack easily eats up all your ram, so don't do parallel jobs!
make
Expand All @@ -171,7 +129,6 @@ BUILD()
INSTALL()
{
cd build
mkdir -p $libDir/pkgconfig

make install $jobArgs

Expand All @@ -183,12 +140,60 @@ INSTALL()

fixPkgconfig

packageEntries cli \
$binDir/mlpack_adaboost \
$binDir/mlpack_allkfn \
$binDir/mlpack_allknn \
$binDir/mlpack_allkrann \
$binDir/mlpack_approx_kfn \
$binDir/mlpack_cf \
$binDir/mlpack_dbscan \
$binDir/mlpack_decision_stump \
$binDir/mlpack_decision_tree \
$binDir/mlpack_det \
$binDir/mlpack_emst \
$binDir/mlpack_fastmks \
$binDir/mlpack_gmm_generate \
$binDir/mlpack_gmm_probability \
$binDir/mlpack_gmm_train \
$binDir/mlpack_hmm_generate \
$binDir/mlpack_hmm_loglik \
$binDir/mlpack_hmm_train \
$binDir/mlpack_hmm_viterbi \
$binDir/mlpack_hoeffding_tree \
$binDir/mlpack_kernel_pca \
$binDir/mlpack_kfn \
$binDir/mlpack_kmeans \
$binDir/mlpack_knn \
$binDir/mlpack_krann \
$binDir/mlpack_lars \
$binDir/mlpack_linear_regression \
$binDir/mlpack_local_coordinate_coding \
$binDir/mlpack_logistic_regression \
$binDir/mlpack_lsh \
$binDir/mlpack_mean_shift \
$binDir/mlpack_nbc \
$binDir/mlpack_nca \
$binDir/mlpack_nmf \
$binDir/mlpack_pca \
$binDir/mlpack_perceptron \
$binDir/mlpack_preprocess_binarize \
$binDir/mlpack_preprocess_describe \
$binDir/mlpack_preprocess_imputer \
$binDir/mlpack_preprocess_split \
$binDir/mlpack_radical \
$binDir/mlpack_range_search \
$binDir/mlpack_softmax_regression \
$binDir/mlpack_sparse_coding

packageEntries devel \
$developDir
}

TEST()
{
# Switch it on first in BUILD()
# Takes way too much time to build the tests
cd build
make test
}

0 comments on commit 84f1228

Please sign in to comment.