Subject: Re: your mail

From: Zheng Gengbin <[email-masked]>
Date: Sat, 31 May 1997 09:54:48 +0800 (EAT)

Our platform is LINUX (slackware 3.1) , gcc 2.7.2 , g77 ,
MPI 1.0.9 .

	I have modified a little to configure.in to support LINUX .
I attach my configure.in here. Also I attched my config.cache here .

	If linux is not avaible to you , you can telnet to 
162.105.179.136 , using the account 'pact' and the password is the same as
HP . I will open the machines all day .

Gengbin

On Fri, 30 May 1997, Bryan Carpenter wrote:

> 
> Please can you send me the details of which operating system, compiler,
> MPI, etc you are using here.
> 
> The problem you reported later on the RS6000 was due to a missing
> header file for the ad++ interface.  That wouldn't affect the Fortran
> interface.
> 
> Thanks,
> Bryan
> 
> > This is the result of make in  test in Adlib-1.10 :
> > 
> > runtests
> > ../../src/script/ad++ -o test0 test0.C
> > ../../src/script/prun 4 test0 | tee test0.out
> > mpirun -pg -machinefile ./machines -np 4 test0
> > p1_4706:  p4_error: interrupt SIGSEGV: 11
> > rm_l_0_4707:  p4_error: interrupt SIGINT: 2
> > p2_4711:  p4_error: interrupt SIGSEGV: 11
> > p0_4701:  p4_error: interrupt SIGSEGV: 11
> > rm_l_0_4717:  p4_error: interrupt SIGINT: 2
> > rm_l_0_4712:  p4_error: interrupt SIGINT: 2
> > bm_list_4702:  p4_error: interrupt SIGINT: 2
> > p3_4716:  p4_error: interrupt SIGINT: 2
> > Segmentation fault (core dumped)
> > 
> > 
> > And Adlib-1.11 is the same .
> > 
> > Zheng
> > 
> 
> 
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
ac_cv_header_stdc=${ac_cv_header_stdc='yes'}
ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h='yes'}
ac_cv_prog_CPP=${ac_cv_prog_CPP='cc -E'}
ac_cv_prog_CXX=${ac_cv_prog_CXX='c++'}
ac_cv_prog_FCL=${ac_cv_prog_FCL='g77'}
ac_cv_prog_MPICC=${ac_cv_prog_MPICC='no'}
ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB='ranlib'}
ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross='no'}
ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g='yes'}
ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works='yes'}
ac_cv_prog_gxx=${ac_cv_prog_gxx='yes'}
adlib_cv_mpi_inc=${adlib_cv_mpi_inc='/u/pact/mpi/mpich/include/'}
adlib_cv_mpi_lib=${adlib_cv_mpi_lib='/u/pact/mpi/mpich/lib/LINUX/ch_p4'}
adlib_cv_mpipackage=${adlib_cv_mpipackage='mpich'}
adlib_cv_tail=${adlib_cv_tail='TWOSCORE'}
dnl ####################################################################
dnl #   Copyright (c)
dnl #
dnl #   You may copy, distribute, and modify it freely as long as you  #
dnl #   preserve distribute, and modify it freely as long as you       # 
dnl #   preserve this copyright and permission notice.                 #
dnl #                                                                  #
dnl #
dnl ####################################################################
dnl 
dnl Process this file and acconfig.h by autoconf to produce a configure script.
dnl 

AC_INIT(./configure)

AC_PREFIX_DEFAULT(`pwd`)

AC_CONFIG_AUX_DIR(./config)

AC_CONFIG_HEADER(./src/include/config.h)

AC_CANONICAL_SYSTEM

AC_ARG_PROGRAM

AC_HEADER_STDC

dnl AC_CHECK_TYPE(u_short,unsigned short)

AC_HEADER_SYS_WAIT

AC_PROG_RANLIB

VERSION=1.09
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(VERSION)

dnl current working directory

CWD=`pwd`
AC_SUBST(CWD)

dnl deciding mpi package

AC_MSG_CHECKING(the MPI package)

MPI=

AC_ARG_WITH(MPI, [
--with-MPI=mpich          Using mpich MPI (the defualt setting)
--with-MPI=chimp          Using chimp MPI 
--with-MPI=sp2            Using sp2 MPI from IBM ], MPI=${withval}, MPI=mpich )

AC_CACHE_VAL(adlib_cv_mpipackage, adlib_cv_mpipackage=$MPI) 

AC_MSG_RESULT(as $adlib_cv_mpipackage)

MPI=$adlib_cv_mpipackage

AC_SUBST(MPI)

case "$MPI" in
  mpich )

  dnl check if mpi installed.
  if test ! -x `which mpirun`
  then 
    echo "Please install mpich first ..."
    exit
  fi

  dnl decide whether there is MPICC

  AC_CHECK_PROG(MPICC, mpCC, yes, no)

  dnl deciding compiler and linker

  if [[ "$MPICC" = "yes" ]]
  then
    CXX=mpCC
    AC_SUBST(CXX)

    LIBKEY=
  else
    dnl    AC_PROG_CC
    dnl    AC_PROG_CPP

    AC_PROG_CXX

    dnl deciding lib according to machine.

    LIBKEY="-lmpi"

    case $target in

      *ibm* )
        LIBKEY=$LIBKEY
        ;;

      *solaris* )
        LIBKEY="$LIBKEY -lsocket -lnsl" 
        ;;

      *dec* )
        if [[ $CXX = c++ ]]
        then
          LIBKEY="$LIBKEY"
        else
          LIBKEY="$LIBKEY -lcomplex -lm" 
        fi

        ;;

      *linux* )
        LIBKEY=$LIBKEY
        ;;

      * ) 
        echo "C++ compiler on $target is not supported yet"
        exit
        ;; 

    esac

  fi

  AC_SUBST(LIBKEY)

  dnl get mpi prefix

  AC_MSG_CHECKING(MPI include dir)

  MPI_PREFIX=`which mpirun | sed 's%/bin/mpirun%%'`
  if [[ ! -f $MPI_PREFIX/include/mpi.h ]]
  then 
    echo "Please input the mpich install prefix:"
  read MPI_PREFIX
  fi  

  if [[ ! -f $MPI_PREFIX/include/mpi.h ]]
  then 
    echo "Please install mpich first ..."
    exit
  fi

  MPI_INC=$MPI_PREFIX/include/

  AC_CACHE_VAL(adlib_cv_mpi_inc, adlib_cv_mpi_inc=$MPI_INC) 

  AC_MSG_RESULT($adlib_cv_mpi_inc)

  MPI_INC=-I$adlib_cv_mpi_inc

  AC_SUBST(MPI_INC)

  dnl get mpich exec_prefix

  AC_MSG_CHECKING(MPI lib dir)

  ARCH=`tarch`

  DEVICE=`tdevice $ARCH`

  dnl use prefix here, not quite good
  MPI_LIB=$MPI_PREFIX/lib/$ARCH/$DEVICE

  AC_CACHE_VAL(adlib_cv_mpi_lib, adlib_cv_mpi_lib=$MPI_LIB) 

  AC_MSG_RESULT($adlib_cv_mpi_lib)

  MPI_LIB=-L$adlib_cv_mpi_lib

  AC_SUBST(MPI_LIB) 

  ;;

  chimp )

  echo Not supported 
  ;;

  sp2 )

  AC_CHECK_PROG(MPICC, mpCC, yes, no)

  if [[ "$MPICC" = "yes" ]]
  then 
    CXX=mpCC
  fi

  if [[ "$CXX" = "" ]]
  then
    echo "Please install SP2 mpCC first ..."
    exit
  fi

  MPI_INC=
  AC_SUBST(MPI_INC)

  MPI_LIB=
  AC_SUBST(MPI_LIB) 

  LIBKEY=
  AC_SUBST(LIBKEY)
  ;;

  * )

  echo The package does not support MPI=$MPI.
  exit
  ;;

esac

dnl compiler option

AC_MSG_CHECKING(compiler option)

COMPILER_OPT=

AC_ARG_ENABLE(STRONG, 
--enable-STRONG           Package building flag (default as disabled),
COMPILER_OPT=-Dstrong,
COMPILER_OPT= )

AC_MSG_RESULT(as $COMPILER_OPT)
AC_SUBST(COMPILER_OPT)

dnl when we want better performance

AC_MSG_CHECKING(optimize option)

OPTIMIZE=

AC_ARG_ENABLE(OPTIMIZE, 
--enable-OPTIMIZE         Package building flag (default as disabled),
OPTIMIZE=-O,
OPTIMIZE= )

AC_MSG_RESULT(as $OPTIMIZE)
AC_SUBST(OPTIMIZE)

dnl

PERL=`which perl`

if [[ "$PERL" = "" ]]
then
  echo "Need perl to install the package"
  exit 1
fi

AC_SUBST(PERL)

dnl for Fortran interface

case $target in
	
  *ibm* )

  if [[ $MPICC = yes ]]
  then
    AC_CHECK_PROG(FCL, mpxlf, mpxlf)
  fi
  if [[ "$FCL" = "" ]]
  then 
    AC_CHECK_PROG(FCL, xlf, xlf)
  fi
  if [[ "$FCL" = "" ]]
  then 
    AC_CHECK_PROG(FCL, f77, f77)
  fi
  if [[ "$FCL" != "" ]]
  then 
    FC_OPT=
  fi
  PLATFORM="-DAIX"
  ;;

  *dec* )

  AC_CHECK_PROG(FCL, f90, f90)
  if [[ "$FCL" = "" ]]
  then 
    AC_CHECK_PROG(FCL, f77, f77)
  fi
  PLATFORM="-DDEC"
  ;;

  *solaris* )

  AC_CHECK_PROG(FCL, f90, f90)
  if [[ "$FCL" = "" ]]
  then
    AC_CHECK_PROG(FCL, f77, f77)
  fi
  PLATFORM="-DSOLARIS"
  ;;

  *linux*)

  AC_CHECK_PROG(FCL, f90, f90)
  if [[ "$FCL" = "" ]]
  then
    AC_CHECK_PROG(FCL, g77, g77)
  fi
  PLATFORM="-DEPC"
  ;;

  * ) 
  AC_CHECK_PROG(FCL, f77, f77)
  PLATFORM=  
  ;; 

esac

if [ test "$FCL" != "" ]
then
  dnl decide tailing underscore

  AC_MSG_CHECKING(subrotine name used by Fortran compiler)
  AC_CACHE_VAL(adlib_cv_tail,   
  cat > conftest.f <<EOF
      SUBROUTINE PCRC_FOO
      END
EOF

  $FCL -c conftest.f > /dev/null 2> /dev/null

  NAME=`nm conftest.o | grep "foo__"`
  if [[ test "$NAME" != "" ]]  
  then
    adlib_cv_tail=TWOSCORE
  else
    NAME=`nm conftest.o | grep "foo_"`
    if [[ test "$NAME" != "" ]]  
    then
      adlib_cv_tail=ONESCORE
    else
      NAME=`nm conftest.o | grep "foo"`
      if [[ test "$NAME" != "" ]]  
      then
        adlib_cv_tail=NONSCORE
      else
        echo "FORTRAM compiler generated name not supported yet"
        exit 1 
      fi
    fi
  fi

  rm -f conftest.f conftest.o
  )

  AC_MSG_RESULT(as $adlib_cv_tail)
  
  if [[ "$adlib_cv_tail" = TWOSCORE ]]
  then
    SUFFIX=__
  fi

  if [[ "$adlib_cv_tail" = ONESCORE ]]
  then
    SUFFIX=_
  fi

  if [[ "$adlib_cv_tail" = NONSCORE ]]
  then
    SUFFIX=
  fi

  AC_SUBST(SUFFIX)

  dnl decide how to link C++ library from Fortran

  if [[ "$CXX" = "c++" ]]
  then
    dnl CXXLIBKEY is not a good name here!
    CXXLIBKEY=`c++ -print-libgcc-file-name`
  else
    case $target in

    *ibm* )
    CXXLIBKEY="-lC"
    ;;

    *dec* )
    CXXLIBKEY="-lcxx"

    ;;

    *)
    echo C++ not tested on $target yet.
    ;;

    esac
  fi

  pcrcFortran=pcrcFortran
else
  pcrcFortran=
fi

AC_SUBST(FC_OPT)
AC_SUBST(PLATFORM)
AC_SUBST(CXXLIBKEY)
AC_SUBST(pcrcFortran)

AC_OUTPUT(
Makefile 
src/Makefile 
src/include/Makefile src/kernel/Makefile src/script/Makefile src/pcrcFortran/Makefile
man/Makefile
man/man1/Makefile
test/Makefile test/kernel/Makefile test/pcrcFortran/Makefile
src/script/ad++:src/script/ad++.in
src/script/prun:src/script/prun.in
src/pcrcFortran/pcrcf:src/pcrcFortran/pcrcf.in 
src/pcrcFortran/extname.h:src/pcrcFortran/extname.h.in
test/kernel/runtests:test/kernel/runtests.in
test/pcrcFortran/runtests:test/pcrcFortran/runtests.in
)

chmod a+x src/script/ad++
chmod a+x src/script/prun
chmod a+x test/kernel/runtests
chmod a+x test/pcrcFortran/runtests
if [[ "$pcrcFortran" != "" ]]
then
  chmod a+x src/pcrcFortran/pcrcf
fi

echo Done!