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

Update 1.7.x from local source

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 6, 2010, 06:23
Question Update 1.7.x from local source
  #1
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Hello FOAMers,

i need an advice for the following issue...
I'll have to administrating some PC's using OpenFOAM without any connection to the internet (at present and in future). But i don't want to miss the update features of 1.*.x-Versions!
What would be the smartest procedure of getting OpenFOAM up-to-date from local source?
I guess https://github.com/OpenCFD/OpenFOAM-...rchives/master is one option where i can download the very latest git repository of the present 1.7.x-Version. But afterwards i'm not sure how to proceed with 'git' using a local device as source!

Thanks in advance for sharing your expertise,
/Stefan
SD@TUB is offline   Reply With Quote

Old   December 6, 2010, 08:45
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Instead of "git pull http://xxx" you should be able to use "git pull user@xxx:/", which pulls the changes from your local copy.
akidess is offline   Reply With Quote

Old   December 7, 2010, 03:18
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by akidess View Post
Instead of "git pull http://xxx" you should be able to use "git pull user@xxx:/", which pulls the changes from your local copy.
Except that I would generally advocate creating a separate branch instead of working on 'master' -- see http://olesenm.github.com/2009/11/12...nFOAM-and-git/ for more infomation.
olesen is offline   Reply With Quote

Old   December 10, 2010, 06:50
Default
  #4
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Thanks Anton and Mark for your hints!
It is seemingly advantageous to get familiar with git, avoiding problems due to administrating.
But nevertheless, i'm insecure to get the right start-up. When I download the latest status from https://github.com/OpenCFD/OpenFOAM-1.7.x und extract the archive, it seems not compatible with getting a clone via
Code:
git clone
. I tried to change the ending from *1.7.x to *1.7.x.git, but that doesn't help unsurprisingly. And initializing the extracted directory via
Code:
git init
is not the setup i'm looking for, right?

Maybe another advice will help me to get the right start-up in that case!
/Stefan

Last edited by SD@TUB; December 10, 2010 at 10:17.
SD@TUB is offline   Reply With Quote

Old   December 11, 2010, 08:47
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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 Stefan,

Given the limited information you gave us, there are three possible scenarios:
  1. You have one machine with Windows and internet access, while the other one is a Linux machine who is disconnected from both the internet and the Windows machine.
  2. Both machines have Linux and git; the one with no internet can access the other one via intranet.
  3. Both machines have Linux and git, but the only way of data transfer is through CD/DVD or USB drive.
So, the short and extreme solutions for each scenario are:
  1. Forget git. Download the gziped tarball from github once in a while, unpack it on the second machine and overwrite the current files. I think there is an option in tar to unpack only the newest files.
  2. This scenario is what Anton and Mark were talking about. For this, read Mark's blog post and the official git tutorial.
  3. This scenario still requires that you read the tutorials from the previous scenario. But in this case, you'll have to read these examples. I got to these examples from the bullet points near the end of the git tutorial:
    Quote:
    Originally Posted by http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
    git-format-patch(1), git-am(1): These convert series of git commits into emailed patches, and vice versa, useful for projects such as the Linux kernel which rely heavily on emailed patches.
    In other words, you'll be emailing to yourself
So there you go, read and learn Otherwise, we can't help you much more, since we don't know in which scenario you are.

Best regards,
Bruno
__________________

Last edited by wyldckat; December 11, 2010 at 08:48. Reason: missed a word...
wyldckat is offline   Reply With Quote

Old   December 12, 2010, 07:42
Default
  #6
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Hello Bruno,

the first scenario was the right guess! So working with the tarball exclusively is a practical way at the very least.
Finally, just to unterstand in depth. The downloadable archive from https://github.com/OpenCFD/OpenFOAM-1.7.x is a (git) clone from the master repository itself? Creating a separate branch such as Mark suggested wouldn't be possible at all?

/Stefan
SD@TUB is offline   Reply With Quote

Old   December 12, 2010, 09:32
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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 Stefan,

Mmm, do you also want to keep a track of the changes in the main git tree?
  • If you do, the only way is to install a Virtual Machine with some Linux distribution installed in it; this VM would be installed in your Windows machine and would be for keeping track of changes only!
    edit: Maintaining a local git repository on a portable disk image file or partition
  • If you don't need to, but if you still need to keep track of the versions you have downloaded, then after the break, are a few instructions on what you can do.
____________________

OK, this is for a tarball based git repository - here's what you can do:
  1. Download the source tarball in tar.gz format: it's this link here
    This is a snapshot of the latest commit into the OpenFOAM 1.7.x git version. This will be completely stripped of the git history of the commits, since it's just a snapshot of the file tree of the latest commit.
  2. Copy the tarball to your Linux system.
  3. Create a folder for source development, where you will keep a clean version of your local git repository. For example: "$HOME/OpenFOAM-git"
  4. Unpack the tarball in that folder. In my case, I ran:
    Code:
    tar -xzf OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52.tar.gz
    It will probably create a long name, like it did for me: "OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52"
    ... so, rename it to OpenFOAM-1.7.x:
    Code:
    mv OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52 OpenFOAM-1.7.x
    By the way, "c7eaf52" is the first part of the commit's unique identifier, which you can then compare online in github.
  5. Now, cd into that folder and run:
    Code:
    git init
    git add .
    git commit
    It will open nano or some other terminal based text editor and it will ask you to write in the message for this commit. I've written:
    Code:
    Source: OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52.tar.gz
    Save and exit. It will commit your new commit into git history.
    And voilá, your local git repository is now ready to be used.
  6. Now, go to your folder where you will use OpenFOAM for building and working with it, e.g.: $HOME/OpenFOAM
  7. Run:
    Code:
    git clone $HOME/OpenFOAM-git/OpenFOAM-1.7.x OpenFOAM-1.7.x
    And there you go, you've got your own local git clone to work with. The rest is just as it is explained in www.openfoam.com.
OK, now when you want to update your local repository:
  1. Same as point 1 of the previous list.
  2. Same as point 2 of the previous list.
  3. Got to your local repository:
    Code:
    cd $HOME/OpenFOAM-git/OpenFOAM-1.7.x
  4. Unpack the new tarball like this:
    Code:
    tar --strip 1 -xzf ../OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52.tar.gz
    This way "--strip 1" will make it unpack without the base long named folder "OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52".
  5. Run:
    Code:
    git add .
    git commit
    Again, it will ask for the commit message, to which you can write the name of the source tarball, just like in point 5 in the previous list.
  6. Now, go into your working folder:
    Code:
    cd $HOME/OpenFOAM/OpenFOAM-1.7.x
  7. Run:
    Code:
    git pull
    And there you go, the code is up to date. You can now run Allwmake to rebuild the changed libraries and applications.
I had this idea a while back, but it's good to write it down, since sooner or later, me or someone else will need it
Any other questions about git, read the tutorials and learn!!

Best regards,
Bruno

PS: I've posted these instructions in my blog here in cfd-online, just in case I need to update the instructions in the future: Maintaining a local git repository from a source tarball
__________________

Last edited by wyldckat; December 12, 2010 at 12:07. Reason: "N" in tar seems pointless and slow when extracting... so I removed from the instructions | 2nd edit: added "PS:" | 3rd edit, see "edit:" :D
wyldckat is offline   Reply With Quote

Old   December 13, 2010, 05:04
Default
  #8
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Thanks a lot Bruno for this instruction! This will help me to proceed with my setup and i'll not have to miss the features of git.

Best Regards,
/Stefan

P.S. I'm learning by doing
SD@TUB is offline   Reply With Quote

Reply

Tags
git, local source, without internet


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
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 04:21.