libirc.a compiling error

libirc.a compiling error

I'm using intel 11.1 compilers at linux ubuntu 10.04, kernel 2.6 system, and i've tried to compile the mfix program, everything runs ok, but at the end of the compiling process I got the following message:

______________________________________________________________________________________
ld: mfix.exe: hidden symbol `__intel_cpu_indicator_init' in /opt/intel/Compiler/11.1/073/lib/ia32/libirc.a(cpu_dis.o) is referenced by DSO

ld: final link failed: Nonrepresentative section on output

make: ***[mfix.exe] Error 1

***File mfix.exe NOT created
_______________________________________________________________________________________

It seems that is something wrong with libirc.a library.

Any help is very welcome

22 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The linker messages may be suggesting some link specific options might be in conflict with linking the static form (libirc.a).

Perhaps this mfix program should be linking libirc.so?
Have you built this program with any earlier 11.1 intel compilers?

Itlooks like perhapsa shared library is linked in that may not be built correctly in that it does not have libirc.a built into it.

Can you provide more details on the link options used?

And let us know if this app built correctly with earlier Intel 11.1 compilers or not.

Kevin:
I'll check what you say in previous answers.
I have not built this app using Intel 11.1 compilers, I got a correct built 4 years ago using that Intel compilers, I don't remember the version.

Such problems can occur when mixing different versions of the libraries. Please take care that everything is rebuilt, if possible, with the current compiler, and that everything is linked against the current libraries.

It seems something is wrong with libirc.a.

The compiler options are:

ifort -lsvml

link -I

More details are needed here or a reproducing test case. It appears you have an object named cpu_dis.o from your program that resides in a shared library that references the indicated hidden symbol. By default, DSOs are allowed to be created with missing symbols at link time but there are link options to disallow that.

Please post the complete link command-line that is executed by your makefile.

Hi, I have the same problem!
I'm trying to use mfix (a fortran code for Multiphase flow written in Fortran)
and at the end of a compiling (with the commandI obtain
ld: mfix.exe: hidden symbol `__intel_cpu_indicator_init' in
/opt/intel/Compiler/11.1/073/lib/ia32/libirc.a(cpu_dis.o) is referenced
by DSO

ld: final link failed: Nonrepresentative section on output

make: ***[mfix.exe] Error 1

***File mfix.exe NOT created

What is the problem?

Help!

The root-cause is still unknown. The link message alone is insufficient to conclude there is an issue with libirc.a. The information I found about this message suggests there is a shared library being linked inthat isn't built with the reference to the indicated symbol being fully resolved as the linker expected.

As I've requested earlier, more information is needed about the complete link command and one should also be looking into the mfix app to find where cpu_dis.o is coming from (likely an .so) because that is not a libirc.a routine.

You are right.

The entire file make_mfix is too long to post.

This is the first part:
!/bin/bsh -f
#
# MFIX script file for obtaining user-defined files and
# executing 'make'
# Usage:
# 1) on unix machines : sh mfix/model/make_mfix
# 2) on NT using PGI bash : bash mfix/model/make_mfix
#
# M. Syamlal and P. Nicoletti 9-27-94
# A. Gel (Aeolus Research) revision 8-31-05
#
vers="2007-4"
# Flag variable for compiling with Pentium 4 specific optimization flags
# Set to 0 to avoid Pentium 4 specific optimizations
P4_OPTIMIZE=1
#
#============ TAU related settings ===================
# Flag variable to enable TAU automatic instrumentation for performance
# profiling
#USE_TAU=1
# ***** I M P O R T A N T
# MUST set the TAUROOTDIR environment variable to a valid path of TAU installation
# if USE_TAU is enabled.
# FOLLOWING PATH SETTINGS is FOR NCCS
TAUROOTDIR=/spin/proj/perc/TOOLS/tau_latest
# MUST set the PDTROOTDIR environment variable to a valid path of PDToolkit installation
# if USE_TAU is enabled.
PDTROOTDIR=/spin/proj/perc/TOOLS/pdtoolkit-3.11
#
#========== end of TAU related settings ==============
#
# Flag variable for compiling with interfaces to call ISAT
# To set to true, change this to 1. By default it is set to false (0).
DO_ISAT=0
#
echo
echo
echo "*******************************************"
echo "* Creating the MFIX-executable mfix.exe *"
echo "* Version $vers *"
echo "*******************************************"
echo

#
# Get run directory name
#
set `pwd` ; run_dir=$1
#
# Get path name to mfix directory and cd to mfix directory
#
mfix=`echo $0 | sed 's/\/make_mfix//'`
cd $mfix
set `pwd` ; mfix=$1

if test $mfix = $run_dir
then
echo "*** Execute this command from any directory other than the current directory!"
echo "*** It is usually executed from a run directory containing user defined files."
echo
exit
fi

# get user input
echo
echo "MFIX directory is $mfix"
echo

# write mfix/model path into the file mfix_directory_path.inc, if it already does not exist
if grep -qs " CHARACTER(len=132) :: MFIX_PATH = '$mfix'" mfix_directory_path.inc
then
echo " "
else
echo " CHARACTER(len=132) :: MFIX_PATH = '$mfix'" > mfix_directory_path.inc
fi

echo -n "Do you need SMP version? (y/n) [no] "
read smp_version

echo
echo -n "Do you need DMP version? (y/n) [no] "
read dmp_version

#
#------------------------------------------------------------------------
# Define machine dependent flags and copy machine dependent files
# Check whether the last compilation was on the same machine.
# Give a different name for each machine file (IRIXF90.F, ULTRIX.F, etc.)

set `uname -s` ; opsys=$1
set `uname -p` ; proctyp=$1

#------------------------------------------------------------------------
# Check if the system is a Linux system, to display WARNING message
if test $opsys = "Linux"
then
if test $proctyp = "x86_64" -o $proctyp = "ppc64"
then
P4_OPTIMIZE=0
else
echo
echo "-------------- W A R N I N G ---------------------"
echo " For compiling on Linux with Intel compilers: "
echo " ---------------------------- "
echo "MFIX will be compiled with applicable optimization flags"
echo "if the next question is answered [no]. "
echo "Note that, default optimization flags are for "
echo " Pentium 4 processors ONLY! "
echo "You can enable non-Pentium 4 specific optimization flags "
echo "by editing line 14 in model/make_mfix to set : "
echo "P4_OPTIMIZE=0 "
echo "--------------------------------------------------------"
echo
fi
fi

echo -n "Do you need debug version? (y/n) [no] "
read dbg_version
echo
echo -n "Force re-compilation of source files in run directory? (y/n) [no] "
read auto_compile

case $dmp_version in
y|Y )

mpi_include="/usr/include"

echo
echo -n "checking for mpif.h in the default directory $mpi_include"
if test -f "$mpi_include/mpif.h"
then
echo
echo -n "using mpif.h from $mpi_include"
else
echo
echo -n "input the location of the directory where mpif.h resides: "
read mpi_include
fi
;;
*)
mpi_include="$mfix/dmp_modules/mpi_donothing"
echo " "
echo " "
if [ "$USE_TAU" ]
then
echo " "
echo "-------------- W A R N I N G ---------------------"
echo "Current configuration of MFIX makefile for TAU can be only used in dmp mode"
echo "Continuing with compilation without TAU directives"
echo "--------------------------------------------------------"
echo " "
echo " "
unset USE_TAU
fi
;;
esac
ln -sf "$mpi_include/mpif.h" .

#-----
# Check if the mpif.h header is LAM/MPI header file or MPICH
# if it is determined to be LAM/MPI then terminate compilation with a msg
#-----
if [ "$USE_TAU" ]
then
if grep 'LAM' $mfix/mpif.h >/dev/null ; then
echo " "
echo "-------------- M P I L I B R A R Y E R R O R ----------"
echo " USE_TAU flag was enabled in make_mfix for inserting TAU profiling"
echo " directives automatically during compilation."
echo " "
echo " Current installation of TAU only works with MPICH library!"
echo " MPI header file, mpif.h was determined to be LAM/MPI header file!"
echo " Please either change your MPI settings to point for MPICH library"
echo " (if you would like to have TAU profiling) or "
echo " disable USE_TAU flag at line 19 of make_mfix"
echo "--------------------------------------------------------"
echo " "
exit
fi
fi
#------------------------------------------------------------------------
# Check if the system is a Linux system, if yes then ask the user which
# compiler to use
#
if test $opsys = "CYGWIN_NT-6.0"
then
echo
echo
echo "CYGWIN on Windows Detected"
echo
echo "=============================================================="
echo "MFIX Compilation directives available for following compilers:"
echo "=============================================================="
echo " [1] g95"
echo " [2] gfortran"
echo " "
echo -n "Select the compiler to compile MFIX? [2] "
read cygwin_compiler
case $cygwin_compiler in
1 )
echo " "
echo "g95 compiler selected"
opsys="CYGWIN_NT-6.0-g95"
;;
* )
echo " "
echo "gfortran Compiler selected"
opsys="CYGWIN_NT-6.0-gfortran"
;;
esac
fi

if test $opsys = "Linux"
then
if test $proctyp = "x86_64"
then
echo
echo
echo "64 bit Linux system detected, please select compiler."
echo
echo "=============================================================="
echo "MFIX Compilation directives available for following compilers:"
echo "=============================================================="
echo " [1] Intel Fortran Compiler (IFORT - FCE for 64 bit)"
echo " [2] Intel Fortran Compiler (IFORT - FCE for 64 bit) on AMD Opteron"
echo " [3] Portland Group Linux Fortran Compiler (pgf90)"
echo " [4] PathScale compiler (pathf90)"
echo " [5] Portland Group Linux Fortran Compiler (pgf90) on AMD Opteron"
echo " [6] Portland Group Linux Fortran Compiler (pgf90) on Cray XT3 at PSC"
echo " [7] Portland Group Linux Fortran Compiler (pgf90) on Cray XT4 at NCCS"
echo " [8] PathScale Compiler (pathf90) on Cray XT4 at NCCS"
echo " [9] Pathscale Compiler (pathf90) on Cray XT4 at NERSC"
echo " [10] IBM Fortran Compiler (xlf90) on Blue Gene at ANL ALCF"
echo " [11] gfortran"
echo " "
echo -n "Select the compiler to compile MFIX? [1] "
read lnx_compiler
case $lnx_compiler in
1 )
echo " "
echo "Intel Compiler selected"
opsys="Linux_64_intel"
;;
2 )
echo " "
echo "Intel Compiler selected for AMD Opteron"
opsys="Linux_64_intel_amd64"
;;
3 )
echo " "
echo "Portland Group Linux Fortran Compiler selected"
opsys="Linux_64_pgi"
;;
4 )
echo " "
echo "PathScale Compiler selected"
opsys="Linux_64_pscale"
;;
5 )
echo " "
echo "Portland Group Linux Fortran Compiler for AMD Opteron selected"
opsys="Linux_64_pgi_amd64"
;;
6 )
echo " "
echo "Portland Group Linux Fortran Compiler for Cray XT3 at PSC selected"
opsys="Linux_64_pgi_xt_psc"
;;
7 )
echo " "
echo "Portland Group Linux Fortran Compiler for Cray XT4 at NCCS selected"
opsys="Linux_64_pgi_xt_nccs"
;;
8 )
echo " "
echo "PathScale Compiler (pathf90) on Cray XT4 at NCCS selected"
opsys="Linux_64_pscale_xt_nccs"
;;
9 )
echo " "
echo "PathScale Compiler (pathf90) on Cray XT4 at NERSC selected"
opsys="Linux_64_pscale_xt_nersc"
;;
10 )
echo " "
echo "IBM Fortran Compiler (xlf90) on Blue Gene at ANL ALCF"
opsys="Linux_64_xlf_anl"
;;
11 )
echo " "
echo "Gfortran"
opsys="Linux_64_gfort"
;;
*)
echo " "
echo "Intel Compiler selected"
opsys="Linux_64_intel"
;;
esac

if test $opsys = "Linux_64_intel" -o $opsys = "Linux_64_intel_amd64"
then

echo "______ If you get 'ifort: Command not found' _______"
echo "IFORT environment variables are not defined"
echo " "
echo "Please add the following in your shell and rerun make_mfix"
echo "for .cshrc 'source path_to_fce_9.0/bin/ifortvars.csh'"
echo "for .kshrc or .bashrc 'source path_to_fce_9.0/bin/ifortvars.sh'"
fi

if test $opsys = "Linux_64_pgi"
then
if [ "$PGI" ]
then
echo " "
else
echo "______ Environment variable ERROR _______"
echo "Environment variable for Portland Group is not defined !"
echo " "
echo "Please define the following in your shell and rerun make_mfix"
echo " setenv PGI your_path_of_PGI_root_directory"
exit
fi
fi

# Temporarily disable PSCALE and ACML env variable check
#if test $opsys = "Linux_64_pscale"
#then
# if [ "$PSCALE" ]
# then
echo " "
# else
# echo "______ Environment variable ERROR _______"
# echo "Environment variable for PathScale is not defined !"
# echo " "
# echo "Please define the following in your shell and rerun make_mfix"
# echo " setenv PSCALE your_path_of_PathScale_root_directory"
# exit
# fi
#fi

#if test $opsys = "Linux_64_pscale" -o $opsys = "Linux_64_intel_amd64"
#then
# if [ "$ACML" ]
# then
# echo " "
# else
# echo "______ Environment variable ERROR _______"
# echo "Environment variable for ACML library is not defined !"
# echo " "
# echo "Please define the following in your shell and rerun make_mfix"
# echo " setenv ACML -L your_path_of_ACML_root_directory"
# echo "e.g. "
# echo " setenv ACML -L/usr/common/usg/acml/3.6.0/pathscale64/lib"
# exit
# fi
#fi

else # test $opsys = "Linux" branch

echo
echo
echo "32 bit Linux system detected, please select compiler."
echo
echo "=============================================================="
echo "MFIX Compilation directives available for following compilers:"
echo "=============================================================="
echo " [1] Portland Group Linux Fortran Compiler (pgf90)"
echo " [2] Intel Fortran Compiler version 9.X (ifort) "
echo " [3] Intel Fortran Compiler version 10.X (ifort)"
echo " "
echo -n "Select the compiler to compile MFIX? [2] "
read lnx_compiler

case $lnx_compiler in
1 )
echo " "
echo "Portland Group Linux Fortran Compiler selected"
opsys="Linux_pgi"
;;
3 )
echo " "
echo "Intel Linux Fortran Compiler version 10.X selected"
opsys="Linux_ifc10"
;;
2 )
echo " "
echo "Intel Linux Fortran Compiler version 9.X selected"
opsys="Linux_ifc9"
;;
*)
echo " "
echo "Intel Linux Fortran Compiler version 9.X selected"
opsys="Linux_ifc9"
;;
esac

fi # end of test $opsys = "Linux" branch
else
echo
fi

# Note:
# compile3 and compile_d3 flags are passed to makefile for compiling
# F77 based codes (e.g. ODEPACK ) for optimized and debug
# versions, respectively.
#
case $opsys in

OSF1)
mach_file="OSF1.F"

FORTRAN_CMD=f90
LINK_CMD=f90
libs_d="-lcxmlp -lmpi -lelan"
libs="-lcxmlp -lmpi -lelan"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-omp"
compile_d="-c -I. -I$mpi_include -C -trapuv -g -free -nowarn -assume byterecl -convert big_endian "
compile_d2="-c -I. -I$mpi_include -C -trapuv -g -free -nowarn -assume byterecl -convert big_endian "
compile_d3="-c -I. -I$mpi_include -C -trapuv -g -free -nowarn -assume byterecl -convert big_endian "
link_d="-C -g -nowarn -assume byterecl -convert big_endian"

compile="-c -I. -I$mpi_include -O5 -free -nowarn -assume byterecl -convert big_endian "
compile2="-c -I. -I$mpi_include -O5 -nowarn -assume byterecl -convert big_endian "
compile3="-c -I. -I$mpi_include -O5 -free -nowarn -assume byterecl -convert big_endian "
link="-O5 -nowarn -assume byterecl -convert big_endian"
MODULE_CODE=1
;;

AIX)
mach_file="AIX.F"

case $dmp_version in
y|Y )
FORTRAN_CMD=mpxlf90_r
LINK_CMD=mpxlf90_r
;;
*)
FORTRAN_CMD=xlf90_r
LINK_CMD=xlf90_r
;;
esac

libs_d="-lblas "
libs="-lblas -lesslp2_r"

OBJ_EXT=o
FORTRAN_EXT=f

# =============================
# use mpxlf90_r or xlf90_r
# for thread safe code
# =============================
omp="-qsmp=omp -qsmp=noauto -qnosave "

# =================================
# the module directory cannot be on
# a GPFS parallel file system
# =================================
moddir=/tmp/$USER
if test -d $moddir
then
touch $moddir
else
mkdir $moddir
fi

compile_common="-c -q32 -bmaxstack:2000000000 -bmaxdata:2000000000 -c -I. -freeform -I$moddir -qmoddir=$moddir "
compile_d="-C -g -qinitauto=FF -qflttrap -freeform $compile_common"
compile_d2="-C -g -qinitauto=FF -qflttrap -freeform $compile_common"
compile_d3="-C -g -qinitauto=FF -qflttrap -freeform $compile_common"
link_d="$compile_d"

compile=" -O3 -qhot -qstrict -qarch=pwr3 -qtune=pwr3 -qcache=auto $compile_common"
compile2="-c -q32 -bmaxstack:2000000000 -bmaxdata:2000000000 -c -I. -I$moddir -qmoddir=$moddir -O3 -qhot -qstrict -qarch=pwr3 -qtune=pwr3 -qcache=auto $compile_common"
compile3=" -O3 -qhot -qstrict -qarch=pwr3 -qtune=pwr3 -qcache=auto $compile_common"
link="-O3 -qstrict -qarch=pwr3 -q32 -bmaxstack:2000000000 -bmaxdata:2000000000 -qtune=pwr3 -qcache=auto "

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags="-qipa=inline=auto -Q $inline_files"
preinline_flags=" "

MODULE_CODE=1
;;

IRIX64)
mach_file="IRIXF90.F"

FORTRAN_CMD=f90
LINK_CMD=f90
libs_d="-lblas -lmpi"
libs="-lblas -lmpi"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_common="-c -I. -I$mpi_include -64 -freeform "
compile_d="$compile_common -C -trapuv -g "
compile_d2="$compile_common -C -trapuv -g "
compile_d3="$compile_common -C -trapuv -g "
link_d="-IPA -64 -C -g"

compile="$compile_common -O3 -mips4 "
compile2="-c -I. -I$mpi_include -64 -O3 -mips4"
compile3="$compile_common -O3 -mips4 "
link="-IPA -64 -O3 -mips4"
MODULE_CODE=0
# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
# inline_flags=" -INLINE:must=compare_:file=compare.o -INLINE:must=eosg_:file=eosg.o -INLINE:must=phi_c_of_:file=discretize.o"
inline_flags=" -IPA -INLINE:must=compare_,eosg_,phi_c_of_,xsi_:file=compare.o,eosg.o,discretize.o "
preinline_flags=" -IPA "

;;

ULTRIX)
mach_file="ULTRIX.F"

FORTRAN_CMD=f90
LINK_CMD=f90
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f90
omp="?"
compile_d="-c -I. -I$mpi_include -g -nowarn -freeform -convert big_endian"
compile_d2="-c -I. -I$mpi_include -g -nowarn -freeform -convert big_endian"
compile_d3="-c -I. -I$mpi_include -g -nowarn -freeform -convert big_endian"
link_d="-g -nowarn -convert big_endian"
compile="-c -I. -I$mpi_include -nowarn -O2 -freeform -convert big_endian"
compile2="-c -I. -I$mpi_include -nowarn -O2 -convert big_endian"
compile3="-c -I. -I$mpi_include -nowarn -O2 -freeform -convert big_endian"
link="-O2 -nowarn -convert big_endian"
MODULE_CODE=0

;;

Linux_pgi)
mach_file="LINUX.F"

FORTRAN_CMD=pgf90
LINK_CMD=pgf90
libs_d="-lblas odepack.a blas90.a dgtsv90.a"
libs="-lblas odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_common="-c -I. -Mnosave -Mfreeform -Mrecursive -Mreentrant -byteswapio"
compile_d=" -g -Mbounds -Mchkptr -Mchkfpstk -Mchkstk $compile_common"
compile_d2=" -g -Mbounds -Mchkptr -Mchkfpstk -Mchkstk $compile_common"
compile_d3=" -g -Mbounds -Mchkptr -Mchkfpstk -Mchkstk $compile_common"
link_d=" "
compile=" -O -Mdalign $compile_common"
compile2="-O1 -Mdalign -c -I. -Mnosave -Mrecursive -Mreentrant -byteswapio"
compile3=" -O -Mdalign $compile_common"
link=" "
MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags=" "
# inline_flags=" -Minline=size:10 -Minfo=inline $inline_files"
preinline_flags=" "

;;

Linux_64_intel)
#-----------
# Set the supported compiler version under 64 bit platforms
#-----------
# Intel version 9.X
# opsys_intel="Linux_64_ifc9"
# Intel version 10.X
opsys_intel="Linux_64_ifc10"

#-----------
# Set MPI library used as Intel's MPI library uses mpiifort instead of mpif90
#-----------
if [ "$INTEL_MPI" ]
then
# Intel's MPI library (commercial version)
mpi_type=mpi_intel
else
# Generic MPICH library
mpi_type=mpich
fi
#-----------
# Check if the Intel Linux compiler specific machine.f exists
#-----------
if test -f "$mfix/LINUX_intel.F"
then
mach_file="LINUX_intel.F"
else
echo LINUX_intel.F "not found in $mfix"
exit
fi

#-----------
# Decide to use mpif90 or ifort as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
case $mpi_type in
mpich )
FORTRAN_CMD=mpif90
LINK_CMD=mpif90
if [ "$ACML" ]
then
libs_d="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
libs="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
libs="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
fi
;;
mpi_intel )
FORTRAN_CMD=mpiifort
LINK_CMD=mpiifort
#DEBUG
# unsetenv MKLROOT
# echo $MKLROOT
if [ "$MKLROOT" ]
then
libs_d="odepack.a -L $MPICH_DIR/lib64 -lmpi -L $MKLROOT/lib/em64t -lmkl_lapack -lmkl_em64t -lmkl_core -lvml -lguide"
libs="odepack.a -L $MPICH_DIR/lib64 -lmpi -L $MKLROOT/lib/em64t -lmkl_lapack -lmkl_em64t -lmkl_core -lvml -lguide"
else
libs_d="odepack.a -L $MPICH_DIR/lib64 -lmpi blas90.a dgtsv90.a "
libs="odepack.a -L $MPICH_DIR/lib64 -lmpi blas90.a dgtsv90.a "

fi
;;
* )
FORTRAN_CMD=mpif90
LINK_CMD=mpif90
if [ "$ACML" ]
then
libs_d="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
libs="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
libs="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
fi

;;
esac

# Temporarily disable MPIHOME env variable check
#if [ "$MPIHOME" ]
#then
# echo " "
#else
# echo "______ Environment variable ERROR _______"
# echo "Environment variable for MPI home directory is not defined !"
# echo " "
# echo "Please define the following in your shell and rerun make_mfix"
# echo " setenv MPIHOME your_path_of_MPI_root_directory"
# echo " e.g. setenv MPIHOME /opt/MPI/mpich2_intel_opt"
# exit
#fi
;;
*)
FORTRAN_CMD=ifort
LINK_CMD=ifort
if [ "$ACML" ]
then
libs_d="odepack.a -L $ACML/ifort64/lib -lacml -lacml_mv"
libs="odepack.a -L $ACML/ifort64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"
fi
if [ "$MKLROOT" ]
then
libs_d="odepack.a -L $MKLROOT/lib/em64t -lmkl_lapack -lmkl_em64t -lmkl_core -lvml -lguide -lpthread"
libs="odepack.a -L $MKLROOT/lib/em64t -lmkl_lapack -lmkl_em64t -lmkl_core -lvml -lguide -lpthread"
else
libs_d="odepack.a blas90.a dgtsv90.a "
libs="odepack.a blas90.a dgtsv90.a "
fi
;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
OBJ_EXT=o
FORTRAN_EXT=f
omp="-openmp -assume cc_omp"
#============================
# Set the common compiler flags that are common for all three sets
#============================
case $opsys_intel in
Linux_64_ifc9 )
compile_common="-c -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl"
compile_common_d="-convert big_endian -assume byterecl -O0 -fpe0 -d1 -CB -traceback"
;;
Linux_64_ifc10 )
compile_common="-c -I. -w -w95 -i_dynamic -convert big_endian -assume byterecl"
compile_common_d="-convert big_endian -assume byterecl -O0 -fpe0 -CB -traceback"
;;
* )
compile_common="-c -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl"
compile_common_d="-convert big_endian -assume byterecl -O0 -fpe0 -d1 -CB -traceback"
;;
esac

case $opsys_intel in
Linux_64_ifc9 )
optimize_common="-O3 -axKW -tpp7"
;;
Linux_64_ifc10 )
#optimize_common="-fast"
optimize_common="-O3 -axW -ip -fp-model precise -ftz"
;;
* )
optimize_common="-O3 -axKW -tpp7"
;;
esac

#============================
# Set ALL debug compile flags
#============================
compile_d="-g -c -I. -FR $compile_common_d"
compile_d2="-g -c -I. -FR $compile_common_d"
compile_d3="-g -c -I. $compile_common_d"
link_d="-I. "
#============================
# Set ALL optimized compile flags
#============================
case $opsys_intel in
Linux_64_ifc9 )
compile="$compile_common -FR $optimize_common"
compile2="$compile_common -FR $optimize_common"
compile3="$compile_common $optimize_common"
link="-I. "
;;
Linux_64_ifc10 )
compile="$compile_common -FR $optimize_common"
compile2="$compile_common -FR -O0 -axW -ip -fp-model precise -ftz"
compile3="$compile_common $optimize_common"
link="-I. "
;;
* )
compile="$compile_common -FR $optimize_common"
compile2="$compile_common -FR $optimize_common"
compile3="$compile_common $optimize_common"
link="-I. "
;;
esac

# compile_common="-c -O3 -axP -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl -FR"
# compile_d="-g -c -convert big_endian -assume byterecl -I. -FR -O0 -fpe0 -d1 -CB -traceback"
# compile_d2="-g -c -convert big_endian -assume byterecl -I. -O0 -fpe0 -d1 -CB -traceback"
# compile_d3="-g -c -convert big_endian -assume byterecl -I. -O0 -fpe0 -d1 -CB -traceback"
# link_d="-I. "
# compile="$compile_common"
# #compile2="-c -O3 -axP -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl"
# compile2="-c -O0 -axP -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl"
# compile3="-c -O3 -axP -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl"
# link="-I. "

MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags=" "
preinline_flags=" "
;;

Linux_64_intel_amd64)
mach_file="LINUX.F"

if [ "$ACML" ]
then
echo " "
echo "-------------- W A R N I N G ! ----------"
echo " You may need to update the paths under libs_d and libs "
echo " variables in make_mfix; search for Linux_64_intel) text block"
echo " with the corresponding paths on your local system if"
echo " if you encounter problems during the link phase"
echo "-------------- W A R N I N G ! ----------"
echo " "
fi
#-----------
# Decide to use mpif90 or ifort as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
FORTRAN_CMD=mpif90
LINK_CMD=mpif90

#if [ "$MPIHOME" ]
#then
# echo " "
#else
# echo "______ Environment variable ERROR _______"
# echo "Environment variable for MPI home directory is not defined !"
# echo " "
# echo "Please define the following in your shell and rerun make_mfix"
# echo " setenv MPIHOME your_path_of_MPI_root_directory"
# echo " e.g. setenv MPIHOME /opt/MPI/mpich2_intel_opt"
# exit
#fi
if [ "$ACML" ]
then
libs_d="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
libs="odepack.a -L $MPIHOME/lib -lmpich -L $MPIHOME/include -L $ACML/ifort64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
libs="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
fi

;;
*)
FORTRAN_CMD=ifort
LINK_CMD=ifort
if [ "$ACML" ]
then
libs_d="odepack.a -L $ACML/ifort64/lib -lacml -lacml_mv"
libs="odepack.a -L $ACML/ifort64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"
fi
;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
OBJ_EXT=o
FORTRAN_EXT=f
omp="-openmp -assume cc_omp"
compile_common="-I. -w -w95 -convert big_endian -assume byterecl -FR"
# optimize_common="-O3 -xW -ipo -no-prec-div -static -V"
optimize_common="-O3 -xW"

compile_d="-g -c -convert big_endian -assume byterecl -I. -FR -O0 -fpe0 -d1 -CB "
compile_d2="-g -c -convert big_endian -assume byterecl -I. -O0 -fpe0 -d1 -CB "
compile_d3="-g -c -convert big_endian -assume byterecl -I. -O0 -fpe0 -d1 -CB "
link_d="-I. "

compile="-c $optimize_common $compile_common"
compile2="-c $optimize_common $compile_common"
compile3="-c $optimize_common -I. -w -w95 -i_dynamic -convert big_endian -assume byterecl"
link="-I. "

MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags=" "
preinline_flags=" "
;;

Linux_64_pgi)
mach_file="LINUX.F"

#-----------
# Decide to use mpif90 or pgf90 as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
FORTRAN_CMD=mpif90
LINK_CMD=mpif90
;;
*)
FORTRAN_CMD=pgf90
LINK_CMD=pgf90
;;
esac
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_common="-c -I. -Mnosave -Mfreeform -Mrecursive -Mreentrant -byteswapio"
compile_d=" -g -Mbounds -Mchkptr -Mchkfpstk -Mchkstk $compile_common" link_d=" "
compile=" -O -Mdalign $compile_common"
compile2="-O1 -Mdalign $compile_common"
link=" "
MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags=" "
# inline_flags=" -Minline=size:10 -Minfo=inline $inline_files"
preinline_flags=" "
;;
#===========
# pgf90 compiler on AMD64
#===========
Linux_64_pgi_amd64)
mach_file="LINUX.F"
proc_type="amd64"

#-----------
# Decide to use mpif90 or pgf90 as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
FORTRAN_CMD=mpif90
LINK_CMD=mpif90
if [ "$ACML" ]
then
libs_d="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/pgi64/lib -lacml -lacml_mv"
libs="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/pgi64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
libs="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
fi

;;
*)
FORTRAN_CMD=pgf90
LINK_CMD=pgf90
if [ "$ACML" ]
then
libs_d="odepack.a -L $ACML/pgi64/lib -lacml -lacml_mv"
libs="odepack.a -L $ACML/pgi64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"
fi

;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
optimize_common="-Minfo=inline,loop -tp $proc_type -fastsse -Mipa=fast -Mipa=inline -Bstatic"
compile_common="-c -I. -Mnosave -Mfreeform -byteswapio -Mkeepasm"
compile="$optimize_common -Mdalign $compile_common"
compile2="-O1 -Mdalign $compile_common"
compile3="-c -I. $optimize_common -Mdalign -Mnosave -byteswapio"
link="-Mipa=fast -Mipa=inline"

compile_common_d="-c -I. -Mnosave -byteswapio"
debug_common="-g -Mbounds -Mchkptr -Mchkfpstk -Mchkstk -Ktrap=fp"
compile_d=" $debug_common -Mfreeform $compile_common_d"
compile_d2=" $debug_common -Mfreeform $compile_common_d"
compile_d3=" $debug_common $compile_common_d"
link_d=" "

MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o equal.o eosg.o discretize.o "
inline_files="compare.f equal.f eosg.f discretize.f "
# inline_flags=" "
inline_flags=" -Minline=size:10 -Minfo=inline $inline_files"
preinline_flags=" "
;;

#XT_PSC
#######
#INFO_2 Begin Cray XT3 @ PSC related compiler and compilation flag settings
#######
Linux_64_pgi_xt_psc)
mach_file="LINUX.F"
proc_type="amd64e"

#-----------
# Decide to use mpif90 or pgf90 as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
FORTRAN_CMD=ftn
LINK_CMD=ftn
;;
*)
#
#INFO_2.1 Change compiler for serial run by editing FORTRAN_CMD and LINK_CMD
#
FORTRAN_CMD=/opt/xt-pe/1.4.37/bin/snos64/qk-pgf90
LINK_CMD=/opt/xt-pe/1.4.37/bin/snos64/qk-pgf90
;;
esac
if [ "$ACML" ]
then
echo " "
echo "-------------- W A R N I N G ! ----------"
echo " You may need to update the paths under libs_d and libs "
echo " variables in make_mfix; search for Linux_64_pgi_amd64) text block"
echo " with the corresponding paths on your local system if"
echo " if you encounter problems during the link phase"
echo "-------------- W A R N I N G ! ----------"
echo " "
fi
case $dmp_version in
y|Y )
libs_d="odepack.a -L$ACML_DIR/lib -lacml -lacml_mv"
libs="odepack.a -L$ACML_DIR/lib -lacml -lacml_mv"
;;
*)
libs_d="odepack.a -L$ACML_DIR/lib -lacml -lacml_mv"
libs="odepack.a -L$ACML_DIR/lib -lacml -lacml_mv"
;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
#
optimize_common="-Minfo=inline,loop -tp $proc_type -fastsse -Mipa=fast -Mipa=inline -Bstatic"
compile_common="-c -I. -Mdalign -Mnosave -byteswapio"
# Activate for compiler based profiling
#profile_common="-Mprof=func"
profile_common=" "

compile="$optimize_common $compile_common -Mfreeform $profile_common"
compile2="-O1 -Mdalign $compile_common -Mfreeform $profile_common"
compile3="-c -I. $optimize_common $compile_common $profile_common"
link="-Mipa=fast -Mipa=inline $profile_common"

MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o equal.o eosg.o discretize.o "
inline_files="compare.f equal.f eosg.f discretize.f "
inline_flags=" -Minline=size:10 -Minfo=inline $inline_files"
preinline_flags=" "
;;

#XT_NCCS
#######
#INFO_3 Begin Cray XT4 @ NCCS related compiler and compilation flag settings
#######
Linux_64_pgi_xt_nccs)
mach_file="LINUX.F"
proc_type="amd64e"
proc_type="k8-64"

#-----------
# Decide to use mpif90 or pgf90 as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
#FORTRAN_CMD=mpif90
#LINK_CMD=mpif90
FORTRAN_CMD=ftn
LINK_CMD=ftn
if [ "$ACML_DIR" ]
then
libs_d="odepack.a -L $ACML_DIR/pgi6/lib -lacml -lacml_mv"
libs="odepack.a -lpapi -lm -L $ACML_DIR/pgi64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a -lhwpc -lpapi -lm"
libs="odepack.a blas90.a dgtsv90.a -lhwpc -lpapi -lm"
fi

;;
*)
#

The second part in the next post.

Second part of file make_mfix:

#INFO_3.1 Change compiler for serial run by editing FORTRAN_CMD and LINK_CMD
#
FORTRAN_CMD=/opt/xt-pe/1.5.31/bin/snos64/qk-pgf90
LINK_CMD=/opt/xt-pe/1.5.31/bin/snos64/qk-pgf90
if [ "$ACML_DIR" ]
then
libs_d="odepack.a -L $ACML_DIR/pgi64/lib -lacml -lacml_mv"
libs="odepack.a -lhwpc -lpapi -L $ACML_DIR/pgi64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"
fi

;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"

# optimize_common="-Minfo=inline,loop -tp $proc_type -fastsse -Mipa=fast -Mipa=inline -Mdalign -Bstatic"
optimize_common="-Minfo=inline,loop -tp $proc_type -fastsse -Mipa=fast -Mipa=inline -Mdalign"
# Activate for compiler based profiling
# profile_common="-Mprof=func"
profile_common=" "
compile_common="-c -I. -I/opt/xt-tools/craypat/3.1.2/cpatx/include -Mnosave -byteswapio "

compile="$optimize_common $profile_common -Mfreeform $compile_common"
compile2="$optimize_common $profile_common -Mfreeform $compile_common"
compile3="$optimize_common $profile_common $compile_common"
link="-Mipa=fast -Mipa=inline $profile_common"

compile_common_d="-c -I. -Mnosave -byteswapio -target=catamount"
debug_common="-g -Mbounds -Mchkptr -Mchkfpstk -Mchkstk"
compile_d=" $debug_common -Mfreeform $compile_common_d"
compile_d2=" $debug_common -Mfreeform $compile_common_d"
compile_d3=" $debug_common $compile_common_d"
link_d=" "

MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o equal.o eosg.o discretize.o "
inline_files="compare.f equal.f eosg.f discretize.f "
inline_flags=" -Minline=size:10 -Minfo=inline $inline_files"
preinline_flags=" "
;;

Linux_64_pscale)
mach_file="LINUX.F"
#-----------
# Decide to use mpif90 or pathf90 as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
FORTRAN_CMD=mpif90
LINK_CMD=mpif90
;;
*)
FORTRAN_CMD=$PSCALE/bin/pathf90
LINK_CMD=$PSCALE/bin/pathf90
;;
esac
if [ "$ACML" ]
then
echo " "
echo "-------------- W A R N I N G ! ----------"
echo " You may need to update the paths under libs_d and libs "
echo " variables in make_mfix; search for Linux_64_pscale) text block"
echo " with the corresponding paths on your local system if"
echo " if you encounter problems during the link phase"
echo "-------------- W A R N I N G ! ----------"
echo " "
fi

libs_d="-lfrtbegin -lg2c odepack.a -L $ACML/pathscale64/lib -lacml -lacml_mv"
libs="-lfrtbegin -lg2c -L $MPIHOME/lib -lmpich odepack.a -L $ACML/pathscale64/lib -lacml -lacml_mv"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_common_dbg="-c -I. -fno-math-errno -static-data -Wno-globals"
compile_common="-c -I. -O3 -OPT:Ofast -fno-math-errno -static-data -msse2 -Wno-globals -fno-second-underscore"

compile_d=" -g $compile_common_dbg -freeform"
compile_d2=" -g $compile_common_dbg -freeform"
compile_d3=" -g $compile_common_dbg"
link_d=" "

compile="$compile_common -freeform"
compile2="$compile_common -freeform"
compile3="$compile_common"
link=" "

MODULE_CODE=0

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags=" "
preinline_flags=" "

;;

Linux_64_pscale_xt_nccs)
mach_file="LINUX.F"
#-----------
# Decide to use mpif90 or pathf90 as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
FORTRAN_CMD=ftn
LINK_CMD=ftn
;;
*)
FORTRAN_CMD=$PSCALE/bin/pathf90
LINK_CMD=$PSCALE/bin/pathf90
;;
esac
if [ "$ACML" ]
then
echo " "
echo "-------------- W A R N I N G ! ----------"
echo " You may need to update the paths under libs_d and libs "
echo " variables in make_mfix; search for Linux_64_pscale) text block"
echo " with the corresponding paths on your local system if"
echo " if you encounter problems during the link phase"
echo "-------------- W A R N I N G ! ----------"
echo " "
fi

case $dmp_version in
y|Y )
libs_d="-lfrtbegin -lg2c odepack.a -lhwpc -lpapi -L $ACML/pathscale64/lib -lacml -lacml_mv"
libs="-lfrtbegin -lg2c odepack.a -lhwpc -lpapi -L $ACML/pathscale64/lib -lacml -lacml_mv"
;;
*)
libs_d="-lfrtbegin -lg2c odepack.a $ACML"
libs="-lfrtbegin -lg2c odepack.a $ACML"
;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_common_dbg="-c -I. -fno-math-errno -static-data -fno-second-underscore -byteswapio -trapuv"
# xt3 : -O3 -LNO:prefetch=2 -LNO:prefetch_ahead=9 -LNO:fusion=2 -CG:use_prefetchnta=on
compile_common="-c -I. -I /opt/xt-tools/craypat/3.1.2/cpatx/include -march=opteron -O3 -OPT:Ofast -ffast-math -funroll-loops -fno-math-errno -static-data -fno-second-underscore -byteswapio"
#compile_common="-c -I. -I /opt/xt-tools/craypat/3.1.2/cpatx/include -OPT:Ofast -fno-math-errno -msse2 -fno-second-underscore -byteswapio"

compile_d=" -g $compile_common_dbg -freeform"
compile_d2=" -g $compile_common_dbg -freeform"
compile_d3=" -g $compile_common_dbg"
link_d=" "

compile="$compile_common -freeform"
compile2="$compile_common -freeform"
compile3="$compile_common"
link=" "

MODULE_CODE=0

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags=" "
preinline_flags=" "

;;

Linux_64_pscale_xt_nersc)
mach_file="LINUX.F"
#-----------
# Decide to use mpif90 or pathf90 as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
FORTRAN_CMD=ftn
LINK_CMD=ftn
;;
*)
FORTRAN_CMD=ftn
LINK_CMD=ftn
;;
esac
if [ "$ACML_DIR" ]
then
echo " "
echo "-------------- W A R N I N G ! ----------"
echo " You may need to update the paths under libs_d and libs "
echo " variables in make_mfix; search for Linux_64_pscale) text block"
echo " with the corresponding paths on your local system if"
echo " if you encounter problems during the link phase"
echo "-------------- W A R N I N G ! ----------"
echo " "
fi
case $dmp_version in
y|Y )
libs_d="-lfrtbegin -lg2c odepack.a -lhwpc -lpapi -L $ACML_DIR/pathscale64/lib -lacml -lacml_mv"
libs="-lfrtbegin -lg2c odepack.a -lhwpc -lpapi -L $ACML_DIR/pathscale64/lib -lacml -l acml_mv"
;;
*)
libs_d="-lfrtbegin -lg2c odepack.a $ACML_DIR/pathscale64/lib -lacml -lacml_mv"
libs="-lfrtbegin -lg2c odepack.a $ACML_DIR/pathscale64/lib -lacml -lacml_mv"
;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_common_dbg="-c -I. -fno-math-errno -static-data -fno-second-underscore -byteswapio -trapuv"
# xt3 : -O3 -LNO:prefetch=2 -LNO:prefetch_ahead=9 -LNO:fusion=2 -CG:use_prefetchnta=on
compile_common="-c -I. -I $PAT_ROOT/include -march=opteron -O3 -OPT:Ofast -ffast-math -funroll-loops -fno-math-errno -static-data -fno-second-underscore -byteswapio"
#compile_common="-c -I. -I /opt/xt-tools/craypat/3.1.2/cpatx/include -OPT:Ofast -fno-math-errno -msse2 -fno-second-underscore -byteswapio"

compile_d=" -g $compile_common_dbg -freeform"
compile_d2=" -g $compile_common_dbg -freeform"
compile_d3=" -g $compile_common_dbg"
link_d=" "

compile="$compile_common -freeform"
compile2="$compile_common -freeform"
compile3="$compile_common"
link=" "
MODULE_CODE=0

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags=" "
preinline_flags=" "

;;

Linux_64_xlf_anl)
mach_file="AIX.F"

case $dmp_version in
y|Y )
FORTRAN_CMD=/bgsys/drivers/ppcfloor/comm/bin/mpixlf90_r
F77_CMD=/bgsys/drivers/ppcfloor/comm/bin/mpixlf77_r
LINK_CMD=/bgsys/drivers/ppcfloor/comm/bin/mpixlf90_r
;;
*)
#FORTRAN_CMD=xlf90_r
#F77_CMD=xlf_r
#LINK_CMD=xlf90_r
# compute node
FORTRAN_CMD=
F77_CMD=
LINK_CMD=xlf90_r

;;
esac

#libs_d="-lblas "
#libs_d="-lblas440 -llapack440"
#libs_d="blas90.a odepack.a dgtsv90.a"
libs_d="blas90.a odepack.a dgtsv90.a -L/bgsys/ibm_essl/sles10/prod/opt/ibmmath/essl/4.3/lib -lesslbg"
libs="-lblas -lesslp2_r"

OBJ_EXT=o
FORTRAN_EXT=f

# =============================
# use mpxlf90_r or xlf90_r
# for thread safe code
# =============================
omp="-qsmp=omp -qsmp=noauto -qnosave "

# =================================
# the module directory cannot be on
# a GPFS parallel file system
# =================================

moddir=/tmp/$USER
if test -d $moddir
then
touch $moddir
else
mkdir $moddir
fi
compile_common="-c -q32 -bmaxstack:2000000000 -bmaxdata:2000000000 -c -I. -freeform -I$moddir -qmoddir=$moddir "
# AIX Settings
# compile_d="-C -g -qinitauto=FF -qflttrap -freeform $compile_common"
# compile_d2="-C -g -qinitauto=FF -qflttrap -freeform $compile_common"
# compile_d3="-C -g -qinitauto=FF -qflttrap -freeform $compile_common"
# link_d="$compile_d"

compile_common="-c -I. -qlanglvl=90std"
compile_d="-C -g -qinitauto=FF -freeform $compile_common"
compile_d2="-C -g -qinitauto=FF -freeform $compile_common"
compile_d3="-C -g -qinitauto=FF $compile_common"
link_d=""

compile_opt="-O2 -qarch=450 -qtune=450"
compile=" -qhot -qstrict -qarch=pwr3 -qtune=pwr3 -qcache=auto $compile_common"
compile2="-c -q32 -bmaxstack:2000000000 -bmaxdata:2000000000 -c -I. -I$moddir -qmoddir=$moddir -O3 -qhot -qstrict -qarch=pwr3 -qtune=pwr3 -qcache=auto $compile_common"
compile3=" -O3 -qhot -qstrict -qarch=pwr3 -qtune=pwr3 -qcache=auto $compile_common"
link="-O3 -qstrict -qarch=pwr3 -q32 -bmaxstack:2000000000 -bmaxdata:2000000000 -qtune=pwr3 -
qcache=auto "

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
inline_files="compare.f eosg.f discretize.f "
inline_flags="-qipa=inline=auto -Q $inline_files"
preinline_flags=" "

MODULE_CODE=1
;;

Linux_64_gfort )

FORTRAN_CMD=gfortran
LINK_CMD=gfortran
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_d="-c -g"
link_d="-g"
compile="-c -I. -fconvert='big-endian' -ffree-form -I$mpi_include -O3 "
compile2="-c -I. -fconvert='big-endian' -ffree-form -I$mpi_include -O1 "
compile3="-c -I. -fconvert='big-endian' -I$mpi_include -O1 "
link=" "
MODULE_CODE=1

;;

Linux_ifc9 | Linux_ifc10 )
#-----------
# Set MPI library used as Intel's MPI library uses mpiifort instead of mpif90
#-----------
# Generic MPICH library
# mpi_type=mpich
# Intel's MPI library (commercial version)
mpi_type=mpi_intel

#-----------
# Check if the Intel Linux compiler specific machine.f exists
#-----------
if test -f "$mfix/LINUX_intel.F"
then
mach_file="LINUX_intel.F"
else
echo LINUX_intel.F "not found in $mfix"
exit
fi

#-----------
# Decide to use mpif90 or ifc as the compiler & linker command
#-----------
case $dmp_version in
y|Y )
case $mpi_type in
mpich )
FORTRAN_CMD=mpif90
LINK_CMD="mpif90 -lsvml"
if [ "$ACML" ]
then
libs_d="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
libs="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
libs="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
fi
;;
mpi_intel )
FORTRAN_CMD=mpiifort
LINK_CMD="mpiifort -lsvml"
if [ "$MKLROOT" ]
then
libs_d="odepack.a -L $MPICH_DIR/lib -lmpi -L $MKLROOT/lib/32 -lmkl_solver -lmkl_lapack -lvml -lguide"
libs="odepack.a -L $MPICH_DIR/lib -lmpi -L $MKLROOT/lib/32 -lmkl_solver -lmkl_lapack -lvml -lguide"
else
libs_d="odepack.a -L $MPICH_DIR/lib -lmpi blas90.a dgtsv90.a "
libs="odepack.a -L $MPICH_DIR/lib -lmpi blas90.a dgtsv90.a "
fi
;;
* )
FORTRAN_CMD=mpif90
LINK_CMD="mpif90 -lsvml"
if [ "$ACML" ]
then
libs_d="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
libs="odepack.a -L $MPIHOME/lib -lmpich -L $ACML/ifort64/lib -lacml -lacml_mv"
else
libs_d="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
libs="odepack.a blas90.a dgtsv90.a -L $MPIHOME/lib -lmpich"
fi
;;
esac
;;
*)
case $opsys in
Linux_ifc9 )
FORTRAN_CMD=ifort
LINK_CMD="ifort -lsvml"
;;
Linux_ifc10 )
FORTRAN_CMD=ifort
LINK_CMD="ifort -lsvml"
;;
* )
FORTRAN_CMD=ifort
LINK_CMD="ifort -lsvml"
;;
esac
;;
esac

OBJ_EXT=o
FORTRAN_EXT=f
omp="-openmp -assume cc_omp"

libs_d='odepack.a blas90.a dgtsv90.a'
libs='odepack.a blas90.a dgtsv90.a'

#============================
# Check the big endian environment variable
#============================
if [ "$F_UFMTENDIAN" ]
then
#echo "Environment variable, F_UFMTENDIAN is found"

if ( expr "$F_UFMTENDIAN" = "big" )
then
echo "*********************************************"
echo "Big Endian environment set for Intel compiler"
echo "*********************************************"
else
echo "F_UFMTENDIAN environment variable IS NOT set to big endian!"
echo "Check the current value of F_UFMTENDIAN variable by:"
echo "echo \$F_UFMTENDIAN"
echo "then issue the following Cshell command at the prompt and "
echo "recompile:"
echo "setenv F_UFMTENDIAN big for csh/tcsh"
echo "export F_UFMTENDIAN=big for ksh/bash"
echo " "
echo "Aborting compilation"
exit
fi

else # if [ "$F_UFMTENDIAN" ] branch

echo "Environment variable for big endian IS NOT set!"
echo "Issue the following Cshell command at the prompt and "
echo "then recompile:"
echo "setenv F_UFMTENDIAN big for csh/tcsh"
echo "export F_UFMTENDIAN=big for ksh/bash"
echo " "
echo "Aborting compilation"
exit

fi # eof if [ "$F_UFMTENDIAN" ] branch

#============================
# Set the common compiler flags that are common for all three sets
#============================
case $opsys in
Linux_ifc9 )
compile_common="-c -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl"
compile_common_d="-convert big_endian -assume byterecl -O0 -fpe0 -d1 -CB -traceback"
;;
Linux_ifc10 )
compile_common="-c -I. -w -w95 -i_dynamic -convert big_endian -assume byterecl"
compile_common_d="-convert big_endian -assume byterecl -O0 -fpe0 -CB -traceback"
;;
* )
compile_common="-c -I. -w -w95 -i_dynamic -ip -convert big_endian -assume byterecl"
compile_common_d="-convert big_endian -assume byterecl -O0 -fpe0 -d1 -CB -traceback"
;;
esac

#============================
# Set the optimization compiler flags
#============================
# Old Pentium 3 processors are sensitive optimization flags so set a reduced set of flags
# that produce generic instruction set for all Pentium platforms
if [ $P4_OPTIMIZE -eq 0 ]
then
case $opsys in
Linux_ifc9 )
optimize_common="-O3"
;;
Linux_ifc10 )
optimize_common="-O3"
;;
* )
optimize_common="-O3"
;;
esac
else
case $opsys in
Linux_ifc9 )
optimize_common="-O3 -axKW -tpp7"
;;
Linux_ifc10 )
#optimize_common="-fast"
optimize_common="-O3 -axW -ip -fp-model precise -ftz"
;;
* )
optimize_common="-O3 -axKW -tpp7"
;;
esac
fi
#============================
# Set ALL debug compile flags
#============================
compile_d="-g -c -I. -FR $compile_common_d"
compile_d2="-g -c -I. -FR $compile_common_d"
compile_d3="-g -c -I. $compile_common_d"
link_d="-I. "
#============================
# Set ALL optimized compile flags
#============================
case $opsys in
Linux_ifc9 )
compile="$compile_common -FR $optimize_common"
compile2="$compile_common -FR $optimize_common"
compile3="$compile_common $optimize_common"
link="-I. "
;;
Linux_ifc10 )
compile="$compile_common -FR $optimize_common"
compile2="$compile_common -FR -O0 -axW -ip -fp-model precise -ftz"
compile3="$compile_common $optimize_common"
link="-I. "
;;
* )
compile="$compile_common -FR $optimize_common"
compile2="$compile_common -FR $optimize_common"
compile3="$compile_common $optimize_common"
link="-I. "
;;
esac

MODULE_CODE=1

# ------------------
# flags for inlining
# ------------------
inline_objs="compare.o eosg.o discretize.o "
# inline_objs=" "

inline_files="compare.f eosg.f discretize.f "
# inline_files=" "

inline_flags=" "
# inline_flags=" -Minline=size:10 -Minfo=inline $inline_files"
preinline_flags=" "
;;

CYGWIN32_NT)
mach_file="PGNT.F"

FORTRAN_CMD=pgf90
LINK_CMD=pgf90
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_d="-c -g -byteswapio -Mfreeform -Mnosave -Mrecursive -Mreentrant"
link_d="-g"
compile="-c -I. -I. -byteswapio -Mfreeform -Mnosave -Mrecursive -Mreentrant"
compile2="-c -I. -I. -byteswapio -Mnosave -Mrecursive -Mreentrant"
compile3="-c -I. -I. -byteswapio -Mnosave -Mrecursive -Mreentrant"
link=" "
MODULE_CODE=1

;;

CYGWIN_NT-4.0)
mach_file="PGNT.F"

FORTRAN_CMD=pgf90
LINK_CMD=pgf90
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_d="-c -g -byteswapio -Mfreeform -Mnosave -Mrecursive -Mreentrant"
link_d="-g"
compile="-c -I. -I$mpi_include -O -byteswapio -Mfreeform -Mnosave -Mrecursive -Mreentrant"
compile2="-c -I. -I$mpi_include -O1 -byteswapio -Mnosave -Mrecursive -Mreentrant"
compile3="-c -I. -I$mpi_include -O1 -byteswapio -Mnosave -Mrecursive -Mreentrant"
link=" "
MODULE_CODE=1

;;

CYGWIN_NT-6.0-g95)
mach_file="CYGNT.F"

FORTRAN_CMD=g95
LINK_CMD=g95
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_d="-c -g"
link_d="-g"
compile="-c -I. -fendian=big -ffree-form -I$mpi_include -O "
compile2="-c -I. -fendian=big -ffree-form -I$mpi_include -O1 "
compile3="-c -I. -fendian=big -I$mpi_include -O1 "
link=" "
MODULE_CODE=1

;;

CYGWIN_NT-6.0-gfortran)
mach_file="CYGNT.F"

FORTRAN_CMD=gfortran-4
LINK_CMD=gfortran-4
libs_d="odepack.a blas90.a dgtsv90.a"
libs="odepack.a blas90.a dgtsv90.a"

OBJ_EXT=o
FORTRAN_EXT=f
omp="-mp"
compile_d="-c -g"
link_d="-g"
compile="-c -I. -fconvert='big-endian' -ffree-form -I$mpi_include -O3 "
compile2="-c -I. -fconvert='big-endian' -ffree-form -I$mpi_include -O1 "
compile3="-c -I. -fconvert='big-endian' -I$mpi_include -O1 "
link=" "
MODULE_CODE=1

;;

*) echo "Sorry, no support for operating system: $opsys"
echo
echo "modify make_mfix to add support"
echo
exit ;;
esac
#
#------------------------------------------------------------------------
#
echo
echo "Compiling with machine-dependent file $mach_file"
echo

# prepare for SMP version
smp_check="COMPILED_SMP"
case $smp_version in
y|Y )
if test -f $smp_check
then
echo
else
/bin/rm -f *.o *.a *.mod *.exe
touch $smp_check
fi
;;
*)
if test -f $smp_check
then
/bin/rm -f *.o *.a *.mod *.exe
/bin/rm -f $smp_check
else
echo
fi
;;
esac

# prepare for DMP version
dmp_check="COMPILED_DMP"
case $dmp_version in
y|Y )
if test -f $dmp_check
then
echo
else
/bin/rm -f *.o *.a *.mod *.exe
touch $dmp_check
fi
;;
*)
if test -f $dmp_check
then
/bin/rm -f *.o *.a *.mod *.exe
/bin/rm -f $dmp_check
else
echo
fi
;;
esac

#Prepare for the current machine
mach_check="COMPILED.WITH.$mach_file"
if test -f $mach_check
then
echo
else
chmod +w machine.f
/bin/cp -f $mach_file machine.f
/bin/rm -f *.o *.a *.mod *.exe
/bin/rm -f COMPILED.WITH.*
touch $mach_check
fi

# create default *.f and *.inc files in model directory, if they do not exist
cd $run_dir
echo
echo "Ignore messages such as "Cannot access *.f or *.inc""
for i in `ls *.f`
do

# Is there a similar file in Mfix/model directory?
if test -r $mfix/$i
then
outfile=`echo $i | sed 's/\./\.0/'`
# Is there default file Mfix/model directory?
if test -r $mfix/$outfile
then
case $auto_compile in
y|Y)
chmod u+w $outfile
/bin/cp -f $run_dir/$outfile $outfile
;;
*)
do_nothing="ok"
;;
esac

else
# Mfix/model directory does not have a default file. create one.
/bin/cp -f $mfix/$i $mfix/$outfile
fi
fi
done

for i in `ls *.inc`
do

# Is there a similar file in Mfix/model directory?
if test -r $mfix/$i
then
outfile=`echo $i | sed 's/\./\.0/'`
# Is there default file Mfix/model directory?
if test -r $mfix/$outfile
then
do_nothing="ok"

else
# Mfix/model directory does not have a default file. create one.
/bin/cp -f $mfix/$i $mfix/$outfile
fi

else
/bin/cp -f $i $mfix
echo "Using nonMfix include file: $i"
fi
done
echo
#
#------------------------------------------------------------------------
#
# Loop through all *.0* files in mfix/model directory
cd $mfix

echo
echo "Files from run directory used for making Mfix:"
for i in `ls *.0*`
do

# The user has a corresponding file
outfile=`echo $i | sed 's/\.0/\./'`
if test -r $run_dir/$outfile
then
echo " $outfile"

# User's file different from the .f or .inc file: copy user's file
cmp -s $run_dir/$outfile $outfile
if test $? = 0
then
case $auto_compile in
y|Y)
chmod u+w $outfile
/bin/cp -f $run_dir/$outfile $outfile
;;
*)
do_nothing="ok"
;;
esac
else
chmod u+w $outfile
/bin/cp -f $run_dir/$outfile $outfile
fi

# User does not have the corresponding file
else

# The .0f or .0inc file different from the .f or .inc file: copy *.0* file
cmp -s $i $outfile
if test $? = 0
then
/bin/rm -f $i
else
/bin/mv -f $i $outfile
touch $outfile
fi

fi
done
echo

#
#------------------------------------------------------------------------
#
# ISAT related modifications
if [ $DO_ISAT -eq 0 ]
then
/bin/cp -fp chem/isat_donothing/* chem
else
/bin/cp -fp chem/isat_do/* chem
fi
#
#------------------------------------------------------------------------
#

#AIKE 083105
#------------------------------------------------------------------------
# Check if the user's run directory has the following subdirectories
# that contains modified source code for the new modules.
#------------------------------------------------------------------------

#
# function updatesubdir defined here to embed all the operations applicable to subdirectories
# under run directory within in a single call but varying argument list,
# e.g.
# updatesubdir dqmom
# updatesubdir chem
#
#
updatesubdir()
{
#------------------------------- Step 1
#
# create default bckup copy *.f and *.inc files in model/subrun_dir directory,
# if they do not exist
#--------------------------------
subrun_dir=$1

echo ****
echo "Checking for modified user files under " $run_dir/$subrun_dir
echo ****

cd $run_dir/$subrun_dir
echo
echo "Ignore messages such as "Cannot access *.f or *.inc""
for i in `ls *.f`
do

# Is there a similar file in Mfix/model directory?
if test -r $mfix/$subrun_dir/$i
then
# to make bckup copy "create new name" by add .0f extension, mfix.f-> mfix.0f
outfile=`echo $i | sed 's/\./\.0/'`

# Is there default bckup copy of the file with *.0f extension under Mfix/model/subrun_dir directory?
# if not create one (if auto_compile is enabled)
# else do nothing
if test -r $mfix/$subrun_dir/$outfile
then
case $auto_compile in
y|Y)
chmod u+w $outfile
/bin/cp -f $run_dir/$subrun_dir/$outfile $outfile
;;
*)
do_nothing="ok"
;;
esac

else
# Mfix/model directory does not have a default file. create a backup copy with .0f extension
/bin/cp -f $mfix/$subrun_dir/$i $mfix/$subrun_dir/$outfile
fi
fi
done

#------------------------------- Step 2
#
# After generating the backup copy of the original under model/subrun_dir (if it didn't exist)
# copy the new user modified file from the run directory over the existing one
#
#------------------------------------------------------------------------
#
# Loop through all *.0* files in mfix/model/$subrun_dir directory
cd $mfix/$subrun_dir

echo
echo "Files from "$subrun_dir" under run directory used for making Mfix:"
for i in `ls *.0*`
do

# The user has a corresponding file
outfile=`echo $i | sed 's/\.0/\./'`
if test -r $run_dir/$subrun_dir/$outfile
then
echo " $outfile"

# User's file different from the .f or .inc file: copy user's file
cmp -s $run_dir/$subrun_dir/$outfile $outfile
if test $? = 0
then
case $auto_compile in
y|Y)
chmod u+w $outfile
/bin/cp -f $run_dir/$subrun_dir/$outfile $outfile
;;
*)
do_nothing="ok"
;;
esac
else
chmod u+w $outfile
/bin/cp -f $run_dir/$subrun_dir/$outfile $outfile
fi

# User does not have the corresponding file
else

# The .0f or .0inc file different from the .f or .inc file: copy *.0* file
cmp -s $i $outfile
if test $? = 0
then
/bin/rm -f $i
else
/bin/mv -f $i $outfile
touch $outfile
fi

fi
done
echo

} # eof function updatesubdir

#-----------
#AIKE Check for subdirectories under run directory
#-----------
if test -d $run_dir/chem
then
updatesubdir chem
fi

if test -d $run_dir/dqmom
then
updatesubdir dqmom
fi

if test -d $run_dir/des
then
updatesubdir des
fi

#JFD Check for Cartesian Grid subdirectory under run directory
if test -d $run_dir/cartesian_grid
then
updatesubdir cartesian_grid
fi

cd $mfix
#
#------------------------------------------------------------------------
#
case $dmp_version in
y|Y )
echo
echo -n '******************************************************'
echo
echo -n 'Preparing files for your dmp and/or smp compilation'
echo
echo -n '******************************************************'
echo

;;
*)
echo
echo -n '******************************************************'
echo
echo -n 'Preparing files for your serial/smp compilation'
echo
echo -n '******************************************************'
echo
/bin/cp -f mfix_l.make mfix_l_not.make
ex mfix_l_not.make < dmp_modules/ex.commands
/bin/cp -f mfix_u.make mfix_u_not.make
ex mfix_u_not.make < dmp_modules/ex.commands

cmp -s dmp_modules/compar_mod.f dmp_modules/mpi_donothing/compar_mod.f
if test $? = 0
then
echo
else
/bin/cp -f dmp_modules/compar_mod.f dmp_modules/mpi_donothing/
fi

cmp -s dmp_modules/gridmap_mod.f dmp_modules/mpi_donothing/gridmap_mod.f
if test $? = 0
then
echo
else
/bin/cp -f dmp_modules/gridmap_mod.f dmp_modules/mpi_donothing/
fi
;;
esac

#make_mfix:
case $smp_version in
y|Y )
mp_flag="$omp"
;;
*)
mp_flag=" "
;;
esac

case $dbg_version in
y|Y )
echo
echo "Execution may be SLOW. Do not use debug version for production runs!"
FORT_FLAGS="$mp_flag $compile_d"
FORT_FLAGS2="$mp_flag $compile_d2"
FORT_FLAGS3="$mp_flag $compile_d3"
LINK_FLAGS="$mp_flag $link_d"
LIB_FLAGS="$libs_d"
;;
*)
FORT_FLAGS="$mp_flag $compile $preinline_flags"
FORT_FLAGS2="$mp_flag $compile2 $preinline_flags"
FORT_FLAGS3="$mp_flag $compile3 $preinline_flags"
LINK_FLAGS="$mp_flag $link"
LIB_FLAGS="$libs"
;;
esac

echo "\n Compiling inline files . . ."

export FORT_FLAGS
export FORT_FLAGS2
export FORT_FLAGS3
export LINK_FLAGS
export LIB_FLAGS
export OBJ_EXT
export FORTRAN_EXT
export FORTRAN_CMD
export LINK_CMD
if [ "$USE_TAU" ]
then
export USE_TAU
fi
#AIKE debug what is sent to makefile
# echo "Test vars: " $FORT_FLAGS
# echo "Test vars: " $FORT_FLAGS2
# echo "Test vars: " $FORT_FLAGS3
# echo "Test vars: " $LIB_FLAGS3

#######
#INFO_3 Following block makes necessary setup for automatic instrumentation using TAU
#######
#------------------------------------------------------------------------
# T A U P e r f o r m a n c e P r o f i l i n g directives
#------------------------------------------------------------------------
#

if [ "$USE_TAU" ]
then
echo " "
echo "************************************************************************"
echo "Preparing for parsing source code and automatic instrumentation with TAU"
echo "************************************************************************"
inst_moved=0
miss_dir=0
#----
# Check if TAU directory is valid or not
#----
if test -d "$TAUROOTDIR"
then
echo
export TAUROOTDIR
else
echo
echo "TAU directory $TAUROOTDIR can not be found."
echo "Please set TAUROOTDIR environment variable at the top of"
echo "model/make_mfix file to a valid path. Aborting compilation."
echo
exit
fi
#----
# Check if PDToolkit directory is valid or not
#----
if test -d "$PDTROOTDIR"
then
echo
export PDTROOTDIR
else
echo
echo "PDToolkit directory $PDTROOTDIR can not be found."
echo "Please set PDTROOTDIR environment variable at the top of"
echo "model/make_mfix file to a valid path. Aborting compilation."
echo
exit
fi
#----
# Create the directive and environment variable block for TAU specific settings
#----
OUTfile=tausettings
echo "ifdef USE_TAU" > $OUTfile
# echo " include \$(TAUROOTDIR)/include/Makefile" >> $OUTfile
# echo " include \$(TAUROOTDIR)/xt3/lib/Makefile.tau-craytimers-multiplecounters-mpi-papi-pdt-pgi" >> $OUTfile
echo " include \$(TAUROOTDIR)/xt3/lib/Makefile.tau-callpath-craytimers-multiplecounters-mpi-papi-pdt-pgi" >> $OUTfile
# echo " include \$(TAUROOTDIR)/xt3/lib/Makefile.tau-phase-craytimers-multiplecounters-mpi-papi-pdt-pgi" >> $OUTfile
# echo " include \$(TAUROOTDIR)/xt3/lib/Makefile.tau-callpath-craytimers-mpi-pdt-pgi" >> $OUTfile
echo " MYOPTIONS=-optVerbose -optKeepFiles -optPdtF95Opts="-R free" -optTauSelectFile=select.tau " >> $OUTfile
case $dmp_version in
y|Y )
#COMPIL_SET=mpif90
COMPIL_SET=ftn
;;
*)
COMPIL_SET=qk-pgf90
;;
esac
echo " FORTRAN_CMD=\$(TAU_COMPILER) \$(MYOPTIONS)" $COMPIL_SET >> $OUTfile
echo " FORTRAN77_CMD=\$(TAU_COMPILER) \$(MYOPTIONS)" $COMPIL_SET >> $OUTfile
echo " LINK_CMD=\$(TAU_COMPILER) \$(MYOPTIONS)" $COMPIL_SET >> $OUTfile
# Need to check for dmp_version if serial compiling
case $dmp_version in
y|Y )
echo " LIB_FLAGS = odepack.a -lm -L \$(MPIHOME)/lib -lmpich -L\$(ACML_DIR)/lib -lacml -lacml_mv -L/opt/xt-tools/papi/3.2.1/lib/snos64 -lpapi -L/opt/xt-tools/papi/3.2.1/lib64/snos64 -lperfctr" >> $OUTfile
;;
*)
echo " LIB_FLAGS = odepack.a -lm -L\$(ACML_DIR)/lib -lacml -lacml_mv " >> $OUTfile
;;
esac
echo " LINK_FLAGS =" >> $OUTfile
echo "endif" >> $OUTfile
echo " " >> $OUTfile

SRCDIR=.

#----
# Create the select.tau for selecting the routines for TAU_instrumentor
#----
if test -r $SRCDIR/select.tau
then
echo " "
echo " *******"
echo " * select.tau file for TAU_instrumentor found, excluding the files"
echo " * and subroutines listed in select.tau for instrumentation"
echo " *******"
echo " "
else
SELfile=select.tau
echo "# Selective instrumentation: Specify an exclude/include list of routines/files." > $SELfile
echo "BEGIN_EXCLUDE_LIST" >> $SELfile
echo "#void quicksort(int *, int, int)" >> $SELfile
echo "#void interchange(int *, int *)" >> $SELfile
echo "SET_WALL_BC1" >> $SELfile
echo "PARALLEL_MPI::MPI_CHECK" >> $SELfile
echo "G_0" >> $SELfile
echo "EQUAL" >> $SELfile
echo "DROODP_G" >> $SELfile
echo "DG_0DNU" >> $SELfile
echo "BOUNDFUNIJK::BOUND_FUNIJK" >> $SELfile
echo "G_0CS" >> $SELfile
echo "COMPARE" >> $SELfile
echo "BOUNDFUNIJK3::BOUND_FUNIJK3" >> $SELfile
echo "DEBUG::ASSERT_I" >> $SELfile
echo "EOSG" >> $SELfile
echo "CALC_XSI" >> $SELfile
#echo "READ_NAMELIST" >> $SELfile
echo "END_EXCLUDE_LIST" >> $SELfile
echo "# " >> $SELfile
echo "# If an include list is specified, the routines in the list will be the only" >> $SELfile
echo "# routines that are instrumented." >> $SELfile
echo "# To specify an include list ( a list of routines that will be instrumented)" >> $SELfile
echo "# remove the leading # to uncomment the following lines" >> $SELfile
echo "#BEGIN_INCLUDE_LIST" >> $SELfile
echo "#int main(int, char **)" >> $SELfile
echo "#int select_" >> $SELfile
echo "#END_INCLUDE_LIST" >> $SELfile
echo "# " >> $SELfile
echo "# TAU also accepts file include/exclude lists that may be specified with" >> $SELfile
echo "# wildcard characters (* and ?) to exclude/include routines in specific files." >> $SELfile
echo "# These options may be used in conjunction with the routine include/exclude" >> $SELfile
echo "# lists as shown above. Uncomment the # to make the rule active." >> $SELfile
echo "# " >> $SELfile
echo "#" >> $SELfile
echo "#====================================================================" >> $SELfile
echo "# EITHER INCLUDE OR EXCLUDE LISTS SHOULD BE SPECIFIED, BUT NOT BOTH.!!!!!" >> $SELfile
echo "#====================================================================" >> $SELfile
echo "#BEGIN_FILE_INCLUDE_LIST" >> $SELfile
echo "#Main.cpp" >> $SELfile
echo "#Foo?.c" >> $SELfile
echo "#*.C" >> $SELfile
echo "#adjust_a_u_g.f" >> $SELfile
echo "#END_FILE_INCLUDE_LIST" >> $SELfile
echo "# Instruments routines in Main.cpp, Foo?.c and *.C files only" >> $SELfile
echo "#" >> $SELfile
echo "# Use BEGIN_[FILE]_INCLUDE_LIST with END_[FILE]_INCLUDE_LIST" >> $SELfile
echo "BEGIN_FILE_EXCLUDE_LIST" >> $SELfile
echo "#f*.c" >> $SELfile
echo "#impl?.C" >> $SELfile
echo "#calc_d.f" >> $SELfile
echo "#leq_bicgs.f" >> $SELfile
echo "#vf_gs_x.f" >> $SELfile
echo "#vf_gs_y.f" >> $SELfile
echo "#vf_gs_z.f" >> $SELfile
echo "END_FILE_EXCLUDE_LIST" >> $SELfile
echo "# excludes files f*.c and impl?.C (such as implA.C, foo.c)." >> $SELfile
echo " " >> $SELfile
fi

#----
# Check if mfix_merged.pdb exists and user still wants to run the parser
#----
parse_contin=y
if test -r $SRCDIR/mfix_merged.pdb
then
echo " "
echo " *******"
echo " * Resultant file from previous PDToolkit parsing was found: $SRCDIR/mfix_merged.pdb"
ls -als $SRCDIR/mfix_merged.pdb
echo " * Continuing with parsing will overwrite the existing file,"
echo -n " * Do you want to continue? (y/n) [no]"
read parse_contin
echo " "
echo $parse_contin
fi
case $parse_contin in
y|Y )
# Inform user if overwriting an existing *.pdb else print nothing
if test -r $SRCDIR/mfix_merged.pdb
then
echo " * Overwriting the previously generated mfix_merged.pdb"
fi
#----
# Check if any TAU ins

That is not what I was requesting but it contains evidence in the selection of lnx_compiler suggesting the app is perhaps not Intel compiler 11.1 ready.

I recommend both of you consult the authors/providers of this app about this linker error to determine what is needed in the app version you have to use Intel 11.1 compilers or if a new version is availablethat is Intel 11.1 compiler ready.

I also request that either come back here to post an update to this thread on what was learned to benefit others who may face this too. Thank you.

@ jipazimpNow mfix works!!

I've solved installing Ubuntu 9.04 (before I had Ubuntu 10) and Intel Fortran Compiler 10.1.026.

I have the following platform
architecture:i686
kernel = 2.6.28-19-generic
glibc=/lib/libc -2.9.so

@ Kevin
Thank you for your help!

Giuseppec

Thats sound great Giuseppec.

Do you know where I could get a previous Intel Compilers Release from?

I would intent tochange just the compilers, and I'll see what happen.

Thanks in advance.

Previous compiler versions are available at the Intel Registration Center.

See How to obtain an older version.

I've tried to register my Intel Compiler Suite Professional Edition for Linux, but in the Registration Center web page said that there is a problem with my account that prevents to register my product.

Is this procedure valid for Free-Non Commercial products for Linux?

Yes, valid for Non-comm too.

Post a request for help in the Intel Software Development Products Download, Registration & Licensing forum to get your account issue cleared up.

Hi all, finally I got Intel Fortran Compiler 10.1.026 and I just installed, mfix is just running fine.

It remains to find out why mfix does not run using IFC 11.1, I'll try to follow the make_mfix routine and see what is caussing the error.

Thakns Kevin, thanks Giuseppec.

We've received additional information about this error and after a colleague's further investigation he found the error occurs when an additional -lsvml option is specified as was noted earlier in this post. He determined something has changed in 11.1.073, but further investigation is needed to determine whether this represents a defect or not.

He found the compiler driver already inserts -lsvml into the link in the appropriate place and links it statically, by default. The additional -lsvml option inserts a second copy of libsvml at the head of the link, and links it dynamically. This is what leads to the link error.

To giuseppec and jipazimp.mx,

When you try re-building mfix with 11.1 compilers again, edit the Makefile and remove -lsvml from the LINK_CMD accordingly. It appears in multiple places for different build scenarios.

For others who experience this error,

My colleague's additional advice is, you can ensure there is no conflict between the two references to libsvml like this:

ifort sample.f -Bstatic -lsvml -Bdynamic

Or you can just link dynamically with -shared-intel. But simplest is not to specify -lsvml at all when using the compiler driver to do the linking. Let the driver figure out which run-time libraries are needed, and in which order.

I will update this post as I learn more.

(Resolution Update on 03/05/2014): This issue was resolved in the Fortran Composer XE 2011 SP1 (ifort Version 12.1.4.319 Build 20120410 - Linux)

Hello

I'm trying to compile a post processor results, post_mfix. For this I have to use the intel compiler fortran 9.x. I've tried installing several versions of this. The message I get from propt is that the license file I'm using is not a license file. What intrigued me is that when I use that same file to install 10.x or 11.x versions of the compiler installation proceeds without problems.

I am using the license file I get email when I register my serial number.

I am using Ubuntu 32-bit 10/10. The same error occurs in the 64-bit system.

You know what's going on?

Jean,

I suggest that you post in our Licensing forum section and provide the exact text of the error message you are seeing. I will comment that the version 9 compiler is not supported on Ubuntu 10. The application you are building is not really relevant.

Retired 12/31/2016

Steve,

Thanks
I Will try it.

Leave a Comment

Please sign in to add a comment. Not a member? Join today