CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Add $WM_PROJECT_USER_DIR in .dep files

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2015, 06:18
Default Add $WM_PROJECT_USER_DIR in .dep files
  #1
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hi everyone

I have been developping some libraries, and I have included the *.H file in some other elements, in order to use their content. I am moving these libraries to other computer, but since I have declared all the paths with $WM_PROJECT_USER_DIR, $FOAM_USER ... I thought I should have no problem.

But once I compile again in the 2nd computer, it gives an error, it can't make target the folder of the previous instalation. So I check the *.dep file and I get all the dependencies of the files, ie:
Code:
$(WM_PROJECT_DIR)/src/...
But, when there is a dependencie with my own libraries, instead of having
Code:
$(WM_PROJECT_USER_DIR)/src/...
I get
Code:
all_the_path_to_OF_user/src/...
So now I am wondering if there is a possibility to get the path by using the enviromental variable. You could think "clean and compile", but now it's not an option.


Do you have any idea about how to do this?


Thanks in advance!
agustinvo is offline   Reply With Quote

Old   May 21, 2015, 16:07
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Agustín,

The ".dep" files are generated by wmake whenever needed. The content of these files should have all paths fully expanded and no environment variables should appear in them.

I'm having trouble figuring out from your description where exactly you're using the environment variables. Can you provide an example of the files you've modified and how you've defined the environment variables? I ask this because it would make it a lot easier to diagnose the problem.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 22, 2015, 03:34
Default
  #3
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hello wyldckat,

here I attach a part of the options file:
Code:
EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels \
    -I$(WM_PROJECT_USER_DIR)/src/turbulenceModels/incompressible/turbulenceModel \

and here you have the .dep file I have

Code:
derivedFvPatchFields/wallFunctions/epsilontWallFunctions/epsilontLowReManservisiWallFunction/epsilontLowReManservisiWallFunctionFvPatchScalarField.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/sphericalTensorFieldField.H
derivedFvPatchFields/wallFunctions/epsilontWallFunctions/epsilontLowReManservisiWallFunction/epsilontLowReManservisiWallFunctionFvPatchScalarField.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/sphericalTensorFieldField.C
derivedFvPatchFields/wallFunctions/epsilontWallFunctions/epsilontLowReManservisiWallFunction/epsilontLowReManservisiWallFunctionFvPatchScalarField.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tensorFieldField.C
derivedFvPatchFields/wallFunctions/epsilontWallFunctions/epsilontLowReManservisiWallFunction/epsilontLowReManservisiWallFunctionFvPatchScalarField.dep: $(WM_PROJECT_DIR)/src/finiteVolume/lnInclude/calculatedFvPatchFields.H
derivedFvPatchFields/wallFunctions/epsilontWallFunctions/epsilontLowReManservisiWallFunction/epsilontLowReManservisiWallFunctionFvPatchScalarField.dep: /students/rm_13_14/villaortiz/OpenFOAM/villaortiz-2.3.1/src/turbulenceModels/incompressible/turbulenceModel/turbulenceThermalModel.H
derivedFvPatchFields/wallFunctions/epsilontWallFunctions/epsilontLowReManservisiWallFunction/epsilontLowReManservisiWallFunctionFvPatchScalarField.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/addToRunTimeSelectionTable.H
If I am not wrong, $WM_PROJECT_USER_DIR is already defined in OpenFOAM as well as $WM_PROJECT_DIR. For this reason I was expecting to have also an environment variable.
agustinvo is offline   Reply With Quote

Old   May 24, 2015, 09:20
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi agustinvo,

Quote:
Originally Posted by agustinvo View Post
If I am not wrong, $WM_PROJECT_USER_DIR is already defined in OpenFOAM as well as $WM_PROJECT_DIR. For this reason I was expecting to have also an environment variable.
From the information you've provided, it seems that everything is working as you want it to work.
What you might not yet have noticed is that the "*.dep" files will be reconstructed automatically by wmake. For example:
  1. In computer A, you built your library like this:
    Code:
    wmake libso
  2. Then you copied the whole source code folder of the library to computer B.
  3. The correct step is to now run the following commands for building your library on computer B:
    Code:
    wclean libso
    wmake libso
    1. The first command will remove all intermediate build files (including the "*.dep" files);
    2. and the second one will generate all of the necessary intermediate files (including the "*.dep" files) and build the library.
Technically, you should run wclean before copying the source code, so that it will only copy the necessary files.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open old mesh cmdb files in ANSYS CFX v13.0 ? Sudharshani CFX 2 May 12, 2013 22:13
Compiled library vs. inInclude Files, DSMC solver crashes after run GPesch OpenFOAM Programming & Development 8 April 18, 2013 07:17
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51
[making animations] fclose fails to close files? Mika FLUENT 0 March 30, 2001 08:19
Merging .msh files in TGrid Raza Mirza FLUENT 2 January 18, 2001 18:09


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