#Namelist Parser A library for reading from and writing to Namelist files (Particularly those used by WRF).
##Usage
See the this project's wiki for usage examples.
###Compiling There are a two main options for compiling this library:
- Pros:
- Makes updating incredibly easy
- Automatically installs Apache Ant
- Handles automatic dependency tracking (for a lot of software)
- Cons:
- Pros:
- Cons:
- Manually setting up Ant can be a pain
- Updating the software and libraries is harder
####Required Software
(these are all command line utilities)
Note: Software that is installed as a part of the setup instructions is not included.
- Both:
- git
- Java 8 JDK (update 45 or higher)
- With Homebrew/Linuxbrew:
- ruby (Already installed on Macs)
- curl (Already installed on Macs)
- Without Homebrew/Linuxbrew:
Note: If you do not have the needed software, or are not sure, see Getting the Required Software for instructions on how to get the software.
####Getting the Required Software
- Both:
- git (if
which git
does not show a path):- For Mac, install XCode developer tools
- For Linux,
sudo apt-get install git
orsudo yum install git
should work
- Java 8 JDK (update 45 or higher):
- For Mac: Download the JDK from Oracle here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
- For Linux: follow the instructions at https://github.com/Toberumono/Miscellaneous/wiki/Installing-Oracle's-JDK-on-Linux
- git (if
- With Homebrew/Linuxbrew:
- See their respective websites for setup instructions.
- Homebrew: http://brew.sh
- Linuxbrew: https://github.com/Homebrew/linuxbrew
- See their respective websites for setup instructions.
- Without Homebrew/Linuxbrew:
- Ant:
- See https://github.com/Toberumono/Miscellaneous/wiki/Installing-Apache-Ant for setup instructions.
- Ant:
####Compiling With Homebrew/Linuxbrew Any "run" instruction means, "copy and paste the following into Terminal and hit enter".
- Run
brew tap Toberumono/tap
- Run
brew install namelist-parser
- All done!
####Compiling Without Homebrew/Linuxbrew Any "run" instruction means, "copy and paste the following into Terminal and hit enter".
- Create the directory that you want to contain the .jar file
- Run one of the following:
-
For upgradeable builds, run:
op="$(pwd)" && tg="Namelist-Parser" && git clone "https://github.com/Toberumono/$tg.git" && cd "./$tg" && git checkout "$(git describe)" && ant; cd "$op"; unset op tg
-
This is the recommended option.
-
It clones the repository and then checks out the most recent tagged commit (aka the most recent release)
-
To update, cd into the directory with the .jar file and run:
op="$(pwd)" && tg="Namelist-Parser" && cd "./$tg" && git fetch && git checkout "$(git describe)" && ant; cd "$op"; unset op tg
-
-
For one-time builds, run:
op="$(pwd)" && tg="Namelist-Parser" && url="https://github.com/Toberumono/$tg" && mkdir "./$tg" && curl -#fSL "$url/archive/$(git ls-remote --tags $url.git | grep -oE '([0-9]+\.)*[0-9]+$' | sort -g | tail -1).tar.gz" | tar -xz --strip-components 1 -C "./$tg" && cd "./$tg" && ant; cd "$op" && rm -rf "$tg"; unset op tg url
- This will get the most recent tagged release only.
- While this is not recommended, it is still perfectly safe - it just makes updating a bit trickier.
-
If you really want the cutting edge, possibly broken version, run:
op="$(pwd)" && tg="Namelist-Parser" && git clone "https://github.com/Toberumono/$tg.git" && cd "./$tg" && ant; cd "$op"; unset op tg
- If you do not know how to update to the latest version after running this, don't run it.
- This is not recommended mainly because it is not safe - unless you are willing to do some debugging, avoid this option.
- All done!