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/)
-   -   Problem with compiling my boundary conditions (http://www.cfd-online.com/Forums/openfoam-solving/59108-problem-compiling-my-boundary-conditions.html)

peita February 14, 2008 12:06

Hello, I am trying to write ad
 
Hello, I am trying to write adjoint boundary condions, I started with easy outlet boundary condition for pressure but I have problem with compiling my code. I made my Make with options
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
-ltriSurface \
-lmeshTools

and files
myAdjointBoundaryFvPatchScalarField.C

LIB = $(FOAM_LIBBIN) /libfiniteVolume

it wrotes

peita@linux-note:~/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/fields/fvPatchFields/derived/myAdjoi ntBoundary> wmake
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: warning: overriding commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:165: warning: ignoring old commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: warning: overriding commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: warning: ignoring old commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:191: warning: overriding commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: warning: ignoring old commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: warning: overriding commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:165: warning: ignoring old commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: warning: overriding commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: warning: ignoring old commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:191: warning: overriding commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
/home/peita/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: warning: ignoring old commands for target `/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt'
g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/peita/OpenFOAM/OpenFOAM-1.4.1/src/triSurface/lnInclude -I/home/peita/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -I/home/peita/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/peita/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -IlnInclude -I. -I/home/peita/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o -L/home/peita/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt \
-lOpenFOAM -ldl -lm -o OpenFOAM.out
/usr/lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `__tcf_4':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x13): undefined reference to `Foam::fvPatchField<double>::destroydictionaryCons tructorTables()'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `__tcf_3':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x33): undefined reference to `Foam::fvPatchField<double>::destroypatchMapperCon structorTables()'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `__tcf_2':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x53): undefined reference to `Foam::fvPatchField<double>::destroypatchConstruct orTables()'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `__static_initialization_and_destruction_0(int, int)':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x3b81): undefined reference to `Foam::fvPatchField<double>::constructpatchConstru ctorTables()'
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x3b90): undefined reference to `Foam::fvPatchField<double>::patchConstructorTable Ptr_'
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x3bca): undefined reference to `Foam::fvPatchField<double>::constructpatchMapperC onstructorTables()'
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x3bd9): undefined reference to `Foam::fvPatchField<double>::patchMapperConstructo rTablePtr_'
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x3c13): undefined reference to `Foam::fvPatchField<double>::constructdictionaryCo nstructorTables()'
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x3c22): undefined reference to `Foam::fvPatchField<double>::dictionaryConstructor TablePtr_'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `Foam::fvPatchField<double>::type() const':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text._ZNK4Foam12fvPatchFieldIdE4typeEv[Foam::fvPatchField<double>::type() const]+0x11): undefined reference to `Foam::fvPatchField<double>::typeName'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `Foam::fixedValueFvPatchField<double>::type() const':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text._ZNK4Foam22fixedValueFvPatchFieldIdE4typeEv[Foam::fixedValueFvPatchField<d ouble>::type() const]+0x11): undefined reference to `Foam::fixedValueFvPatchField<double>::typeName'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `Foam::fixedValueFvPatchField<double>::gradientBou ndaryCoeffs() const':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text._ZNK4Foam22fixedValueFvPatchFieldIdE22gradie ntBoundaryCoeffsEv[Foam::fixed ValueFvPatchField<double>::gradientBoundaryCoeffs( ) const]+0x2a): undefined reference to `Foam::fvPatch::deltaCoeffs() const'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `Foam::fixedValueFvPatchField<double>::gradientInt ernalCoeffs() const':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text._ZNK4Foam22fixedValueFvPatchFieldIdE22gradie ntInternalCoeffsEv[Foam::fixed ValueFvPatchField<double>::gradientInternalCoeffs( ) const]+0x24): undefined reference to `Foam::fvPatch::deltaCoeffs() const'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `Foam::fvPatchField<double>::snGrad() const':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text._ZNK4Foam12fvPatchFieldIdE6snGradEv[Foam::fvPatchField<double>::snGrad() const]+0x21): undefined reference to `Foam::fvPatch::deltaCoeffs() const'
Make/linuxGccDPOpt/myAdjointBoundaryFvPatchScalarField.o: In function `Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<foam::geometric field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const':
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text._ZNK4Foam14objectRegistry12lookupObjectINS_1 4GeometricFieldINS_6VectorIdEE NS_12fvPatchFieldENS_7volMeshEEEEERKT_RKNS_4wordE[Foam::GeometricField<foam::vec tor<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<foam::geometric field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const]+0x150): undefined reference to `Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>::typeName'
myAdjointBoundaryFvPatchScalarField.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text._ZNK4Foam14objectRegistry12lookupObjectINS_1 4GeometricFieldINS_6VectorIdEE NS_12fvPatchFieldENS_7volMeshEEEEERKT_RKNS_4wordE[Foam::GeometricField<foam::vec tor<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<foam::geometric field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const]+0x303): undefined reference to `Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>::typeName'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1


And when I try to use wmake in finiteVolume it also throws some errors
No rule to make target `myAdjointBoundaryFvPatchScalarField.C', needed by `myAdjointBoundaryFvPatchScalarField.dep'. Stop.

I tried to find some answer here on forum but I was not succesful.
Thank you for any help, Petr.

braennstroem February 15, 2008 06:27

Hi Petr, I am actually kind
 
Hi Petr,

I am actually kind of curious, how the lines of code look alike ... this might help the others helping you as well :-)
I wonder, if you wrote the condition from scratch or did you adjust any of the existing boundary conditions, like the convective outlet for example?

Greetings!
Fabian

mbeaudoin February 16, 2008 11:38

Hi Petr, Try "wmake libso"
 
Hi Petr,

Try "wmake libso" instead. But before doing so, read the rest of this message.

"wmake" is for compiling and linking applications.

"wmake libso" is for compiling and linking dynamically linked libraries, like libfiniteVolume.so.

Be aware though that from the information you gave in your message, you are currently trying to overwrite the $(FOAM_LIBBIN)/libfiniteVolume, which, as you could find out, is not such a great idea.

Instead, in your "files" file, try to change
LIB = $(FOAM_LIBBIN) /libfiniteVolume
to something like
LIB = $(FOAM_LIBBIN) /my_libfiniteVolume
in order to avoid overwriting your main libfiniteVolume library.

Otherwise, simply add myAdjointBoundaryFvPatchScalarField.C to the list of files in $FOAM_SRC/finiteVolume/Make/files, and do a "wmake libso" from $FOAM_SRC/finiteVolume in order to recompile this library with your additional code.

Martin

peita February 20, 2008 07:55

Hello, thank you for your repl
 
Hello, thank you for your reply.

I have succesfully compiled my b.c., but only with my own Make, when I added my code to $FOAM_SRC/finiteVolume it did not work, with error message:
make: *** No rule to make target `/derived/myAdjointboundary/myAdjointBoundaryfvPatchScalarField.dep', needed by `Make/linux64GccDPOpt/dependencies'. Stop.

Do anyone know what is going on?

Maybe it doesn't matter.

I linked my .so using userFoam, but I can't still make simpleFoam to see my b.c. it always tries to use default instead.

So, don't you know what to do? (I've read many post here, but with no help).

Thanks.

peita February 21, 2008 09:48

Hello, it seems that I finally
 
Hello, it seems that I finally linked it right. Now I have some more problems. When I run simpleFoam (with code changes) it writes:

--> FOAM FATAL IO ERROR : keyword U is undefined in dictionary "/home/peita/OpenFOAM/OpenFOAM-1.4.1/tutorials/simpleFoam/pitzDaily/0/q::outlet"

file: /home/peita/OpenFOAM/OpenFOAM-1.4.1/tutorials/simpleFoam/pitzDaily/0/q::outlet from line 39 to line 39.

From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 146.

FOAM exiting

Can't anyone guess what is wrong?

Thank you, Petr Simanek.

zhaozhenkai October 6, 2015 09:16

Hi, peita,

I have got the same problem as well.
make: *** No rule to make target `/derived/myAdjointboundary/myAdjointBoundaryfvPatchScalarField.dep', needed by `Make/linux64GccDPOpt/dependencies'. Stop.

Can you tell me how did you solve that? Thanks.


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