patches to make Fujitsu Compilers works with openMPI
[charm.git] / src / arch / mpi-linux-x86_64 / cc-mpicxx.sh
1
2 # user enviorn var: MPICXX and MPICC
3 # or, use the definition in file $CHARMINC/MPIOPTS
4 MPICXX_DEF=mpicxx
5 MPICC_DEF=mpicc
6
7 MPICXX=$MPICXX_DEF
8 MPICC=$MPICC_DEF
9 test "$MPICXX" != "$MPICXX_DEF" && /bin/rm -f $CHARMINC/MPIOPTS
10 if test ! -f "$CHARMINC/MPIOPTS"
11 then
12   echo MPICXX_DEF=$MPICXX > $CHARMINC/MPIOPTS
13   echo MPICC_DEF=$MPICC >> $CHARMINC/MPIOPTS
14   chmod +x $CHARMINC/MPIOPTS
15 fi
16
17 CMK_REAL_COMPILER=`$MPICXX -show 2>/dev/null | cut -d' ' -f1 `
18 case "$CMK_REAL_COMPILER" in
19 g++)   CMK_AMD64="-m64 -fPIC" ;;
20 icpc)  CMK_AMD64="-m64";;
21 pgCC)  CMK_AMD64="-DCMK_CC_PGCC=1" ;;
22 FCC)   CMK_AMD64="-Kfast -DCMK_CC_PGCC=1 --variadic_macros";;
23 esac
24 CMK_REAL_C_COMPILER=`$MPICC -show 2>/dev/null | cut -d' ' -f1 `
25
26
27
28 CMK_CPP_CHARM="/lib/cpp -P"
29 CMK_CPP_C="$MPICC -E"
30 CMK_CC="$MPICC $CMK_AMD64 "
31 CMK_CXX="$MPICXX $CMK_AMD64 "
32 CMK_CXXPP="$MPICXX -E $CMK_AMD64 "
33 CMK_LD="$CMK_CC "
34 CMK_LDXX="$CMK_CXX "
35
36 CMK_NATIVE_CC="$CMK_REAL_C_COMPILER $CMK_AMD64 "
37 CMK_NATIVE_LD="$CMK_REAL_C_COMPILER $CMK_AMD64 "
38 CMK_NATIVE_CXX="$CMK_REAL_COMPILER $CMK_AMD64 "
39 CMK_NATIVE_LDXX="$CMK_REAL_COMPILER $CMK_AMD64 "
40 CMK_NATIVE_LIBS=""
41
42 case "$CMK_REAL_COMPILER" in
43 FCC) CMK_NATIVE_LD="$CMK_REAL_C_COMPILER";;
44 esac
45
46
47
48 # fortran compiler 
49 # for Intel Fortran compiler 8.0 and higher which is renamed to ifort from ifc
50 # does not work for ifc 7.0
51 CMK_CF77="mpif77 -auto -fPIC "
52 CMK_CF90="mpif90 -auto -fPIC "
53 CMK_CF90_FIXED="$CMK_CF90 -132 -FI "
54 F90DIR=`which ifort 2> /dev/null`
55 if test -h "$F90DIR"
56 then
57   F90DIR=`readlink $F90DIR`
58 fi
59 if test -x "$F90DIR"
60 then
61   F90LIBDIR="`dirname $F90DIR`/../lib"
62   F90MAIN="$F90LIBDIR/for_main.o"
63 fi
64 # for_main.o is important for main() in f90 code
65 CMK_F90MAINLIBS="$F90MAIN "
66 CMK_F90LIBS="-L$F90LIBDIR -lifcore -lifport "
67 CMK_F77LIBS="$CMK_F90LIBS"
68
69 CMK_F90_USE_MODDIR=""
70
71