CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

NOTE: mpc involed

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2010, 15:54
Default NOTE: mpc involed
  #1
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
The new gcc version 4.5.0 needs another lib called mpc, besides gmp and mpfr.
the current version is 0.8.2



Code:
#---------------------------------*- sh -*-------------------------------------
# =========                 |
# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
#  \\    /   O peration     |
#   \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
#    \\/     M anipulation  |
#------------------------------------------------------------------------------
# License
#     This file is part of OpenFOAM.
#
#     OpenFOAM is free software; you can redistribute it and/or modify it
#     under the terms of the GNU General Public License as published by the
#     Free Software Foundation; either version 2 of the License, or (at your
#     option) any later version.
#
#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
#     for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with OpenFOAM; if not, write to the Free Software Foundation,
#     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
#     makeGcc
#
# Description
#     Build script for gmp, mpfr, mpc and gcc-4.?.?
#
#------------------------------------------------------------------------------
usage() {
    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
    cat<<USAGE

usage: ${0##*/} <gcc-4.?.?> ...

* build gmp, mpfr, mpc and gcc-4.?.?

USAGE
    exit 1
}

if [ $# -ne 1 ]
then
    usage "gcc version not provided"
fi

#
# Set the number of cores to build on
#
WM_NCOMPPROCS=4

if [ -r /proc/cpuinfo ]
then
    WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
    [ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
fi

echo "Building on " $WM_NCOMPPROCS " cores"

GMP_DIR=$WM_THIRD_PARTY_DIR/gmp-5.0.1
MPFR_DIR=$WM_THIRD_PARTY_DIR/mpfr-3.0.0
MPC_DIR=$WM_THIRD_PARTY_DIR/mpc-0.8.2
GCC_DIR=$WM_THIRD_PARTY_DIR/$1

GMPROOT=${GMP_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH
MPFRROOT=${MPFR_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH
MPCROOT=${MPC_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH
GCCROOT=${GCC_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH

#
# Bulid GMP
#
if [ ! -d $GMPROOT ]
then
    (
#        make distclean \
        mkdir $GMP_DIR/build \
     && cd $GMP_DIR/build \
     && ../configure ABI=$ABI --prefix=$GMPROOT \
     && make -j $WM_NCOMPPROCS \
     && make install
    )
    echo "    Finished building gmp."
else
    echo "    gmp already built."
fi

export LD_LIBRARY_PATH="$GMPROOT/lib:$LD_LIBRARY_PATH"

#
# Build MPFR
#
if [ ! -d $MPFRROOT ]
then
    (
#        make distclean \
        mkdir $MPFR_DIR/build \
     && cd $MPFR_DIR/build \
     && ../configure ABI=$ABI --prefix=$MPFRROOT --with-gmp=$GMPROOT \
     && make -j $WM_NCOMPPROCS  \
     && make install
    )
    echo "    Finished building mpfr."
else
    echo "    mprf already built."
fi

export LD_LIBRARY_PATH="$MPFRROOT/lib:$LD_LIBRARY_PATH"

#
# Build MPC
#
if [ ! -d $MPCROOT ]
then
    (
#        make distclean \
        mkdir $MPC_DIR/build \
     && cd $MPC_DIR/build \
     && ../configure ABI=$ABI --prefix=$MPCROOT \
      --with-gmp=$GMPROOT --with-mpfr=$MPFRROOT \
     && make -j $WM_NCOMPPROCS  \
     && make install
    )
    echo "    Finished building mpc."
else
    echo "    mpc already built."
fi

export LD_LIBRARY_PATH="$MPCROOT/lib:$LD_LIBRARY_PATH"

#
# Build GCC
#
if [ ! -d $GCCROOT ]
then
    (
#        make distclean \
        mkdir $GCC_DIR/build \
     && cd $GCC_DIR/build \
     && ../configure --enable-languages=c,c++ --with-pkgversion='OpenFOAM' \
      --enable-__cxa_atexit --enable-libstdcxx-allocator=new \
      --with-system-zlib --prefix=$GCCROOT \
      --with-mpfr=$MPFRROOT --with-gmp=$GMPROOT --with-mpc=$MPCROOT \
     && make -j $WM_NCOMPPROCS \
     && make install
    )
    echo "    Finished building gcc."
else
    echo "    gcc already built."
fi


# ----------------------------------------------------------------- end-of-file
__________________
~
Daniel WEI
-------------
Boeing Research & Technology - China
Beijing, China
Email
lakeat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Elementwise multiplication operator johndeas OpenFOAM Running, Solving & CFD 3 March 9, 2019 13:03
Specifying nonuniform initial condition msyaml OpenFOAM Running, Solving & CFD 65 April 25, 2016 04:23
OpenFOAM-1.5-dev svn revision 1438: libOpenFOAM does not compile in SP 4xF OpenFOAM Bugs 3 October 16, 2009 05:35
Elements that limit the Courant number skabilan OpenFOAM Running, Solving & CFD 9 July 3, 2008 12:07
A stupid question luckyluke OpenFOAM Running, Solving & CFD 14 August 13, 2007 04:25


All times are GMT -4. The time now is 23:14.