CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   ParMETIS and gcc-4.4 (http://www.cfd-online.com/Forums/openfoam-bugs/70877-parmetis-gcc-4-4-a.html)

podallaire December 8, 2009 16:05

ParMETIS and gcc-4.4
 
HI,

does anybody is having issue withParMETIS and gcc-4.4 / I'm getting this when
trying to compile the lib :

node_refine.c: In function 'KWayNodeRefine__':
node_refine.c:355: warning: implicit declaration of function 'GKfree__'
cc1(36085) malloc: *** error for object 0x140d52750: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
node_refine.c:114: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I know that some fixes were pushed to 1.6.x in order to use gcc-4.4 / I'm just not sure if the problem is with the compiler or the lib

Thanks

PO

mattijs December 10, 2009 04:03

This looks like a problem in your compiler. I do not see any problems compiling with either 4.4 or 4.3. (the 'implicit declaration' warning I do get though)

wyldckat December 11, 2009 09:13

Greetings,

Could also have been a problem with the downloaded ThirdParty package or bad unpacking... it tends to happen often enough :(
Do:
Code:

md5sum ThirdParty-1.6.General.gtgz
And compare with the value indicated on OpenCFD's download page.

By the way, Mattijs can you (or someone else at OpenCFD) add the md5sum instructions to the download page, just prior to the tar instructions? It could help reduce some of these false positives!

Best regards,
Bruno

podallaire December 11, 2009 12:45

Thanks for your suggestions / I checked and my package is fine.

Well, for some reason, my gcc 4.4 and 4.5 don't build the lib properly while 4.3 does not complaint about it. I guess I will stick to 4.3 for now.

Regards,

PO

wyldckat December 11, 2009 13:10

Uhm... now that I've re-read the first post, it reminded me that I also have had one of those issues. The two solutions I've used are:
  1. As for the implicit declaration, try this: edit the files "$WM_THIRD_PARTY_DIR/ParMetis-3.1/ParMETISLib/proto.h" and "$WM_THIRD_PARTY_DIR/ParMetis-3.1/METISLib/proto.h" and remove the comments from
    Code:

    /*void GKfree(void **,...); */
    I had to do this months ago to get it to cross-compile with MinGW.
  2. If the other issue persists, try downloading this package and retrieve the gcc folder from it; it has gcc-4.4.2 pre-release. It's from the MinGW-w64 project and has worked well for me, both in compiling for Linux (32 and 64bit) as well as creating the cross-compiler Mingw-w32/64 Linux to Windows.

The script I use for building the gcc-4.4.2 (and gcc-4.5.0), modified from the makeGcc that comes with the ThirdParty package, is this:
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
#    makeGcc44
#
# Description
#    Build script for gmp, mpfr and gcc-4.3.? and gcc-4.4.?
#
#------------------------------------------------------------------------------
usage() {
    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
    cat<<USAGE

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

* build gmp, mpfr and gcc-4.3.? and gcc-4.4.?

USAGE
    exit 1
}

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


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

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"

GCC_DIR=$WM_THIRD_PARTY_DIR/$1

GCCROOT=${GCC_DIR}/platforms/$WM_ARCH$WM_COMPILER$WM_COMPILER_ARCH

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

# ----------------------------------------------------------------- end-of-file

Sorry for not attaching it in a file, but I didn't feel like tar.gz'ing it.

Good luck! Hope it works.
Bruno


All times are GMT -4. The time now is 00:30.