Linux

From krc
(Difference between revisions)
Jump to: navigation, search
Line 16: Line 16:
 
* Move the distribution file into one of the sub-directories (''into the “build” directory'')
 
* Move the distribution file into one of the sub-directories (''into the “build” directory'')
 
''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.''
 
''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'')
 
* Make the directory containing the distribution file the current working directory (''cd to the build directory'')
Line 29: Line 28:
  
 
* Change directory to make the directory containing the '''copied''' step61 file the present working directory (''cd 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 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'')

Revision as of 19:44, 23 November 2016

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)
  • Create two sub-directories in the clean directory (e.g. “build” and “uniq”)
  • Move the distribution file into one of the sub-directories (into the “build” directory)

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)
  • 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


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:

  • Make the “uniq” directory the current working directory

The files created by the execution of step61 should 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
make 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/krc
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 krc (./krc)

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


Also make sure you have access to a valid IDL installation. The output files (bin52 files) generated by a KRC normal mode run can be read using IDL. The DaVinci function process_bin52() can also be used to read the output files generated with KRC versions till v3.2.1 (this is more convenient than using IDL).


Step – 7:Setup IDL

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.

Personal tools