-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild-codapack-macos
More file actions
executable file
·58 lines (42 loc) · 1.49 KB
/
build-codapack-macos
File metadata and controls
executable file
·58 lines (42 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env zsh
set -e
ROOT="$(cd "$(dirname "$0")" && pwd)"
unset R_HOME
export JAVA_HOME=$ROOT/jdk-17
export MAVEN_HOME=$ROOT/apache-maven-3.9.2
export R_HOME=/Applications/CoDaPack.app/Contents/R_internal
export R_LIBS_USER=$ROOT/Rlibraries
export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$R_HOME/bin:$PATH
# Establim locale per evitar advertències d'R
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Permetem executar jdk-17
sudo xattr -dr com.apple.quarantine jdk-17
# Verifiquem que R estigui disponible
command -v R >/dev/null 2>&1 || { echo >&2 "R not found in PATH"; exit 1; }
export R_HOME=$(R RHOME)
# Configura Java a R (important per rJava)
echo "Running javareconf..."
R CMD javareconf
cd "$ROOT"
echo "Building Java package..."
mvn package
echo "Installing R packages..."
Rscript -e "TYPE='source'; LIB='$R_LIBS_USER'; source('install_packages.R')"
# Copiar llibreries R existents
# echo "Copying R libraries..."
# LIBS=( abind doParallel iterators magic pdfCluster rJava
# cluster flexmix kernlab MASS prabclus rlang
# coda.base foreach knitr mclust Rcpp robustbase
# DEoptimR fpc linprog modeltools RcppArmadillo tclust
# diptest geometry lpSolve mvtnorm RcppProgress zCompositions )
# mkdir -p "$R_LIBS_USER"
# for lib in $LIBS; do
# SRC_DIR=$(Rscript -e "cat(find.package('$lib'))")
# if [ -d "$SRC_DIR" ]; then
# cp -R "$SRC_DIR" "$R_LIBS_USER/"
# else
# echo "Warning: Library $lib not found"
# fi
# done
echo "Build completed successfully."