CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Error compiling OpenFOAM 1.7.x (

uli June 5, 2012 17:51

Error compiling OpenFOAM 1.7.x
hi everybody

I followed the instructions on

but compiling finally gives me


/home/uli/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/ undefined reference to `pthread_create'
/home/uli/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/ 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

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:

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: 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: - 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:

    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:

      git clone git://
      wget "" -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:

      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:


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

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

          if [ -r $MPI_ARCH_PATH/lib/ ]

      A bit below:

              make -j $WM_NCOMPPROCS
              make install
              make distclean

    5. Run Allwmake in the ThirdParty folder twice:

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

    6. Finally build OpenFOAM:

      ./Allwmake > make.log 2>&1

In case something goes wrong:

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

Best regards,

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?


wyldckat June 7, 2012 10:42

Hi Uli,


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:

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.


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


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 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,

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!


All times are GMT -4. The time now is 21:46.