CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   wmake error for a new viscosity model (

ICL October 27, 2009 12:12

wmake error for a new viscosity model
Hey guyz,

I got the following errors when I tried to compile (wmake) a viscosity model. Everything was fine before with the same change. I don`t really know why I got these errors now:

incompressible]$ wmake
g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I.. -I/home/ahajisha/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/ahajisha/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/ahajisha/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC Make/linux64GccDPOpt/transportModel.o Make/linux64GccDPOpt/singlePhaseTransportModel.o Make/linux64GccDPOpt/viscosityModel.o Make/linux64GccDPOpt/newViscosityModel.o Make/linux64GccDPOpt/Roelands.o Make/linux64GccDPOpt/EyringRoelands.o Make/linux64GccDPOpt/Doolittle.o Make/linux64GccDPOpt/Newtonian.o -L/home/ahajisha/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt \
-lOpenFOAM -liberty -ldl -lm -o OpenFOAM.out
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
Make/linux64GccDPOpt/viscosityModel.o: In function `Foam::fvPatchField<Foam::SymmTensor<double> >::type() const':
viscosityModel.C:(.text._ZNK4Foam12fvPatchFieldINS _10SymmTensorIdEEE4typeEv[Foam::fvPatchField<Foam::SymmTensor<double> >::type() const]+0x3): undefined reference to `Foam::fvPatchField<Foam::SymmTensor<double> >::typeName'
Make/linux64GccDPOpt/viscosityModel.o: In function `Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>::type() const':
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

I would be very grateful if anyone can lead me to the source of the error.

Thanks alot,

mattijs October 27, 2009 13:01

Probably you want to build a library, not an executable. Use 'wmake libso' to build a library. This is not a bug.

ICL October 27, 2009 13:05

I compiled the new viscosity model with wmake and I used to compile it with wmake every time I changed it. This time I only changed a constant value in it and got the above-mentioned error using wmake! I don`t know what is the reason...

ICL October 27, 2009 13:07

I typed wmake in src/transportModels/incompressible by the way. As I mentioned it was fine using wmake for that before.

ICL October 30, 2009 07:44

First of all, that was not a bug ( Sorry for that)
Use of wmake is possible for executable files such as Solvers. There is a library specified to transportmodels/incompressible and that should be updated using wmake libso incompressible in src/transportmodels directory.

TemC March 2, 2017 11:30

1 Attachment(s)
Hi foamers,

I'am working with simpleFoam, and I want to implement a new Herschel-Bulkley model. I have already done all the major steps and modifications required.

Now when I try to execute the command "./Allwmake" in "src/transportModels/", I got the message depicted in the attachment. And even when I use the command "wmake libso incompressible" suggested on this thread, I still have this message. Does anybody know what it may be linked to?

I hope that you will find a couple of minutes to give me a reply. Any contribution will be well aprreciated.

Thanks in advance for your time, and have a nice week.


floquation March 2, 2017 12:52


Originally Posted by TemC (Post 639203)
I hope that you will find a couple of minutes to give me a reply. Any contribution will be well aprreciated.

My French is a little rusty, but a few seconds are enough to find the answer:
It says "impossible to create the repository ... permission denied".
In other words, you do not have writing rights in that directory, which makes a lot of sense as it is the "/opt" directory.

You need to either compile using the super-user account [you probably do not want to do this, especially as there is no reason to modify the original OpenFoam source code], or you should compile your modified code in a directory in which you have writing rights. I usually compile my own modifications in ${FOAM_RUN}/../applications or ${FOAM_RUN}/../libraries.
It'd be a good idea to put your executable in $FOAM_USER_APPBIN, instead $FOAM_APPBIN, as it is a user modification.

TemC March 3, 2017 04:30

Good morning Sir,

Thank you very much for your advices, I will take them into account.


All times are GMT -4. The time now is 10:39.