#!/bin/sh -f

if test "$ELMER_LIB" = ""; then
  if  test "$ELMER_HOME" = ""; then
     LIBDIR=/opt/elmerfem-9.0/lib
  else
     LIBDIR=$ELMER_HOME/lib
  fi
else
  LIBDIR=$ELMER_LIB
fi

LD=/usr/lib64/mpi/gcc/openmpi5/bin/mpifort
cmd="$LD -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -fallow-argument-mismatch -fPIC -shared $* -L/opt/elmerfem-9.0/lib/elmersolver -L$LIBDIR -lelmersolver"
printf "%s " $cmd
printf "\n"
$LD -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -fallow-argument-mismatch -fPIC -shared $* -L/opt/elmerfem-9.0/lib/elmersolver -L$LIBDIR -lelmersolver
#      $* -L$LIBDIR -lelmersolver
#      $*
