-
Notifications
You must be signed in to change notification settings - Fork 2
Tutorials_and_problems
<<toc></toc>>
- Warning:** a number of old tutorials which have not been checked recently but which may contain important information can be found at old_-_Tutorials_and_problems.
You will need to have the following components installed to use the Quixote infrastructure:
* [[http://www.oracle.com/technetwork/java/javase/downloads/index.html|Java]] JDK You can check if you have the jdk installed by running the following command at the command-line: **javac -version** If that gives a **command not found** type error, you need to install the Java Development Kit. * [[http://quixote.wikispot.org/Tutorials_and_problems#Maven|Maven]] for resolving Java dependencies. Check [[Maven]] for a basic tutorial and known problems. * [[http://mercurial.selenic.com/|Mercurial]] for interacting with software repositories. Check [[Mercurial]] for a basic tutorial and known problems. * [[http://sourceforge.net/projects/avogadro/files/avogadro/1.0.1/|Avogadro]] for visualizing the parsed output. Check [[Avogadro]] for instructions about how to install it. * A source code editor ([[http://www.jedit.org/|jEdit]], [[http://www.gnu.org/software/emacs/|Emacs]], etc.) or IDE (such as [[http://www.eclipse.org/|Eclipse]]). * A command-line window where to enter commands (Windows, Mac and Linux, all have it). The commands may, alternatively, be run from the IDE.
Conventions:
* The root folder for the cloned project code will be identified by //<project-root>//.
Useful commands:
* Use a name of your choice for the folder that will contain the cloned project code:
* Obtain source code changes from the original cloned repository; then compile, test and install everything again. Run from //&lt;project&#45;root&gt;&lt;/project&#45;root&gt&lt;//:
at></project-root>the moment, the developing environment is a bit unstable, so, if you happen to have some problems with the tutorials here, it is sometimes a good idea to "restart" your environment before trying anything out. Some possible "restarting steps" are:
* Delete your folder and clone again:
* Issue. If running the examples seems to be using an old version of the project software, try the following (from //<project-root>//):
and Delete the hidden folder in your home.
Clone the JUMBO-converters repository with the command (be patient; it may take several minutes):
A jumbo-converters directory (this will be the //<project-root></project-root><//)></project-root>will be created in the directory where you issued the command to clone the repository. Enter into this directory with:
Run the command:
This will download the java jar files required by the converters into your local maven repository (~/.m2/repository on unix), compile, test and install the code into your local maven repository. Everything will then be ready for using the JUMBO-Converters software.
To use the Gaussian parser, cd into the //<project-root>/jumbo-converters-compchem/jumbo-converters-compchem-gaussian// directory.
and run the converter. With the command:
where **logfile.out** is the path to a gaussian logfile you wish to convert. This will then create a cml file named **logfile.cml** in the directory that the command was executed.
- mvn exec:java** takes care of setting up the Java environment (the classpath) so as to locate all compiled files needed for the execution. For this to happen, the previous command must be executed at the jumbo-converters-compchem-gaussian folder.
To use the NWChem converter, go into the jumbo-converters-compchem-nwchem folder:
and run the converter (it will use a test file, and it will create as output the file :
This will take one of the nwchem output files in **jumbo-converters-compchem-nwchem/src/test/resources/compchem/nwchem/log/in/** and create cml file in the directory **jumbo-converters-compchem-nwchem/test** folder (for details of what happens, see the file src/main/java/org/xmlcml/cml/converters/compchem/nwchem/log/NWChemLog2CompchemConverter.java.
Use this section to indicate if the tutorial works for you, if it doesn't, if you needed to do something differently, etc.:
* Pablo Echenique, success! MacOSX 10.6, 2011-03-22. * This tutorial has been checked on 2011-05-10 (Linux, Java 1.6, JUMBO-Converters changeset 332:1db5c3ee0b74). * Bert, mostly success! Windows7, 2011-05-11. When building the Quantum Expresso build fails.
"Tutorial 1" (which can be found at your local cloned //<project-root></project-root></jumbo-converters-core/tutorial/tutorial1.html//),></project-root>needs the following setup:
* Go to the jumbo-converters-core folder:
* Create an examples folder:
* Copy the tutorial files there:
* Run the tutorial program:
The result of the execution will be found at **examples/amber.out.xml**.
When modifying the template used, or when using a different input file, you should run the tutorial program with 3 arguments (in **-Dexec.args**) as follows:
First argument is the name of the template file, second one is the name of the input file, and the third and last one is the name of the output file.
At present, the JUMBO-Converters for compchem work in a declarative manner, i.e., you don't need to know Java to write a parser; you just need to know the output of your favourite compchem code, a bit of regular expressions and some very basic XPath (both of which you could even infer from already made examples). Then you edit some XML files that tell the JUMBO-Converters what they have to do and you are done.
Here, I will describe a small bit of Gaussian parsing and how to develop it. For more details, check JUMBO-Converters and the rest of tutorials in this page.
Also, see Declarative_parsing_syntax for a complete list of the rules followed by the parsers and their relations to the template XML files.
The first thing to know is that Gaussian runs are separated into **links**, which seem to be some kind of internal modules, each of which is in charge of a more or less conceptually bounded task. The important issue for us is that, if the calculation has been run with the #P level of verbosity, as in
then the points at which Gaussian enters or exits a link are clearly printed into the logfile; which is a very helpful feature for parsing.
For example, at the middle of the logfile that we will use in this tutorial,
you can read:
However, we will not try to parse now this obscure information about the 1-electron integrals. Instead, we will go for the molecular formula, which can be found in link 202, in the middle of it, in a line which begins by a space (as all lines in the logfile do) and the word **Stoichiometry**:
The minimal set of declarative XML files needed to parse this is as follows:
First you need a file called and located at
It contains the following code:
I.e., it includes a list of subtemplates which, in this example, contains only one item, , whose task is to capture and parse link 202, which is located at
and whose contents are:
The first two lines tell the JUMBO-Converters, through regular expressions, where link 202 begins and ends, respectively, and everything between those two matches is available for parsing in this file. Then, we see another templateList containing, again, only one item for this example, the file , which is located in the same folder as and contains:
In this case, we have no further lists of subtemplates and we just take the molecular formula. We detect the piece of text where it lies using and as before, and this leaves the lines between the two matches available for parsing. The tag parses the first line using another regular expression, and stores the formula string in a variable identified by .
If you now run the maven command in the previous tutorial:
from
this produces the file
which now contains the expected XML tagging:
* If you are behind a proxy server, see [[Maven]] and [[Mercurial]].
* Pablo Echenique: I installed Maven and Mercurial from [[http://www.macports.org/|MacPorts]]
* Pablo Echenique: You may have to include this line in your , or issue it in command line:
* Pablo Echenique: [[http://www.redleopard.com/2009/04/macroman-encoding-creeps-into-maven/|It seems]] that MacOS is stupid enough as not to use UTF-8 as default encoding, which may cause problems. Therefore, you might want to add these lines to your file at the top of your maven repository folder:
* Desktop iMac * Running Mac OS X 10.7.1 "Lion" * Processor: 2.66 GHz Intel Core 2 Duo * Memory: 4 GB 1067 MHz DDR3
* I installed Maven, Mercurial and dos2unix from [[http://www.macports.org/|MacPorts]].
* I included this line in my to inform the compiling system where the proper path to Java is:
* I moved to a folder of my choice ( in my case, but this is not relevant) and cloned from the [[https://bitbucket.org/wwmm/jumbo-converters|wwmm BitBucket repository]]:
* I removed all project artifacts that had been installed into my local maven repository (just in case):
* I moved into the compchem part of jumbo-converters and issued the command for a clean installation:
* This produces a lot of output, a final report with SUCCESS in all components
and it ends the installation of jumbo-converters-compchem in my machine.
* I moved to and cloned from the [[http://bitbucket.org/petermr/lensfieldjumbo|petermr BitBucket repository]]:
* I got into the newly created folder, unpacked lensfield and fixed linebreaks and permissions of the main script:
* I placed a link to the exectutable in my path:
* I updated lensfield, finishing its instalation: