mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-12-22 20:35:44 +01:00
add comments to build_trexio
This commit is contained in:
parent
faa936cc54
commit
ed77a86215
@ -1,13 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $(basename $PWD) != "src" ]] ; then
|
||||
echo "This script should run in the src directory"
|
||||
# Check that script is executed from tools directory
|
||||
if [[ $(basename $PWD) != "tools" ]] ; then
|
||||
echo "This script should run in the tools directory"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Go to src directory
|
||||
cd ../src
|
||||
|
||||
# We want the script to crash on the 1st error:
|
||||
set -e
|
||||
|
||||
# Create directories for templates
|
||||
echo "create populated directories"
|
||||
mkdir -p templates_front/populated
|
||||
mkdir -p templates_text/populated
|
||||
@ -16,6 +21,7 @@ mkdir -p templates_hdf5/populated
|
||||
# It is important to ad '--' to rm because it tells rm that what follows are
|
||||
# not options. It is safer.
|
||||
|
||||
# Cleaning of existing data
|
||||
echo "remove existing templates"
|
||||
rm -f -- templates_front/*.{c,h,f90}
|
||||
rm -f -- templates_text/*.{c,h}
|
||||
@ -26,6 +32,7 @@ rm -f -- templates_front/populated/*
|
||||
rm -f -- templates_text/populated/*
|
||||
rm -f -- templates_hdf5/populated/*
|
||||
|
||||
# Function to produce TREXIO source files from org-mode files
|
||||
function tangle()
|
||||
{
|
||||
local command="(org-babel-tangle-file \"$1\")"
|
||||
@ -36,24 +43,27 @@ function tangle()
|
||||
--eval "$command"
|
||||
}
|
||||
|
||||
# Produce source files for front end
|
||||
echo "tangle org files to generate templates"
|
||||
cd templates_front
|
||||
tangle templator_front.org
|
||||
cd ..
|
||||
|
||||
# Produce source files for TEXT back end
|
||||
cd templates_text
|
||||
tangle templator_text.org
|
||||
cd ..
|
||||
|
||||
# Produce source files for HDF5 back end
|
||||
cd templates_hdf5
|
||||
tangle templator_hdf5.org
|
||||
cd ..
|
||||
|
||||
# Populate templates with TREXIO structure according to trex.json file
|
||||
echo "run generator script to populate templates"
|
||||
python3 generator.py
|
||||
|
||||
sleep 2
|
||||
|
||||
# Put pieces of source files together
|
||||
echo "compile populated files in the lib source files "
|
||||
cd templates_front
|
||||
source build.sh
|
||||
@ -70,3 +80,5 @@ source build.sh
|
||||
cp trexio* ../
|
||||
cd ..
|
||||
|
||||
# Come back to the TREXIO root directory
|
||||
cd ..
|
||||
|
Loading…
Reference in New Issue
Block a user