CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Compilation problem after modifying a solver. (http://www.cfd-online.com/Forums/openfoam-solving/68773-compilation-problem-after-modifying-solver.html)

PetSul October 1, 2009 07:12

Compilation problem after modifying a solver.
 
Hello,

I bumped into a following problem: I tried to compile a solver which made on an standard solver chtMultiRegionFoam. I copied the solver with a different name, made the changes to the solver as well as in the Make diretory etc, then removed old dependency and object files by using wclean and the tried to compile it by using wmake. It gives the following message:

Making dependency list for source file regionProperties/regionProperties.C
Making dependency list for source file derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
Making dependency list for source file derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField .C
Making dependency list for source file fluid/compressibleCourantNo.C
Making dependency list for source file metsoFoam.C
SOURCE=regionProperties/regionProperties.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 -Ifluid -Isolid -IregionProperties -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/meshTools/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/basic/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/compressible/turbulenceModel -IlnInclude -I. -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/regionProperties.o
/usr/local/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux64/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.3.3/cc1plus: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory
make: *** [Make/linux64GccDPOpt/regionProperties.o] Error 1

Then I tried the following: I just copied chtMultiRegionFoam with new name, then applied wclean, made the changes in the Make directory and also renamed the chtMultiRegion.C but didn't change anything inside the solver itselfand then applied wmake. And again it gives a similar error:

Making dependency list for source file regionProperties/regionProperties.C
Making dependency list for source file derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
Making dependency list for source file derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField .C
Making dependency list for source file fluid/compressibleCourantNo.C
Making dependency list for source file NEWchtMultiRegionFoam.C
SOURCE=regionProperties/regionProperties.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 -Ifluid -Isolid -IregionProperties -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/meshTools/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/basic/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/compressible/turbulenceModel -IlnInclude -I. -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/regionProperties.o
/usr/local/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux64/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.3.3/cc1plus: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory
make: *** [Make/linux64GccDPOpt/regionProperties.o] Error 1

Does anyone have any idea how to fix this?

Regards,

Petri

linnemann October 1, 2009 09:10

Hi

GCC is unable to find libmpfr.so.1

so in you .bashrc file add the following entry

export LD_LIBRARY_PATH=/path-to-folder-containing-libmpfr.so.1:$LD_LIBRARY_PATH

to locate libmpfr.so.1 use

find /search-path/ -name 'libmpfr.so.1'

where libmpfr.so.1 usually is located in /usr if it cant find it in /usr try just / as the path.

If it still cant locate libmpfr.so.1 you need to install mpfr or build it from source.

Regards

olwi October 1, 2009 17:28

Hi,

My guess is that you don't HAVE the mpfr library installed. Messing with paths wont help you then.

Start the package manager of your Linux distribution, and look for the mpfr package. Install it. Then try again. In OpenSUSE 10.3, for example, this action is both necessary and sufficient. No other fix required.

Good luck,

Ola


All times are GMT -4. The time now is 23:17.