Difference between revisions of "Download Source Code"

From OSUPDOCS
Jump to navigation Jump to search
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page explain how to download source code from the [http://code.google.com/p/nairn-mpm-fea/ <tt>nairn-mpm-fea</tt> project on <tt>googlecode.com</tt>]. The single source code package contains [[NairnMPM]], [[NairnFEA]], and [[NairnFEAMPMViz]]. After this downloading step is completed, you can move on to documentation for [[Compile the Code Engines|compiling the code engines]]. If you are enabled to use [[OSParticulas]], you will get separate instructions for downloading its source code package.
This page explain how to download source code from the [https://github.com/nairnj/nairn-mpm-fea <tt>nairn-mpm-fea</tt> project on <tt>github.com</tt>]. The single source code package contains [[NairnMPM]], [[NairnFEA]], and [[NairnFEAMPMViz]]. After this downloading step is completed, you can move on to documentation for [[Compile the Code Engines|compiling the code engines]]. If you are enabled to use [[OSParticulas]], you will get separate instructions for downloading its source code package.


== Introduction ==
== Introduction ==


You must use Subversion (or <tt>svn</tt>) on your local computer to download the entire <tt>nairn-mpm-fea</tt> project from <tt>googlecode.com</tt>. The <tt>svn</tt> package is available for Mac and Linux as a command-line tool (see http://subversion.tigris.org/ if you need to install it). For Windows, one solution is to [[Compiling in Windows#Installing and Setting Up cygwin|set up <tt>cygwin</tt>]] and use its version of <tt>svn</tt>. In each platform there may by other <tt>svn</tt> options as well, but this page is based on the command-line approach.
You must use <tt>git</tt> on your local computer to clone the entire <tt>nairn-mpm-fea</tt> project from <tt>githib.com</tt>. To download the latest project, you can clone the [https://github.com/nairnj/nairn-mpm-fea nairn-mpm-fea repository] using the following command lines:
 
Once you have <tt>svn</tt> installed, you can either do an [[#Anonymous Checkout|anonymous checkout]] or a [[#Password Enabled Checkout|password enabled check]]. Both these methods listed below get the current main trunk version. To get older versions (in case current main trunk version has issues), you can [[#Checkout Project Versions|checkout a stable prior version instead]]. It is also possible various development versions will be available by [[#Checkout a Branch|checking out a branch]] instead of the main trunk.
 
==Anonymous Checkout==
 
This project is now hosted on [https://github.com/nairnj/nairn-mpm-fea Github]. It was moved there on August 14, 2015 because Google Code terminated development options on August 25, 2015. To download the latest project, you can clone the [https://github.com/nairnj/nairn-mpm-fea nairn-mpm-fea repository] using the following command lines:


  <pre>cd 'Git Projects'
  <pre>cd 'Git Projects'
git clone https://github.com/nairnj/nairn-mpm-fea.git</pre>
git clone https://github.com/nairnj/nairn-mpm-fea.git</pre>


The first line moves to a folder (assumed to be already created) and the second line clones the repository in a new folder called `nairn-fea-mpm` inside the "Git Project" folder.
The first line moves to a folder (assumed to be already created) and the second line clones the repository in a new folder called <tt>nairn-fea-mpm</tt> inside the "Git Project" folder. You are now ready to work with the source code.
You are now ready to work with the source code. You can use other clone methods as well.
 
==Password Enabled Checkout==
 
<font color="red">This section needs updating.</font> It currently refers to the Google Code repository that was made read only by Google on August 25, 2015 and therefore it is no longer possible to contribute changes to that repository. The analogous method for the new [https://github.com/nairnj/nairn-mpm-fea Github project] will be posted soon.
 
If you might want to contribute changes to the <tt>nairn-mpm-fea</tt> project, including changes to documentation or the project's wiki pages, or if you just want to have a visible presence in use of the code, you should checkout with a username and password. But first, you need a password. The process is:
 
# Participating in any <tt>googlecode.com</tt> project requires a google account and a gmail email addess. If you do not have one, you can create one for free at http://www.google.com. If you already have a google account, you can easily add an email address, if needed.
# Email your google gmail address to [mailto:John.Nairn@oregonstate.edu John Nairn] with a request to be a committer (ability to make changes) or a contributer (to be added as a visible user of the code). You will be emailed back when you have been added to the project.
# Once you hear back sign in to your google account and find your profile in the <tt>googlecode.com</tt> section. The "My Profile" tab will show your username (from your gmail address) and the "Settings" tab will show your <tt>googlecode.com</tt> password. Make of note of this generated password, because it is (sometimes) needed for the checkout.
 
These above steps only need to be done once. Once they are done, you can use <tt>svn</tt> to check out a copy of the project with:
 
<pre>svn checkout https://nairn-mpm-fea.googlecode.com/svn/trunk/ nairn-mpm-fea --username YOURUSERNAME</pre>
 
or if SSL connection is not enabled, you can instead use
 
<pre>svn checkout http://nairn-mpm-fea.googlecode.com/svn/trunk/ nairn-mpm-fea --username YOURUSERNAME</pre>
 
Here <tt>nairn-mpm-fea</tt> is the name of the folder that will be created with the checked out code. You can use any name you want. Also <tt>YOURUSERNAME</tt> is the username you obtained in step #3 above. After giving this command, you may need to enter the password from step #3 to finish the checkout.


== Checkout Project Versions ==
It is probably better to clone using the [https://desktop.github.com GitHub Desktop] application, which is available for [[Mac/Windows Requirements|Mac and Windows]].


<font color="red">This section needs updating:</font> it will soon be updated to explain how to get versions from the new [https://github.com/nairnj/nairn-mpm-fea Github project].
==Contributing to the Project==


Occasionally the main trunk or development branches may have issues. To help avoid such issues, various complete releases are tagged and can be [[#Checkout a Tagged Version|checked out]] instead while waiting for main trunk to reach a stable condition. Sometimes while developing, you may need to compare to previous [[#Checkout by Version Number or Date|revision numbers]] or versions on [[#Checkout by Version Number or Date|specific dates]]. Such comparisons can help diagnosis bugs that have been introduced at some point in time.
If you might want to contribute changes to the <tt>nairn-mpm-fea</tt> project, including changes to documentation or the project's wiki pages, or if you just want to have a visible presence in use of the code, you should create your own account on [https://github.com GitHub], fork this project, make changes, and then submit a pull request. More details are given in the [https://help.github.com/articles/fork-a-repo/ GitHub help files].


====Checkout Out a Tagged Version====
==Work on Project Versions and Branches==


To check out a tagged release instead of the current development release, simply change the path in the checkout command. For example, an anonymous check out would be:
When using Git, you have a complete copy on the <tt>nairn-mpm-fea</tt> repository. You can use standard Git methods to "checkout" the version or branch you want to work on. The details can be found in Git documentation.


<pre>svn checkout http://nairn-mpm-fea.googlecode.com/svn/tags/release-1.0 nairn-mpm-fea-1.0</pre>
==Accessing Project Versions on Google Code==


where the final component in the path is the version you want. See [[Tagged Versions]] for a list of available tagged releases.
You can still check out old version of this project that used be stored on google code, but you have to create you own svn repository and load in the old google code repository. The steps are:


====Checkout by Version Number or Date====
# Go to  google code archive (if still there) at [https://code.google.com/archive/p/nairn-mpm-fea/source/default/source https://code.google.com/archive/p/nairn-mpm-fea/source/default/source]
# Find link to download the source code. Load that URL into browser window, but change the last item from <tt>source-archive.zip</tt> to <tt>repo.svndump.gz</tt> and download that file (a repository dump file).
# Create a new folder (such as in your home directory called "Repositories" and copy <tt>repo.svndump.gz</tt> to that folder.
# Using Terminal app (for Mac) navigate to "Repositories" folder and enter following commands


In addition to tagged versions, you can revert to any revision number or to the version on any date with the follow check out commands:
<pre>gunzip repo.svndump.gz
svnadmin create nairn-mpm-fea
svnadmin load nairn-mpm-fea < repo.svndump
</pre>


<pre>svn checkout --revision 185 http://nairn-mpm-fea.googlecode.com/svn/trunk nairn-mpm-fea-185
The first line unzips the downloaded file. The second creates and empty <tt>SVN</tt> repository, and the last fills is with the google code respository. You can not check out an revision of this very old code using
svn checkout --revision {2010-05-11} http://nairn-mpm-fea.googlecode.com/svn/trunk \
                            nairn-mpm-fea-2010-05-11</pre>


Every change to the code makes a new revision number. You can look up revision numbers in the "Source" tab on http://code.google.com/p/nairn-mpm-fea. A checkout by date means the revision that was current on that date. You can add a time if several revisions were made that day. When an <tt>svn</tt> checkout by date finishes, it will report the revision number that you received. Using revision number when looking for changes is more efficient because you are sure things changed. Checking out versions on different dates will give identical code if no changes were made between those dates. Furthermore, many revisions differ only in comments or documentation and not in source code. Here is a [[Unique_MPM_Revisions |partial list]] that can be used to locate which revisions changed the source code.
If you ever need to check out old versions from the previous code location on google code, you can use


==Working with Branches ==
<pre>svn checkout --revision 600  file:///(full path to Repositories folder)/nairn-mpm-fea/trunk NFM_REV_677
</pre>


When you clone the [https://github.com/nairnj/nairn-mpm-fea Github project], you have a complete copy of the `nairn-mpm-fea` project repository. You can use standard Git method to choose which branch to work on. You can also easily create your own branches. You can refer to Git documentation for details.
This option checks out a specific revision number and saves it to folder "rev-677". Change those terms for the revision and folder name you want. Note that to download, compile, and run revisions prior to revision 274, you may would need to revert to old versions of <tt>Xerces</tt> (version 2.7.x) as well.

Latest revision as of 13:50, 25 April 2021

This page explain how to download source code from the nairn-mpm-fea project on github.com. The single source code package contains NairnMPM, NairnFEA, and NairnFEAMPMViz. After this downloading step is completed, you can move on to documentation for compiling the code engines. If you are enabled to use OSParticulas, you will get separate instructions for downloading its source code package.

Introduction

You must use git on your local computer to clone the entire nairn-mpm-fea project from githib.com. To download the latest project, you can clone the nairn-mpm-fea repository using the following command lines:

cd 'Git Projects'
git clone https://github.com/nairnj/nairn-mpm-fea.git

The first line moves to a folder (assumed to be already created) and the second line clones the repository in a new folder called nairn-fea-mpm inside the "Git Project" folder. You are now ready to work with the source code.

It is probably better to clone using the GitHub Desktop application, which is available for Mac and Windows.

Contributing to the Project

If you might want to contribute changes to the nairn-mpm-fea project, including changes to documentation or the project's wiki pages, or if you just want to have a visible presence in use of the code, you should create your own account on GitHub, fork this project, make changes, and then submit a pull request. More details are given in the GitHub help files.

Work on Project Versions and Branches

When using Git, you have a complete copy on the nairn-mpm-fea repository. You can use standard Git methods to "checkout" the version or branch you want to work on. The details can be found in Git documentation.

Accessing Project Versions on Google Code

You can still check out old version of this project that used be stored on google code, but you have to create you own svn repository and load in the old google code repository. The steps are:

  1. Go to google code archive (if still there) at https://code.google.com/archive/p/nairn-mpm-fea/source/default/source
  2. Find link to download the source code. Load that URL into browser window, but change the last item from source-archive.zip to repo.svndump.gz and download that file (a repository dump file).
  3. Create a new folder (such as in your home directory called "Repositories" and copy repo.svndump.gz to that folder.
  4. Using Terminal app (for Mac) navigate to "Repositories" folder and enter following commands
gunzip repo.svndump.gz
svnadmin create nairn-mpm-fea
svnadmin load nairn-mpm-fea < repo.svndump

The first line unzips the downloaded file. The second creates and empty SVN repository, and the last fills is with the google code respository. You can not check out an revision of this very old code using

If you ever need to check out old versions from the previous code location on google code, you can use

svn checkout --revision 600  file:///(full path to Repositories folder)/nairn-mpm-fea/trunk NFM_REV_677

This option checks out a specific revision number and saves it to folder "rev-677". Change those terms for the revision and folder name you want. Note that to download, compile, and run revisions prior to revision 274, you may would need to revert to old versions of Xerces (version 2.7.x) as well.