Difference between revisions of "Rupture Variation Generator v5.4.2 code changes"
From SCECpedia
Jump to navigationJump to searchLine 11: | Line 11: | ||
<li>Copy rupgen_defs.h 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 | + | <li>Create a symlink in src which points to $ROOT_DIR/include/rupgen_api.h . </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> | ||
Line 35: | Line 35: | ||
== Editing files == | == Editing files == | ||
− | === structure.h === | + | === In $ROOT_DIR/src === |
+ | |||
+ | ==== structure.h ==== | ||
<ol> | <ol> | ||
+ | <li>At the top of the file, remove '#include "StandRupFormat/structure.h"'</li> | ||
<li>At the top of the file, add: | <li>At the top of the file, add: | ||
<pre> | <pre> | ||
Line 47: | Line 50: | ||
#endif | #endif | ||
</pre></li> | </pre></li> | ||
− | <li> | + | </ol> |
+ | |||
+ | |||
+ | ==== srf_structure.h ==== | ||
+ | |||
+ | <ol> | ||
+ | <li>At the top of the file, add: | ||
+ | <pre> | ||
+ | #ifndef SRF_STRUCT_H | ||
+ | #define SRF_STRUCT_H | ||
+ | </pre></li> | ||
+ | <li>At the end of the file, add: | ||
+ | <pre> | ||
+ | #endif | ||
+ | </pre></li> | ||
</ol> | </ol> |
Revision as of 15:35, 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.
Contents
Installing files
- Create src, include, lib, and bin directories inside $ROOT_DIR .
- Inside src, create GenRandV5.0.
- Copy rupgen_api.c from a previous API version into src.
- Copy rupgen_defs.h from a previous API version into src.
- Copy rupgen_api.h from a previous API version into include.
- Create a symlink in src which points to $ROOT_DIR/include/rupgen_api.h .
- 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.
- Copy the StandRupFormat/structure.h into include/srf_structure.h .
- Copy the GenRandV5.0/structure.h into include/structure.h .
- Create a symlink to both files in src.
- 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
In $ROOT_DIR/src
structure.h
- At the top of the file, remove '#include "StandRupFormat/structure.h"'
- At the top of the file, add:
#ifndef STRUCT_H #define STRUCT_H
- At the end of the file, add:
#endif
srf_structure.h
- At the top of the file, add:
#ifndef SRF_STRUCT_H #define SRF_STRUCT_H
- At the end of the file, add:
#endif