Skip to content

Commit 6a57cca

Browse files
20260306 - update container definition files
1 parent c27e485 commit 6a57cca

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

hpc.qmd

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ Steps:
255255
g++ \
256256
cmake \
257257
git \
258-
sudo
258+
sudo \
259+
&& rm -rf /var/lib/apt/lists/*
259260
260261
# Install Mplus
261262
chmod +x /opt/MplusLinux64.bin
@@ -287,20 +288,18 @@ Steps:
287288
mkdir -p /opt/cmdstan
288289
R -e "cmdstanr::install_cmdstan(cores = 2, dir='/opt/cmdstan')"
289290
290-
# Create a symlink 'latest' to the installed CmdStan version
291-
cd /opt/cmdstan
292-
ln -s cmdstan-* latest
293-
294291
# Enable threading for within-chain parallelization
295292
mkdir -p /root/.R
296-
echo 'CXXFLAGS += -DSTAN_THREADS' >> /root/.R/Makevars
293+
echo 'STAN_THREADS=true' >> /root/.Renviron
294+
echo 'STAN_THREADS=true' >> /root/.R/Makevars
297295
298296
# Install latest version of petersenlab package from GitHub
299297
R -e "remotes::install_github('DevPsyLab/petersenlab')"
300298
301299
%environment
302300
export R_LIBS_USER=/usr/local/lib/R/site-library
303-
export CMDSTAN=/opt/cmdstan/latest
301+
export CMDSTAN=/opt/cmdstan
302+
export STAN_THREADS=true
304303
export PATH=/opt/mplus:$PATH
305304
306305
%runscript
@@ -332,7 +331,8 @@ Steps:
332331
g++ \
333332
cmake \
334333
git \
335-
sudo
334+
sudo \
335+
&& rm -rf /var/lib/apt/lists/*
336336
337337
# Install core CRAN packages (specify the packages to install here)
338338
R -e "install.packages(c(
@@ -359,20 +359,18 @@ Steps:
359359
mkdir -p /opt/cmdstan
360360
R -e "cmdstanr::install_cmdstan(cores = 2, dir='/opt/cmdstan')"
361361
362-
# Create a symlink 'latest' to the installed CmdStan version
363-
cd /opt/cmdstan
364-
ln -s cmdstan-* latest
365-
366362
# Enable threading for within-chain parallelization
367363
mkdir -p /root/.R
368-
echo 'CXXFLAGS += -DSTAN_THREADS' >> /root/.R/Makevars
364+
echo 'STAN_THREADS=true' >> /root/.Renviron
365+
echo 'STAN_THREADS=true' >> /root/.R/Makevars
369366
370367
# Install latest version of petersenlab package from GitHub
371368
R -e "remotes::install_github('DevPsyLab/petersenlab')"
372369
373370
%environment
374371
export R_LIBS_USER=/usr/local/lib/R/site-library
375-
export CMDSTAN=/opt/cmdstan/latest
372+
export CMDSTAN=/opt/cmdstan
373+
export STAN_THREADS=true
376374
377375
%runscript
378376
exec R "$@"
@@ -553,7 +551,8 @@ cd /Users/itpetersen/Documents/Projects/Bayesian_IRT/
553551
module purge
554552
555553
# Run the R script inside container
556-
apptainer exec /Users/itpetersen/Documents/Containers/r_argon.sif \
554+
apptainer exec --writable-tmpfs --cleanenv \
555+
/Users/itpetersen/Documents/Containers/r_argon.sif \
557556
Rscript ./Analyses/factorScores.R
558557
```
559558

0 commit comments

Comments
 (0)