-
Notifications
You must be signed in to change notification settings - Fork 74
Code generation for adapted CPACS schema
Sometimes, it is necessary to change the CPACS definitions used in the local TiGL configuration. This might be done to overcome missing features which can be merged into the CPACS repository later or for simple testing reasons. To apply these changes, the cpacs_gen_input/cpacs_schema.xsd file in the local TiGL repository has to be adapted. Since the used schema of CPACS has, of course, direct impact on the source code of TiGL, several (generated) code files need to be changed and/or created from scratch. This happens via code generation but the process has to be initialized manually.
On this page, the necessary steps can be found to do so:
If not done before, TiGL has to be cloned, configured and installed on the local machine. Instructions for these initial steps can be found here.
- Change the directory to the TiGL root directory. After setting up and installing TiGL locally, the cpacs_tigl_gen submodule has to be activated within the TiGL repository:
cd </path/to/tigl>
git submodule init
git submodule update- To sucessfully build the submodule, activate the
tigl-bldenvironment which initially created during TiGL's build process:
conda activate tigl-bld- Now, switch to the submodule folder, create a build folder and move into it:
cd thirdparty/cpacs_gen/
mkdir build
cd build- Localize the absolute path to the TiGL repository as it has to be passed during the configuration and configure the submodule:
cmake .. -DTIGL_PATH=</absolute/path/to/tigl>All those steps before have to be executed only once when first initializing the generator. When generating the source code again afterwards and everything mentioned above is available, the next steps are enough:
- Within the cpacs_tigl_gen
builddirectory build thegeneratetarget. This automatically generates all the changes and new source code files:
make generate- After generating, switch back to the TiGL build directory. Here,
cmakehas to be executed again, in order that the potentially new files are recognized. Now, TiGL can be built and the changes in the CPACS schema are applied.
cd </path/to/tigl>/build
cmake ..
make [install]- As mentioned above: Repeat the steps 5 and 6 to regenerate the source code
Note: If TiGL does not compile, there might be some changes necessary elsewhere in the source code, since, e.g., object names or structures might differ from before. This is depending on the adaptions in cpacs_schema.xsd and cannot be described in general.