Thank you very much for the guidance. It’s very useful. I checked accordingly and noticed LDFLAGS
was not being used. This led me to suspect it was not set correctly despite echo $LDFLAGS
showed the correct value.
On the cluster in concern, the setup uses a tcsh
shell and does not have the export
command. I thought set
is its equivalent. But after a double check (with printenv
not showing the LDFLAGS
), I found that setenv
should be used to set the environment variables. This fixes the compilation error.
I also would like to take this opportunity to make a note about running multiple chains as an array of batch jobs on different clusters. I have access to two clusters. In one cluster, the following commands in the .sh
script works (explained in this post):
#PBS -t 1-4
cd ~/cmdstan-2.19.1
../SSM0.5.2dev sample algorithm=hmc metric=dense_e adapt delta=0.8 id=$PBS_ARRAYID data file=../SSM_data.dat output file=samples$PBS_ARRAYID.csv
However, in the other cluster, I need to indicate the array of jobs as an option of the qsub
command:
qsub -t 1-4 [yourshellscriptname].sh
In the shell script, I need to use $SGE_TASK_ID
, instead of $PBS_ARRAYID
:
export PATH=$HOME/gcc-4.9.4/bin:$PATH
export LDFLAGS="-Wl,-rpath,$HOME/gcc-4.9.4/bin"
export LD_LIBRARY_PATH=$HOME/gcc-4.9.4/lib64
cd ~/cmdstan-2.19.1
../SSM0.5.2dev sample algorithm=hmc metric=dense_e adapt delta=0.8 id=$SGE_TASK_ID data file=../SSM_data.dat output file=samples$SGE_TASK_ID.csv
I also need to use the export
command to set the environment variables because in the batch mode, the cluster uses a csh
shell that has no such variables set as usual as in the interactive mode.
I hope these details would make another user’s life easier.