It seems worth mentioning that line 50 of the standard build script is not compatible with OS X, which does not support 'grep -P'. Perhaps this change would be useful:
# test=`echo $1 | grep -P '^\d+$'`
test=`echo $1 | egrep '^[[:digit:]]+$'`
Although I have not finished getting ROMS working with MPI, it seems this change should have the desired behavior on both OS X and other platforms.