OpenFOAM® Bugs Reporting - Mantis - OpenFOAM
View Issue Details
0000130OpenFOAM[All Projects] Bugpublic2011-02-01 08:222011-07-24 19:21
karamiag 
henry 
normalmajoralways
closedfixed 
LinuxOpenSuse11.3
1.7.x 
 
0000130: missing linked library in interFoam
Compilation of interFoam solver fails claiming
In function `main':
interFoam.C:(.text+0x3a4c): undefined reference to `Foam::interfaceProperties::interfaceProperties(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::IOdictionary const&)'
interFoam.C:(.text+0x7739): undefined reference to `Foam::interfaceProperties::calculateK()'
collect2: ld returned 1 exit status
cd ~/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/interFoam
wmake
It can be solved modifing the two following files:
~/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/interFoam/Make/options
and
~/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options

Adding -linterfaceProperties in the list of EXE_LIBS.
No tags attached.
Issue History
2011-02-01 08:22karamiagNew Issue
2011-02-01 08:56henryNote Added: 0000223
2011-02-01 09:37karamiagNote Added: 0000224
2011-02-01 10:53mattijsNote Added: 0000225
2011-02-01 12:41karamiagNote Added: 0000229
2011-07-24 14:48wyldckatNote Added: 0000590
2011-07-24 19:21henryStatusnew => closed
2011-07-24 19:21henryAssigned To => henry
2011-07-24 19:21henryResolutionopen => fixed

Notes
(0000223)
henry   
2011-02-01 08:56   
This should not be necessary as the twoPhaseInterfaceProperties library already includes a dependency on the interfaceProperties library:

EXE_INC = \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
    -linterfaceProperties \
    -lfiniteVolume

and we have not seen any compilation issue with interFoam on any of our machines running an range of GNU/Linux distributions.
(0000224)
karamiag   
2011-02-01 09:37   
I don't know what to say. This is my options file:
EXE_INC = \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
    -ltwoPhaseInterfaceProperties \
    -lincompressibleTransportModels \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lfiniteVolume

and only adding -linterfaceProperties before -ltwoPhaseInterfaceProperties, I have no compilation errors. This is the output of g++ --version:
g++ (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292]

Could it be a matter of compiler version? For example in the GCC 4.5 Release Notes it is written
"The command-line option -ftemplate-depth-N is now written as -ftemplate-depth=N and the old form is deprecated".
We are using the old form; I'm not saying that because I think this is the problem but only to support my doubts about the compiler.
(0000225)
mattijs   
2011-02-01 10:53   
The libinterfaceProperties.so comes in through libtwoPhaseInterfaceProperties.so (since in LIB_LIBS of twoPhaseInterfaceProperties/Make/options). If I do a

ldd $FOAM_LIBBIN/libtwoPhaseInterfaceProperties.so

I see the dependency (as expected) on libinterfaceProperties.so
(0000229)
karamiag   
2011-02-01 12:41   
~/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt>
ldd libtwoPhaseInterfaceProperties.so

        linux-vdso.so.1 => (0x00007fff25dff000)
        libfiniteVolume.so => /home/tecnici/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libfiniteVolume.so (0x00002afa79c7e000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002afa7ad92000)
        libm.so.6 => /lib64/libm.so.6 (0x00002afa7b09c000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002afa7b2f3000)
        libc.so.6 => /lib64/libc.so.6 (0x00002afa7b50a000)
        libtriSurface.so => /home/tecnici/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libtriSurface.so (0x00002afa7b86a000)
        libmeshTools.so => /home/tecnici/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libmeshTools.so (0x00002afa7bae7000)
        /lib64/ld-linux-x86-64.so.2 (0x00002afa7982a000)
        libdecompositionMethods.so => /home/tecnici/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libdecompositionMethods.so (0x00002afa7bf55000)
        liblagrangian.so => /home/tecnici/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/liblagrangian.so (0x00002afa7c175000)
(0000590)
wyldckat   
2011-07-24 14:48   
Greetings to all!

In an attempt to help out with clearing this bug report, I've tried to recreate it by following a possible scenario with OpenSUSE 11.3 x86_64, as follows:
* make a clean clone;
* checkout the commit 339e3f05691a55f7c0caf20d10dcb7124e1bae38 (a merge right after twoPhaseInterfaceProperties was created).
* make a full build.
* there was a missing fix for foamDebugSwitches, so I checked out a merge after that fix, namely 4e4f90db94e47cc5205b33b6ce74cb55bd125784.
* make another full build without cleaning up.
* A few issues popped up due to various file changes, but none related to interFoam. So I cleaned up only the applications source folder and built again.
* No errors. Did a "git checkout origin" to go forward to the present.
* Built again without any cleaning up.
* No errors whatsoever popped up on this last build (which is astonishing to me, at least with my experience).

So I suggest that this error is closed as some others have been in the past: unable to reproduce.

Best regards,
Bruno