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

Question regarding building/compiling OF codes, using wmake

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 3, 2012, 08:33
Default Question regarding building/compiling OF codes, using wmake
  #1
New Member
 
Traib
Join Date: Sep 2012
Posts: 27
Rep Power: 13
Traib is on a distinguished road
Hi,

I made some changes to the original codes in /opt directory, but when running an application it doesnot 'see' the changes and simply runs as originally programmed. So I am trying to use wmake command since that's what I think I should be doing but its says the 'linuxGCcDPopt' folder is missing, which means there's a lot more to do tahn simply change the codes.

I do not have much programming knowledge or experience so this is kind of complicated for me. Anyone please explain how this works? As I understand it wmake that I should use but there must be some files I must create to let the application know where the changes have been made and what other places are affected by the changes....???

If there's a certain method that I need to follow please explain, it would really be a great help...
Traib is offline   Reply With Quote

Old   December 3, 2012, 16:37
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 Traib,

The go-to tutorial I usually point people to is this one: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

The idea is to make a copy of the original code to a personal folder and then make the necessary modifications, so that the modified application will not collide with the original one.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 4, 2012, 02:48
Default
  #3
New Member
 
Traib
Join Date: Sep 2012
Posts: 27
Rep Power: 13
Traib is on a distinguished road
Hi Bruno, thanks for the reply.

Actually I am making changes to the thermophysicalModels in the src directory. So I am confused about whether the method for creating an application is similar to making a library... ???

I was trying to use wmake by creating a folder Make inside the subdirectories where I make the changes since yesterday but it doesn't work (I checked the userguide and this method was explained there). Sorry if its stupid...

Anyways, now I am trying the method you suggested, but can you please tell me whether its right to built libraries in the same way???

Thanks again.
Traib is offline   Reply With Quote

Old   December 4, 2012, 03:53
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
For building libraries, you should use "wmake libso".

It is good practice not to change things in the original 'src', but copy the files first, and compile it into a different library into the user folder ($FOAM_USER_APPBIN, or _LIBBIN) with a different name (in Make/files). Only when that compiles, you should start making the changes.
Bernhard is offline   Reply With Quote

Old   December 4, 2012, 08:48
Default
  #5
New Member
 
Traib
Join Date: Sep 2012
Posts: 27
Rep Power: 13
Traib is on a distinguished road
Hi Bernhard,

I tried compiling the changed files into a user library using 'wmake libso' as you suggested, but it seems there are a lot of header files included that i have to copy into the user directory and recompile into the user library. So I am now trying to find all the dependent and affected files. Right now it all seems too complex.

I have built an application by modifying reactingFoam following the steps provided in the document that Bruno suggested earlier, and it worked. But building libraries seems to be a problem.

Actually I am trying to modify the transport, reaction and janafThermo source codes but apparently its not as straight forward as I thought. Has anyone already done similar work already?? Please let me know, it would be very helpful.

Thanks.
Traib is offline   Reply With Quote

Old   December 4, 2012, 08:50
Default
  #6
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
There is no need to copy all the files, as you can link them within Make/options (see any of these as an example). If you study a few of the options-files in any directory, you should get an idea of what you need there.
Bernhard is offline   Reply With Quote

Old   December 4, 2012, 08:59
Default
  #7
New Member
 
Traib
Join Date: Sep 2012
Posts: 27
Rep Power: 13
Traib is on a distinguished road
Thanks for the quick reply,
I did check the Make/option files from some directories but the problem is when I try to link the modified code with those in he original directories, the compilation shows error regarding the "redefinitions" of the functions inside the file that I am compiling. Apparently the new name that I choose for the copied code is not recognized by the codes that it is linked to...
Traib is offline   Reply With Quote

Old   December 4, 2012, 16:35
Default
  #8
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 to all!

@Traib: It starts to get a bit complicated along the way. Certain libraries cannot simply be copied-changed and be ready to work.

I think the quickest way to do things right is to do your own full build of OpenFOAM, leaving the original the way it is on "/opt". At least until you start to understand how OpenFOAM does things.

I don't know which Linux Distribution you're using, so I can only give you the general directions:
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 5, 2012, 04:58
Default
  #9
New Member
 
Traib
Join Date: Sep 2012
Posts: 27
Rep Power: 13
Traib is on a distinguished road
Hi Bruno,

I am using ubuntu 12.04 in my windows laptop with virtualbox for testing my codes and cases (in case I mess up things badly, I can simply back up my files and reinstall the whole thing ) and to run full simulations I am using a supercomputer running on 12.04 LTS on which I do not make changes until I am certain about what I am doing.

I followed Bernard's comment and started building all the linked codes yesterday, and I think I ended-up doing something like what you have suggested. I copied the whole thermophysicalModels directory to user directory and compiled it with necessary modifications into a user library. It built the libraries (without changing their names) and now I have new Thermo files, though with the same names as the original versions. I tried a test case with reactingFoam and it seems to have no interference due to the new library files.

However, now I am trying to find out how the solver will make the distinctions between the old and new thermo files that are in two different locations. I checked rhoReactingFoam solver files and found Make/options.txt file where these libraries are defined, and my guess is that is where I make the changes. So I am defining them for every solver I use and try...

Thanks for the links, I am checking them now, and thanks a lot for your help.
Traib is offline   Reply With Quote

Reply

Tags
building, compiling, wmake


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
Unanswered question niklas OpenFOAM 2 July 31, 2013 16:03
Problem of compilation OF 14Allwmake command not found erik_d OpenFOAM Bugs 13 September 13, 2008 21:45
OpenFOAM 14 for WindowstmCygwin pvita OpenFOAM Installation 117 August 9, 2008 06:54
[OpenFOAM] ParaFoam error message joey ParaView 1 October 2, 2006 13:28
question K.L.Huang Siemens 1 March 29, 2000 04:57


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