Difference between revisions of "Rupture Variation Generator v5.4.2 code changes"

From SCECpedia
Jump to navigationJump to search
Line 9: Line 9:
 
<li>Inside src, create GenRandV5.0.</li>
 
<li>Inside src, create GenRandV5.0.</li>
 
<li>Copy rupgen_api.c from a previous API version into src. </li>
 
<li>Copy rupgen_api.c from a previous API version into src. </li>
 +
<li>Copy rupgen_defs.h from a previous API version into src. </li>
 
<li>Copy rupgen_api.h from a previous API version into include. </li>
 
<li>Copy rupgen_api.h from a previous API version into include. </li>
 +
<li>Create a symlink to rupgen_api.h in src. </li>
 
<li>Confusingly, there are two files named structure.h.  One is in StandRupFormat and contains the structures needed for an SRF.  The other is in GenRandV5.0 and contains the definition for complex, along with a few other supporting structures.
 
<li>Confusingly, there are two files named structure.h.  One is in StandRupFormat and contains the structures needed for an SRF.  The other is in GenRandV5.0 and contains the definition for complex, along with a few other supporting structures.
 
<ol>
 
<ol>
 
<li>Copy the StandRupFormat/structure.h into include/srf_structure.h .</li>
 
<li>Copy the StandRupFormat/structure.h into include/srf_structure.h .</li>
 
<li>Copy the GenRandV5.0/structure.h into include/structure.h .</li>
 
<li>Copy the GenRandV5.0/structure.h into include/structure.h .</li>
<li>Create a symlink to both  
+
<li>Create a symlink to both files in src.</li>
 
+
</ol>
==
+
<li>From the code provided by Rob, copy the following files into src/GenRandV5.0:
 +
<ul>
 +
<li>defs.h</li>
 +
<li>function.h</li>
 +
<li>include.h</li>
 +
<li>genslip-v5.4.2.c</li>
 +
<li>iofunc.c</li>
 +
<li>misc.c</li>
 +
<li>ruptime.c</li>
 +
<li>slip.c</li>
 +
<li>srf_subs.c (from StandRupFormat)</li>
 +
<li>makefile</li>
 +
</ul>
 +
</ol>
  
 
== Editing files ==
 
== Editing files ==

Revision as of 15:26, 2 October 2019

This page documents the code changes required to turn the stand-alone version, genslip-v5.4.2, into an API callable by the CyberShake post-processing.

In this document, $ROOT_DIR is taken to be the <CyberShake home>/software/RuptureCodes/RupGen-api-5.4.2 directory. GenRandV5.0 is the code as received from Rob Graves.

Installing files

  1. Create src, include, lib, and bin directories inside $ROOT_DIR .
  2. Inside src, create GenRandV5.0.
  3. Copy rupgen_api.c from a previous API version into src.
  4. Copy rupgen_defs.h from a previous API version into src.
  5. Copy rupgen_api.h from a previous API version into include.
  6. Create a symlink to rupgen_api.h in src.
  7. Confusingly, there are two files named structure.h. One is in StandRupFormat and contains the structures needed for an SRF. The other is in GenRandV5.0 and contains the definition for complex, along with a few other supporting structures.
    1. Copy the StandRupFormat/structure.h into include/srf_structure.h .
    2. Copy the GenRandV5.0/structure.h into include/structure.h .
    3. Create a symlink to both files in src.
  8. From the code provided by Rob, copy the following files into src/GenRandV5.0:
    • defs.h
    • function.h
    • include.h
    • genslip-v5.4.2.c
    • iofunc.c
    • misc.c
    • ruptime.c
    • slip.c
    • srf_subs.c (from StandRupFormat)
    • makefile

Editing files

structure.h

  1. At the top of the file, add:
    #ifndef STRUCT_H
    #define STRUCT_H
    
  2. At the end of the file, add:
    #endif
    
  3. Create a symlink from $ROOT_DIR/GenRandV5.0/structure.h which points to the file in $ROOT_DIR/src.