diff --git a/makeMPICH b/makeMPICH index 9514c85..dd7b8fc 100755 --- a/makeMPICH +++ b/makeMPICH @@ -36,13 +36,13 @@ if [ "$1" = "-test" ] then [ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; } dir="$2" # <- MPI_ARCH_PATH - if [ -r "$dir/lib/libmpich.so" ] + if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpich.so" ] then - echo "Have mpich shared library" + echo "Have mpich shared library (${dir##*/})" exit 0 - elif [ -r "$dir/lib/libmpich.a" ] + elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpich.a" ] then - echo "Have mpich static library" + echo "Have mpich static library (${dir##*/})" exit 0 else echo "No mpich libraries found: ${dir:-not-specified}" @@ -145,51 +145,35 @@ else echo ( - # WARNING: unmaintained build code: - # --------------------------------- + # configuration options: + unset configOpt + # end of configuration options + # ---------------------------- + cd $MPI_SOURCE_DIR || exit 1 + [ -e Makefile ] && make distclean 2>/dev/null + + rm -rf $MPI_ARCH_PATH + rm -rf $buildDIR + mkdir -p $buildDIR + cd $buildDIR set -x - [ -e Makefile ] && make distclean 2>/dev/null - rm -rf $MPI_ARCH_PATH - rm -rf util/machines/machines.* - - ./configure \ + $MPI_SOURCE_DIR/configure \ --prefix=$MPI_ARCH_PATH \ - --without-mpe \ - --disable-f77 --disable-f90 --disable-f90modules \ - --disable-debug --disable-mpedbg --disable-devdebug \ - --enable-sharedlib=$MPI_ARCH_PATH/lib \ - --with-device=ch_p4 \ - ; - - # For MPICH2 below 1.5a1 uncomment this line and comment next - # make && make install - - # For MPICH2 1.5a1 or above - make -j $WM_NCOMPPROCS && make install - - make distclean - - if [ -r $MPI_ARCH_PATH ] - then - cd $MPI_ARCH_PATH/bin - for file in * - do - sed s%$MPI_ARCH_PATH%'$MPI_ARCH_PATH'%g $file > temp.$$ - mv temp.$$ $file - chmod 0755 $file - done - - cd $MPI_ARCH_PATH/lib - - if [ -r libmpich.so.1.0 ] - then - rm *.so - ln -s libmpich.so.1.0 libmpich.so - fi - fi - ) + --disable-fortran --disable-g \ + --libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \ + --enable-shared --disable-static \ + $configOpt \ + && set +x \ + && make -j $WM_NCOMPPROCS \ + && make install \ + && echo "Built: $mpiPACKAGE" \ + && pkgconfigAdjust $MPI_ARCH_PATH + ) || { + echo "Error building: $mpiPACKAGE" + exit 1 + } fi #------------------------------------------------------------------------------