patch files are generally minor corrections to a large code base which is written after the release of a version.
For example, VASP team has released patch #1 and #2 after the release of its recent version. What is the use of these patch#1 and patch #2? There may by small bugs that may have been solved. Or very minor correction to the code might have been implemented.
To know what the patch file, you need to look in to the individual patch file. These patch files are obtained by "diff" command in Linux.
Let me demonstrate how patch files are created.
Suppose following is the code that is already used by users.
=============================
program print1
implicit none
print *, "Hello World"
end program
=============================
Now, users can run this program and get "Hello World" at the terminal.
Now, if I want to update to code as follow.
=============================
program print2
implicit none
print *, "Hello World, Let us Learn to use VASP"
end program
============================
Now, if I want to update the code the code, I don't need to send all the codes in the file print2. Instead, I can use "diff" command and save the results in a file called patch. See the demonstration below.
:~/Coding/Fortran/Patch$ diff print1.f90 print2.f90 > patch
Now, what ever difference between the two files will be saved in patch. Let us use 'cat' command to see what is saved in the file patch (note that the file name can be anything. but 'patch' is mostly used as practice)
:~/Coding/Fortran/Patch$ cat patch
5c5
< print*, "Hello World"
---
> print*, "Hello World, Let us Learn to use VASP code"
Okay. Now, you have the code print1.f90 and this patch file. How to implement this path file in print1.f90 and get the code print2.f90?
(exactly same procedure for implementing or incorporating patch file too).
For now, you can see what is provided in the VASP official. I will write about this later.
Comment here if this blog is useful.
No comments:
Post a Comment