CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Error compiling OpenFOAM 1.7.x (https://www.cfd-online.com/Forums/openfoam-installation/102893-error-compiling-openfoam-1-7-x.html)

uli June 5, 2012 17:51

Error compiling OpenFOAM 1.7.x
 
hi everybody

I followed the instructions on http://albertopassalacqua.com/?p=920

but compiling finally gives me

Code:

/home/uli/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libscotch.so: undefined reference to `pthread_create'
/home/uli/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libscotch.so: undefined reference to `pthread_detach'
collect2: ld returned 1 exit status
make[2]: *** [/home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/IFCLookUpTableGen] Error 1
make[2]: Leaving directory `/home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/IFCLookUpTableGen'
make[1]: *** [IFCLookUpTableGen] Error 2
make[2]: Entering directory `/home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
Making dependency list for source file mixtureAdiabaticFlameT.C
make[2]: Leaving directory `/home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
make[2]: Entering directory `/home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
SOURCE=mixtureAdiabaticFlameT.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/uli/OpenFOAM/OpenFOAM-1.7.x/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/uli/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/home/uli/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/mixtureAdiabaticFlameT.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/uli/OpenFOAM/OpenFOAM-1.7.x/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/uli/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/home/uli/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/mixtureAdiabaticFlameT.o -L/home/uli/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt \
    -lspecie -lOpenFOAM -ldl  -lm -o /home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/mixtureAdiabaticFlameT
make[2]: Leaving directory `/home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT'
make[1]: Target `application' not remade because of errors.
make[1]: Leaving directory `/home/uli/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/thermophysical'
make: *** [thermophysical] Error 2
make: Target `application' not remade because of errors.

(hope all the Errors are in there)

One point in the installation recipe says
"Download both the OpenFOAM and ThirdParty packages from here and save them in your ~/OpenFOAM directory"
but I only found the file "ThirdParty-1.7.1.gtgz" (no OpenFOAM?) under that link - maybe the reason for my problem?

I use opensuse 12.1
any support is appreciated

thanks in advance
Uli

mwild June 6, 2012 06:15

And why do you want to use the ancient 1.7.x? There are binary packages of the current 2.1.1 version available for OpenSUSE 12.1: http://openfoam.org/download/suse.php

uli June 6, 2012 07:21

Thanks for your reply.
I need to use OF 1.7.x because thats the version used at my university.

wyldckat June 6, 2012 17:35

Greetings to all!

@uli: OK, there's a big problem here: OpenFOAM 1.7.x isn't 100% compatible with Gcc 4.6.2 that openSUSE 12.1 has by default. Or at least, AFAIK it wasn't very well tested with the Gcc 4.6 series, so results may be very suspicious.
Side note: http://openfoamwiki.net/index.php/In...ibility_Matrix for more info on relations between versions of OpenFOAM and Gcc.

The latest known compatible series is Gcc 4.5, which isn't very easy to properly get on openSUSE 12.1, unless you get the quick unstable 1-click install for 12.1 from here: http://software.opensuse.org/package/gcc45 - Otherwise, you'll have to build it yourself... which instructions you might find on my signature link.

What would save you a lot of trouble would be to go back to openSUSE 11.4, but I'm assuming that it's not an option. Therefore, here are the steps I've taken to get things built with openSUSE 12.1 Gcc 4.6.2, although I haven't checked for mathematical cohesion:
  1. In root mode:
    Code:

    zypper install git-core
    zypper install -t pattern devel_C_C++
    zypper install cmake libqt4-devel gnuplot

  2. In normal user mode:
    1. Get the software source code:
      Code:

      git clone git://github.com/OpenCFD/OpenFOAM-1.7.x.git
      wget "http://downloads.sourceforge.net/foam/ThirdParty-1.7.1.gtgz?use_mirror=mesh" -O ThirdParty-1.7.1.tgz
      tar -xf ThirdParty-1.7.1.tgz
      mv ThirdParty-1.7.1 ThirdParty-1.7.x

    2. Add this line to your "~/.bashrc" or "~/.alias", as well as run it:
      Code:

      alias of17x='source $HOME/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc WM_NCOMPPROCS=4'
      Adjust the value 4 to the number of cores on your machine.
    3. Prepare things:
      Code:

      of17x
      foam3rdParty

    4. Edit the file "Allwmake" in the "ThirdParty-1.7.x" folder as indicated in bold:
      Code:

      case "$WM_MPLIB" in
      OPENMPI)
          if [ -d "$MPI_ARCH_PATH/lib64" -a ! -d "$MPI_ARCH_PATH/lib" ]; then
              ln -s $MPI_ARCH_PATH/lib64 $MPI_ARCH_PATH/lib
          fi


          if [ -r $MPI_ARCH_PATH/lib/libmpi.so ]
          then

      A bit below:
      Code:

              make -j $WM_NCOMPPROCS
              make install
              make distclean

    5. Run Allwmake in the ThirdParty folder twice:
      Code:

      ./Allwmake > make.log 2>&1
      ./Allwmake > make.log 2>&1

    6. Finally build OpenFOAM:
      Code:

      foam
      ./Allwmake > make.log 2>&1

In case something goes wrong:
Code:

tar -czf make.log.tar.gz make.log
And attach "make.log.tar.gz" to your next post.


Best regards,
Bruno

uli June 7, 2012 09:40

thanks a lot wyldckat!

openSUSE 11.4 is quite an option for me and maybe I will install it, but since I'm almost new to Linux I have some more questions first if you don't mind.

  • What exactly do you mean by mathematical cohesion?
  • What do I have to do at the 3rd point ("prepare things"), just type "of17x" and "foam3rdParty" ?
  • Are there any disadvantages in the way you showed?

best
Uli

wyldckat June 7, 2012 10:42

Hi Uli,

Quote:

Originally Posted by uli (Post 365264)
What exactly do you mean by mathematical cohesion?

Here's an example: several months ago, when OpenFOAM 1.7.0 was released, it was successfully tested and working when built with Gcc 4.3.3 and up to Gcc 4.4.y.
Weeks after OpenFOAM 1.7.0 was released, people started building it with Gcc 4.5.0... and the problem was that it did build with 4.5.0, but then things sometimes didn't work as expected. I vaguely remember about problems when meshing and one solver had problems. You can check the history by reading the following thread: http://www.cfd-online.com/Forums/ope...gcc-4-5-x.html

Therefore, since there is no specific report about OpenFOAM 1.7.x working properly with Gcc 4.6.y, such a study should first be done just to confirm this. I vaguely remember that in OpenFOAM 2.0.x there are a few references to the changes necessary for proper operations with Gcc 4.6.y, but I haven't kept track of them.

Quote:

Originally Posted by uli (Post 365264)
What do I have to do at the 3rd point ("prepare things"), just type "of17x" and "foam3rdParty" ?

Yes, the text was an brief introductory note: of17x activates the environment and foam3rdParty jumps directly into the ThirdParty folder. For more on this: Advanced tips for working with the OpenFOAM shell environment

Quote:

Originally Posted by uli (Post 365264)
Are there any disadvantages in the way you showed?

Like I've been writing: I don't know if this is mathematically stable/coherent. And using the Gcc 4.5 version provided in the unstable packages at software.opensuse.org is another possible source of concern... since it's specifically marked as "unstable"...

So it all sums up to this: if you are using your personal installation of OpenFOAM 1.7.x just for preparing cases, and then run the cases in the school's computers with verified OpenFOAM installations, then I guess it's OK...
Otherwise, you're risking it a bit, since there is a possibility that you might get results with a particular solver that has issues with Gcc 4.6.y...

Best regards,
Bruno

uli June 11, 2012 09:42

hi wyldckat and all!

I now decided to install suse 11.4. which the OF installation worked out with. Till now I only faced a graphics problem with Paraview that I solved by installing another driver for my nvidia graphics chip.

I think although it took me some time this is the best solution to avoid problems due to different versions.

Thanks a lot for your effort!

best
uli


All times are GMT -4. The time now is 02:57.