Linux

From krc
Jump to: navigation, search

Download a KRC distribution from the Subversion Repository. All versions till v3.2.1 have been validated.

The latest version v3.4.3 will be validated soon. This page will be updated when that is done


The following instructions assume that you are in the C shell (If you are in the Bash shell, you can generally change to the C shell by typing /bin/csh on the command line).


Step 1: Setup the directories to start the build process

  • Create a clean (new) directory (e.g. “321” for KRC Version 3.2.1)
  • Save the distribution file in the clean directory
  • Untar the distribution file (tar –xvf or tar –xzf). This should create five directories: aaa, doc, idl, run and src

NOTE: Older distribution files might have two tar files, one of which will contain the "big" directory. In this case, untarring the distribution will create six directories. v3.2.1 onward the distribution hasn’t had the "big" directory

  • Create two sub-directories in the clean directory (e.g. “build” and “uniq”)
  • Move the distribution file and the five untarred directories into one of the sub-directories (into the “build” directory - build will now contain the distribution file, aaa, doc, idl, run and src)

NOTE: From this point onward build will be the directory containing the distribution and uniq will be the other directory. The nomenclature of the directories used to this point is intended to serve as a tutorial. You are free to have your own nomenclature for these directories.

  • Make the directory containing the distribution file the current working directory (cd to the build directory)


Step 2: By default, a set of files point to the directories in the "development environment". These files have to be updated for your environment to point to your directory system.

  • Copy aaa/step61 into the other sub-directory in the clean directory (cp aaa/step61 to uniq)
  • Change directory to make the directory containing the copied step61 file the present working directory (cd to uniq)
  • Edit the copied step61 file so that the the C shell matches the C shell on your machine (typing which csh on the command line should show you the path of the C shell on your machine. Change the first line of step61 to match this. For example, #! /usr/bin/csh is the path in the unmodified distribution file. If your machine’s C shell is /bin/csh, then change #! /usr/bin/csh to #!/bin/csh)
  • Edit FAM to point to the "build" directory and LOC to point to the "uniq" directory (e.g. FAM = absolute path of the “build” directory LOC = absolute path of the “uniq” directory)
  • Save and close the file
  • Execute step61 (./step61). [If the file is not executable, you may need to chmod it to add executable permissions]
  • After step61 is executed it will copy other files that need to be edited into the “uniq” directory.


Step 3: The files created by the execution of step61 should also be updated for your environment.

1. idlPath – sets up the path so that IDL can find the functions it needs
  • The environment variable IDLL should point to the installation of IDL in your environment
  • The environment variable IDLD should point to the idl directory created by untarring the distribution file
  • IDL_PATH should be set to include both IDLD and IDLL (You should not have to change this line)


2. kirin.pro – There is one case statement in the file that starts with “else:begin” and has a comment “assumes ASU test environment”. You don’t have to be in the ASU environment to use this case. This is :the only case in the file that needs to be edited. Make sure all the directories in this section end with ‘/’
  • idltop should point to the idl directory created by untarring the distribution file
  • solib should be changed to = idltop+‘extern/ftnwrap64.so’ (extern is the external directory in idl directory)
  • krcdist should point to the directory containing the five distribution file (e.g. full path to the "build" directory)
  • prjdat should be changed to = krcdist+‘big/’
  • prjsrc should be changed to = krcdist+‘run/’


3. step6 – This file should be edited exactly the way step61 was edited.

Check the remaining files in “uniq” to see if they need any path changes as well. Generally, this should not be required.


Step 4:

Now that the “uniq” files have been edited, they should be copied back to the distribution. At this point, the “uniq” files should be set up for future distributions. When you get a new distribution, take care not to overwrite the files in “uniq”. Do not run step61 again unless you want to lose the changes made to the “uniq” files.

  • Execute step6 (./step6) – this will copy the files back into the distribution


Step 5:

  • Make the directory containing the distribution file the current working directory (cd to the “build” directory)
  • Make the src/cfiles directory the current working directory (cd src/cfiles/)
make all
  • Make src the current working directory (cd ../src)
  • Open the “Makefile” in the “src” directory and change HHKLIB to point to the directory containing the distribution file (“build” directory) and CLIB to point to ./cfiles/libhk_cisis.a. Also, lines 106, 109 and 112 of the Makefile should be updated to point to the src directory in your environment.
b2b.o: absolute_path_to_src/b2b.f
catime.o: absolute_path_to_src/catime.f
white1.o: absolute_path_to_src/white1.f
make krcd (For v3.2.1, krc is called krcd instead of krc)
make porbmn
  • Make idl/extern the current working directory (cd ../idl/extern/) and delete any .so files in this directory

NOTE: You should not have any files with .so extension in the directory before proceeding to make ftnwrap64.so

make ftnwrap64.so

Exit IDL if it is running

The building process is now complete

  • Make run the current working directory (cd ../../run) and create a couple of soft links
ln –s ../src/krcd
ln –s ../src/porbmn

Caution: Sometimes krc will have a slightly different name. Look in the “Makefile” in the “src” directory to check the appropriate name before creating the soft links. If the names don’t match, it’ll result in errors.


Step – 6:

  • Execute krcd (./krcd)

The run directory has example input files which will help verify that krc has been installed correctly. master.inp is the input file for the normal mode run. Type in an appropriate name for the output file. This output file will be created in the “run” directory with ‘.prt’ extension. A file with a .t52 extension will also be created


Step – 7: The output files (bin52 files) generated by a KRC normal mode run can be read in the following ways:

1. Using IDL: Make sure you have access to a valid IDL installation

In order to read the .t52 file that is generated as the output of the test run, IDL has to be setup. We edited the idlPath file and copied it back to the distribution in step 5. Now, we need to source it.

  • Make idl the current working directory (cd ../idl)
source idlPath

This should not generate any output.

Start IDL. Make sure the same version of IDL whose path is in the idlPath file is started.

.comp kirincompile kirin.pro
kirinexecutes kirin.pro

This should have set up the environment variables we see in kirin.pro and printed a summary on to the screen

.rnew krcvtestruns krcvtest

(If krcvtest gives an output and takes you to the krcvtest command prompt, you can type 0 to get back to IDL command prompt)

The setup is now complete. You should look for krcvtest documentation to further validate the output of KRC from the previous version to the version you just build.

2. Using DaVinci: Download DaVinci here
  • The DaVinci function process_bin52() will read bin52 files easier than IDL
  • In order to use the function, you should source krc,dvrc at the startup of DaVinci. (email jserla@asu.edu for the krc.dvrc file)
Personal tools