CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   wmake turns evil ???!!! (https://www.cfd-online.com/Forums/openfoam-bugs/78035-wmake-turns-evil.html)

marupio July 10, 2010 16:05

wmake turns evil ???!!!
 
wmake has suddenly decided to randomly delete my source files when compiling. It happens during the wmakeLnInclude. Good thing I have backups! Here's the output:

dave@Bruce:~/OpenFOAM/dave-1.5-dev/src/PhD$ wmake libso
wmakeLnInclude: linking include files to /home/dave/OpenFOAM/dave-1.5-dev/src/PhD/lnInclude
ln: creating symbolic link `./multiSolverInit.H': File exists
ln: creating symbolic link `./setSolverDomain.H': File exists
ln: creating symbolic link `./endMultiSolver.H': File exists
ln: creating symbolic link `./multiSolverSetControls.C': File exists
ln: creating symbolic link `./multiSolver.H': File exists
ln: creating symbolic link `./createMultiSolver.H': File exists
ln: creating symbolic link `./multiSolverSetInitialSolverDomain.C': File exists
ln: creating symbolic link `./multiSolverTimeFunctions.C': File exists
ln: creating symbolic link `./multiSolverI.H': File exists
ln: creating symbolic link `./multiSolver.C': File exists
ln: creating symbolic link `./multiSolverSetNextSolverDomain.C': File exists
Making dependency list for source file admScalar/admScalar.C
Making dependency list for source file buoyantPressure/buoyantPressureFvPatchScalarField.C
Making dependency list for source file dummyControlDict/dummyControlDict.C
make: *** No rule to make target `multiSolver/multiSolver.dep', needed by `Make/linux64GccDPOpt/dependencies'. Stop.
make: *** Waiting for unfinished jobs....
dave@Bruce:~/OpenFOAM/dave-1.5-dev/src/PhD$

Every file that failed with ln (file exists) is deleted... mercilessly. (No name.H~ to save the day)

The files getting deleted I haven't touched for about a week, and have survived a wmake libso since then. All I did was add another couple of sources (none of the deleted files) to the library, and execute wmake libso. I frequently am adding sources to the library, the only difference I can think of is these ones are 2 directories deep, as opposed to one.

Any ideas?

wyldckat July 10, 2010 17:13

Greetings David,

Uhm, are you by any chance putting the real files directly in lnInclude? Because lnInclude is a temporary folder, mainly for symbolic links to the headers, and meant for making it easier for wmake to build the desired binary!

Best regards,
Bruno

marupio July 10, 2010 18:43

Good idea... but no. The problem even occurs after deleting lnInclude, and the .dep, all the Make/linux directories.

wyldckat July 11, 2010 06:50

Hmm... that is strange... can you post the contents of the file Make/files? There should be a logical reason for wmake to go postal :rolleyes:

edit: it would also be good to know what the file Make/options has inside it!

olesen July 11, 2010 08:15

Quote:

Originally Posted by marupio (Post 266739)
wmake has suddenly decided to randomly delete my source files when compiling. It happens during the wmakeLnInclude. Good thing I have backups! Here's the output:

dave@Bruce:~/OpenFOAM/dave-1.5-dev/src/PhD$ wmake libso
wmakeLnInclude: linking include files to /home/dave/OpenFOAM/dave-1.5-dev/src/PhD/lnInclude
ln: creating symbolic link `./multiSolverInit.H': File exists
ln: creating symbolic link `./setSolverDomain.H': File exists
ln: creating symbolic link `./endMultiSolver.H': File exists
ln: creating symbolic link `./multiSolverSetControls.C': File exists
ln: creating symbolic link `./multiSolver.H': File exists
ln: creating symbolic link `./createMultiSolver.H': File exists
...

You can use "wmakeLnInclude -f" to force an update of the linked files.


Quote:

Originally Posted by marupio (Post 266739)
Making dependency list for source file dummyControlDict/dummyControlDict.C
make: *** No rule to make target `multiSolver/multiSolver.dep', needed by `Make/linux64GccDPOpt/dependencies'. Stop.
make: *** Waiting for unfinished jobs....

This could be that you reference multiSolver.C in a Make/files, but this file does not actually exist (any more).

marupio July 11, 2010 14:34

Quote:

Originally Posted by olesen (Post 266772)
This could be that you reference multiSolver.C in a Make/files, but this file does not actually exist (any more).

multiSolver.C must be getting deleted before this point. Here is my Make/files:

buoyantPressure/buoyantPressureFvPatchScalarField.C
admScalar/admScalar.C
dummyControlDict/dummyControlDict.C
multiSolver/multiSolver.C
multiTimeInstant/multiTimeInstant.C
timeCluster/timeCluster.C
timeCluster/timeClusterList.C
// equation/equationMaster/equationMaster.C
// equation/equation/equation.C
// equation/equationOperation/equationOperation.C
// admScalar/admScalarList.C

LIB = $(FOAM_USER_LIBBIN)/libPhD

And here is my Make/options:

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

LIB_LIBS = \
-lfiniteVolume

marupio July 11, 2010 17:53

Problem found
 
It was a file name collision.

PhD
|-timeCluster
|-Make
|-multiSolver
|-multiSolver_beforeChanges
|-multiSolver_bak
'-tuple2lists

I had copied the multiSolver directory to another name to archive some changes I was making. When wmakeLnInclude runs, it deletes all the duplicate source files in all directories, leaving only one copy... in my case, it left me the "multiSolver_beforeChanges" files.

Once I got rid of the archive directories, wmake started behaving again.

I'm thinking that's a pretty poor fail mode for a file name collision!

gaza August 16, 2016 05:47

Hi Wyldcat,
During the compilation I have the following message:

wmakeLnInclude: linking include files to ./lnInclude
ln: failed to create symbolic link `./Lee.H': File exists
ln: failed to create symbolic link `./Lee.C': File exists

Is it wrong or it does not matter?

wyldckat August 20, 2016 16:37

Quote:

Originally Posted by gaza (Post 614190)
wmakeLnInclude: linking include files to ./lnInclude
ln: failed to create symbolic link `./Lee.H': File exists
ln: failed to create symbolic link `./Lee.C': File exists

Is it wrong or it does not matter?

Quick answer: That seems to indicate that you placed real files inside the folder "lnInclude".
This "lnInclude" folder is meant to be used for symbolic links only, therefore if that message is being given, then you better double-check if those files are meant to be there on purpose or if they were accidentally moved into that folder.

Is this message showing up with any particular community contribution (namely, source code made available online) or is it code that you're creating yourself?
I ask this because if it's from something shared online, then we need to review the code with the respective authors, in order to fix this.

gaza August 21, 2016 14:43

Hi wyldcat,
This is my source code. This situation appeared when:
1) firstly I compiled Lee.C and Lee.H files using wmake
2) then I deleted Lee files and compiled other anotherModel.C and andotherModel.H files
3) finally I came back to Lee model and deleted anotherModel files
after step 3 the message I mentioned in my post appeared, namely
wmakeLnInclude: linking include files to ./lnInclude
ln: failed to create symbolic link `./Lee.H': File exists
ln: failed to create symbolic link `./Lee.C': File exists

So I did not copy Lee files into lnInclude directory. How to remove this massage?


All times are GMT -4. The time now is 00:05.