|
[Sponsors] |
November 9, 2009, 10:08 |
Compilation error for openfoam - 1.6
|
#1 |
New Member
Join Date: Nov 2009
Posts: 17
Rep Power: 17 |
Hi,
I am trying to compile the OpenFOAM v. 1.6 for the first time for a new user application and getting the error message described below: Making dependency list for source file icoFoam.C SOURCE=icoFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/icoFoam.o g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/icoFoam.o -L/user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt \ -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /user/leuven/300/vsc30098/OpenFOAM/vsc30098-1.6/applications/bin/linux64GccDPOpt/myicoFoam /user/leuven/300/vsc30098/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so: file not recognized: File format not recognized collect2: ld returned 1 exit status make: *** [/user/leuven/300/vsc30098/OpenFOAM/vsc30098-1.6/applications/bin/linux64GccDPOpt/myicoFoam] Error 1 Does someone have any idea to solve this linking error? Thx in advance. |
|
December 11, 2009, 12:41 |
Error compiling new solvers and ParaFoam
|
#2 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Hello folks,
I'm having a very similar problem as misakagan while compiling both new solvers and paraFoam. I'm working with SLES 10. That is the the printout of my problem. /home/andrea/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libsampling.so: file not recognized: File format not recognized collect2: ld returned 1 exit status make: *** [/home/andrea/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/financialFoam] Error 1 Does anybody have an idea of how to fix this error? Thanks AB |
|
December 11, 2009, 14:18 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hello Andrea,
Did you unpack the binary packages of OpenFOAM? If so, that might be the reason for the linking issue. The gcc versions might be incompatible. Try: Code:
rm -rf /home/andrea/OpenFOAM/OpenFOAM-1.6/lib/* rm -rf /home/andrea/OpenFOAM/OpenFOAM-1.6/applications/bin/* Then redo ./Allwmake from the folder OpenFOAM-1.6. Hope it works. Best regards, Bruno |
|
December 14, 2009, 09:31 |
Still problems compiling OpenFOAM 1.6 on SLES 10
|
#4 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Thank you Bruno for your reply.
Unfortunately your hint doesnt fix the problem. Durign re-compiling we still realize the same errors as posted previously about collect2: *** file not recognized: File format not recognized collect2: ld returned 1 exit status Consequently the compilation failed. I'm a newbie but it seems that there are problems with the linkage between OpenFoam libraries and SLES libraries. Do you have other hints? Does anybody know if there is an incompatibility between SLES 10 and OpenFOAM 1.6? That's because I tried to install OpenFOAM in my private laptop which use DEBIAN as OS and I didnt realize any problem. For my project I have to compare the resaults of Fluent12 and OpenFOAM and on my server machine I must install either SLES 10 or RedHat Enterprise 4/5 which support Fluent12. Does anybody had problems installing OpenFOAM 1.6 on RedHat Enteprise 4 or 5? With regards. AB |
|
December 14, 2009, 10:15 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hello Andrea,
Are you using the system compiler (did you change the file OpenFOAM-1.6/etc/settings.sh)? Or the are you using gcc-4.3.3 that comes in the ThirdParty Folder? To build the packed gcc-4.3.3, in a terminal/console, go to the ThirdParty folder and do: Code:
./makeGcc gcc-4.3.3 Open a new terminal again (assuming you already have OpenFOAM-1.6/etc/bashrc in your ~/.bashrc), and you shouldn't see any errors. Also, try searching for SLES on this forum... and/or the full OS name. There have been some other issues with the more recent compilers that come with the latest Linux distros. Best regards, Bruno |
|
December 14, 2009, 10:36 |
|
#6 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Hello Bruno,
I tried to use both system compiler and OpenFOAM compiler by changing the setting.sh file but I realized exactly the same errors. The Gcc package was already installed and this is the printout: Building on 4 cores gmp already built. mprf already built. gcc already built. I followed step by step all the procedures according to the userguide but I really do not understand how to go forward. I even tried to look for other posts in this forum, whitout results. I really think it may be an incompatibilty problem between OepnFOAM and my linux distribution. Best regards, AB |
|
December 14, 2009, 10:47 |
|
#7 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
If you can, try starting from scratch again, and unpack only the source code files, namely the ".General.tar.gz" packages. Then build the gcc that comes with the ThirdParty folder. And then you build OpenFOAM. NOTE: if you don't want to start from scratch, remove the contents of the folder gcc-4.3.3/platforms. Additionally, there are several packages that you should install in your SLES. The names in Ubuntu are: flex git git-core build-essential python-dev libqt4-dev libreadline5-dev wget zlib1g-dev texinfo byacc bison cmake.You'll also need gcc-multilib if you want to build the 32 version. Some of these names should be the same, but others may be under other names. Hope you can do it this time! Bruno |
||
December 14, 2009, 11:41 |
|
#8 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Bruno, I really appreciate your help
I followed up your instructions but I had problems while compiling Gcc: Building on 4 cores make: *** No rule to make target `distclean'. Stop. Finished building gmp. make: *** No rule to make target `distclean'. Stop. Finished building mpfr. make: *** No rule to make target `distclean'. Stop. Finished building gcc. Do you have an idea of what does it mean? Probably I'm forgetting something... Furthermore I'm looking for the other packages to be added. Regards, AB |
|
December 14, 2009, 12:25 |
|
#9 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
gcc-4.3.3If it still gives you the same warning/error, then edit the makeGcc script and remove the 3 lines that say: Code:
&& if [ -e Makefile ]; then make distclean; fi \ |
||
December 14, 2009, 12:49 |
|
#10 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Sorry Bruno,
I'm getting a little bit confused. I unpacked just the two "*.General.tar.gz" packages in order to compile everything from scratch. Inside the following folders gcc-4.3.3 mpfr-2.4.1 gmp-4.2.4 I cannot find neither the Platform folder nor the build folder, so I could not delete anything. Furthermore, I cannot find the 3 lines to be removed inside the makeGcc script. How could it be possible? Thanks in advance. AB |
|
December 14, 2009, 13:24 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
OH, I thought you didn't do a clean deploy just now... OK, let me think... ah, now I remember, I tweaked the makeGcc script... sorry.
I guess it's easier this way... Here is my tweaked version of makeGcc: 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 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" GMP_DIR=$WM_THIRD_PARTY_DIR/gmp-4.2.4 MPFR_DIR=$WM_THIRD_PARTY_DIR/mpfr-2.4.1 GCC_DIR=$WM_THIRD_PARTY_DIR/$1 GMPROOT=${GMP_DIR}/platforms/$WM_ARCH$WM_COMPILER$WM_COMPILER_ARCH MPFRROOT=${MPFR_DIR}/platforms/$WM_ARCH$WM_COMPILER$WM_COMPILER_ARCH GCCROOT=${GCC_DIR}/platforms/$WM_ARCH$WM_COMPILER$WM_COMPILER_ARCH # # Build GMP # if [ ! -d $GMPROOT ] then ( if [ ! -d "$GMP_DIR/build" ]; then mkdir $GMP_DIR/build; fi \ && cd $GMP_DIR/build \ && if [ -e Makefile ]; then make distclean; fi \ && ../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 ( if [ ! -d "$MPFR_DIR/build" ]; then mkdir $MPFR_DIR/build; fi \ && cd $MPFR_DIR/build \ && if [ -e Makefile ]; then make distclean; fi \ && ../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 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 \ --with-system-zlib --prefix=$GCCROOT \ --with-mpfr=$MPFRROOT --with-gmp=$GMPROOT \ && make -j $WM_NCOMPPROCS \ && make install ) echo " Finished building gcc." else echo " gcc already built." fi # ----------------------------------------------------------------- end-of-file I hope that now you can get it to work! |
|
December 15, 2009, 12:38 |
|
#12 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Hello Bruno, thank you again for trying to help me.
Unfortunately, also the last solution proposed doesnt work. Now the compilation start correctly (at least as it seems) but cannot be completed. I attach here the log file hoping you may better understand the problem. log.zip |
|
December 15, 2009, 12:58 |
|
#13 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hello Andrea,
Well, lucky you! I've already come across this problem too "log1p.c not found" And I've also already reported on this forum here: Quote:
Code:
cd ThirdParty-1.6 patch -p1 < ../patchMPFR If you don't trust my patch (or something else goes wrong), then download and unpack the official version of mpfr-2.4.1! Remember, victory will likely only happen if you keep going on fighting, no matter how many battles you loose Of course that might also lead to the wrong battles being fought Best regards, Bruno |
||
December 17, 2009, 07:13 |
Still problems with gcc compilation from scratch
|
#14 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Hello Bruno.
Honestly, I'm not used to throw in the sponge so quickly. Nevertheless I'm still obtaining errors while compiling Gcc even using the patchMPFR file. I send you the log file log_2009-12-17.zip In the meantime, I asked to my system administrator for the installation of the additional packages according to your previous post but I'm still waiting for. I wonder if the problems I realized may be concerned to this lack. Next steps are trying to install previous versions of OpenFOAM or better change the machine using a different linux distribution. However, from tomorrow I'm on holiday, so I'll think about it next year... Really all the best and happy new year in advance. Andrea |
|
December 17, 2009, 07:20 |
|
#15 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Andrea,
Well, now here is something I mentioned before... you're missing the multilib package. Code:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory I'll edit this post later... best, Bruno |
|
December 17, 2009, 09:27 |
|
#16 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Bruno,
I confirm you that the file stubs-32.h is missing. The folder /usr/include/gnu/ contains only the following files: - stubs-64.h - stubs.h - libc-version.h - lib-names.h Please consider I'm working on a 64-bit machine. Best Regards, Andrea |
|
December 29, 2009, 09:58 |
regarding stubs32.h
|
#17 |
New Member
Steffen Weise
Join Date: Dec 2009
Location: Germany
Posts: 1
Rep Power: 0 |
Hello,
i am getting the same errors on a 64-bit machine trying to compile gcc. As far as i can tell you are missing the 32-bit glibc-headers. Please install them from your distro (in Ubuntu the package is called: libc6-dev-i386) In my opinion the makeGcc-script and the overall documentation regarding this toolchain (compiling your own gcc) really needs some polishing. with kind regards, Steffen |
|
December 29, 2009, 15:08 |
Ah, it was multilib...
|
#18 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Steffen and welcome to the forum!
Your way works well, but Andrea has a minor limitation: he doesn't have administrative permissions over his working machine... so it might take a while for the admin to install the missing packages. So, Andrea and Steffen, if you only want to build 64bit versions of OpenFOAM, then by adding "--disable-multilib" to the configure line in the makeGcc script, you can disable the multilib functionality of gcc. In other words, while the original version can build 32 and 64 executables, this disabled multilib version will only allow building 64bit applications. If you were building in 32 bit Linux, then only 32bit would be available. The whole script is as follows: 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 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" GMP_DIR=$WM_THIRD_PARTY_DIR/gmp-4.2.4 MPFR_DIR=$WM_THIRD_PARTY_DIR/mpfr-2.4.1 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 GCCROOT=${GCC_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH # # Build GMP # if [ ! -d $GMPROOT ] then ( if [ ! -d "$GMP_DIR/build" ]; then mkdir $GMP_DIR/build; fi \ && cd $GMP_DIR/build \ && if [ -e Makefile ]; then make distclean; fi \ && ../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 ( if [ ! -d "$MPFR_DIR/build" ]; then mkdir $MPFR_DIR/build; fi \ && cd $MPFR_DIR/build \ && if [ -e Makefile ]; then make distclean; fi \ && ../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 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 \ --with-system-zlib --prefix=$GCCROOT \ --with-mpfr=$MPFRROOT --with-gmp=$GMPROOT --disable-multilib \ && make -j $WM_NCOMPPROCS \ && make install ) echo " Finished building gcc." else echo " gcc already built." fi # ----------------------------------------------------------------- end-of-file Code:
gcc flex bison m4 git-core build make texinfo Oh, by the way Andrea, the script I previously posted here had a slight incompatibility with the original OpenFOAM-1.6 distribution... I added "$WM_COMPILER" to the folder paths of gcc, gmp and mpfr. Now it's fixed... I think. So it should work out of the box now And Steffen: Quote:
Additionally, the OpenFOAM 1.6.x git version should build properly with the more recent gcc versions (4.4.1 and up to 4.5.x), so "yast/zypper/apt-get/synaptic" (and others, depending on your distro) should do the trick pretty well Best regards and I hope it works now! Bruno |
||
January 26, 2010, 11:45 |
OpenFOAM compiling problems
|
#19 |
New Member
Andrea Beretti
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Greatings Bruno,
first of all my apologies if I didnt reply you before. I've tried the last solution you posted here but I'm still having problems while compiling. Probably I'm still missing some additional packages that should be installed. In the meantime I asked for a brand new machine and installing Debian as OS all works fine. So, even if I havent fix the problem thanks for your kind help. I hope your hints may help others foamers. With best regards, Andrea |
|
February 21, 2012, 11:36 |
|
#20 | |
Member
Tibo
Join Date: Jun 2011
Posts: 68
Rep Power: 15 |
Quote:
Tibo Edit: ok, actually "only" about 80% is gone. Anyway, I´m on the right way =D Last edited by megacrout; February 22, 2012 at 05:20. |
||
Tags |
compilation, openfoam 1.6 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
install OpenFoam 1.6 by building source: how? | niudie | OpenFOAM Installation | 13 | April 26, 2011 01:48 |
Install of OpenFOAM 1.6 Error 1 Error 2 & run tutorial | potac | OpenFOAM Installation | 3 | August 27, 2009 10:04 |
OpenFOAM Version 1.6 Released | opencfd | OpenFOAM Announcements from ESI-OpenCFD | 0 | July 27, 2009 18:55 |
Compilation error with uparm.f | Raghu | Siemens | 2 | May 30, 2007 03:09 |
Compilation Error.... | Arnab | Siemens | 4 | September 12, 2004 16:54 |