Skip to content
Snippets Groups Projects
compile_for_plain.sh 934 B
#!/bin/bash
#SBATCH -t 0-04:00
#SBATCH --nodes=1
#SBATCH --tasks-per-node=1
#SBATCH --cpus-per-task=24
#SBATCH -A p_readex
#SBATCH --mem=62000

# interactive
# srun -N 1 --tasks-per-node=1 --cpus-per-task=24 --time 2:00:00 -p interactive --exclusive --x11  --pty bash

################################################################################
# SET PATH TO MODULES 
ENV_SET_FILE=$(pwd)/FOAMMODULES-GCC-Taurus.sh

# GCC compiler
cp OpenFOAM-v1612+/etc/bashrc-GCC6 OpenFOAM-v1612+/etc/bashrc

# NO SCOREP flags
cp OpenFOAM-v1612+/wmake/rules/linux64Gcc/c++ORIGIN OpenFOAM-v1612+/wmake/rules/linux64Gcc/c++

################################################################################
source $ENV_SET_FILE
echo "source $ENV_SET_FILE" > foammodules.sh

#foam
cd $(pwd)/OpenFOAM-v1612+
depth=1

# compile
if [ $depth -eq 1 ]
then
	./Allwmake
elif [ $depth -eq 2 ]
then
	cd src
	./Allwmake
	cd ..
	. dirSimple
	wclean
	wmake
fi