Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/epiqc/ScaffCC
06 February 2026, 14:54:24 UTC
  • Code
  • Branches (10)
  • Releases (1)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/ScaffCC_OSX
    • refs/heads/master
    • refs/tags/2.2
    • refs/tags/5.0
    • refs/tags/v1.0
    • refs/tags/v1.0-beta.2
    • refs/tags/v2.0
    • refs/tags/v2.1
    • refs/tags/v3.0
    • refs/tags/v4.0
    • v3.1
  • fe8df6f
  • /
  • scaffold.sh
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:6e517af560b53de8ca65d014de999175180774d7
origin badgedirectory badge
swh:1:dir:fe8df6fbf3f0bca98b539c4393646ec21925607b
origin badgerevision badge
swh:1:rev:4d7bfa034cfaea4e8346396c6198cdd3e271d272
origin badgesnapshot badge
swh:1:snp:7eb50f12cf990a0030724453139e994df238639f

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 4d7bfa034cfaea4e8346396c6198cdd3e271d272 authored by Andrew Litteken on 23 April 2020, 16:55:47 UTC
Version 5 Upgrade! (#40)
Tip revision: 4d7bfa0
scaffold.sh
#!/bin/bash 

ROOT=$(dirname $0)

# Get RKQC path
export RKQC_PATH=${ROOT}/rkqc
if [ $(echo $PATH | grep ${RKQC_PATH} | wc -l) -eq 0 ]; then
	export PATH=$PATH:$RKQC_PATH
fi

function show_help {
    echo "Usage: $0 [-hv] [-rqfRTFckdso] [-l #] [-P #] [-D <pass_name>] <filename>.scaffold [args]*"
    echo "    -r   Generate resource estimate (default)"
    echo "    -q   Generate QASM"
    echo "    -f   Generate flattened QASM"
    echo "    -b   Generate OpenQASM"
    echo "    -R   Enable rotation decomposition"
    echo "    -T   Enable Toffoli decomposition"
    echo "    -l   Levels of recursion to run (default=1)"
    echo "    -P   Set precision of rotation decomposition in decimal digits (default=10)"
    echo "    -F   Force running all steps"
    echo "    -c   Clean all files (no other actions)"
    echo "    -k   Keep all intermediate files (default only keeps specified output,"
    echo "         but requires recompilation for any new output)"
    echo "    -d   Dry-run; show all commands to be run, but do not execute"
    echo "    -D   Debug named pass, use SCAFFOLD for all"
    echo "    -s   Generate QX Simulator input file"
    echo "    -o   Generate optimized QASM"
    echo "    -v   Show current Scaffold version information"
}

function show_version {
    echo "Scaffold - Release 4.1 (June 28, 2018)"
}

# Parse opts
OPTIND=1         # Reset in case getopts has been used previously in the shell.
rkqc=0
clean=0
dryrun=""
force=0
coptimization=0
purge=1
res=0
rot=0
toff=0
flat=0
openqasm=0
qc=0
precision=4
targets=""
optimize=0
debug_passes=""
while getopts "h?vcdfbsFkqroTRD:l:P:" opt; do
    case "$opt" in
    h|\?)
        show_help
        exit 0
        ;;
    v)
        show_version
        exit 0
        ;;
    c) clean=1
        ;;
    d) dryrun="--dry-run"
        ;;
    F) force=1
        ;;
    f) flat=1
        ;;
	b) openqasm=1
		;;
    k) purge=0
        ;;
    O) coptimization=1
        ;;
    q) targets="${targets} qasm"
        ;;
    r) res=1
        ;;
    R) rot=1
        ;;
    T) toff=1
        ;;        
    s) qc=1
        ;;
    D) debug_val=$(echo "${OPTARG}" | tr a-z A-Z)
       export "DEBUG_${debug_val}=1"
        ;;
    o) optimize=1
        ;;
    l) targets="${targets} SQCT_LEVELS=${OPTARG}"
        ;;
    P) precision=${OPTARG}
    esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift

if [ ${flat} -eq 1 ]; then
	targets="${targets} flat"
fi

if [ ${openqasm} -eq 1 ]; then
	targets="${targets} openqasm"
fi

if [ ${qc} -eq 1 ]; then
	targets="${targets} qc"
fi

if [ ${optimize} -eq 1 ]; then
	targets="${targets} optimize"
fi

# Put resources at the end so it is easy to read
if [ ${res} -eq 1 ]; then
    targets="${targets} resources"
fi
# Force first
if [ ${force} -eq 1 ]; then
    targets="clean ${targets}"
fi
# Default to resource estimate
if [ -z "${targets}" ]; then
    targets="resources"
fi
# Don't purge until done
if [ ${purge} -eq 1 ]; then
    targets="${targets} purge"
fi

echo ${1}
if [ $# -lt 1 ]; then 
    echo "Error: Missing filename argument" 
    show_help 
    exit 1 
fi 

filename=${1}
if [ ! -e ${filename} ]; then
    echo "${filename}: file not found"
    show_help
    exit 1
fi
shift

expresion=""
arg_num=1
while [ "${1}" != "" ]; do
    if [ $arg_num != 1 ]; then
        expression="${expression}; "
    fi
    expression="${expression}s/argv\[${arg_num}\]/${1}/g"
    arg_num=${arg_num}+1
    shift
done

dir="$(dirname ${filename})/"
file=$(basename ${filename} .scaffold)
cfile="${file}.*"

echo "file: $file"

if [ "${expression}" != "" ]; then
    sed -E -e "${expression}" "${filename}" > "${file}_args.scaffold"
    filename="${file}_args.scaffold"
fi

if [ $(egrep '^rkqc.*{\s*' ${filename} | wc -l) -gt 0 ]; then
	rkqc=1
	toff=1
fi
if [ ${clean} -eq 1 ]; then
	make -f $ROOT/scaffold/Scaffold.makefile ${dryrun} ROOT=$ROOT DIRNAME=${dir} FILENAME=${filename} FILE=${file} CFILE=${cfile} clean
    exit
fi
make -f $ROOT/scaffold/Scaffold.makefile ${dryrun} ROOT=$ROOT DIRNAME=${dir} FILENAME=${filename} FILE=${file} CFILE=${cfile} TOFF=${toff} RKQC=${rkqc} COPTIMIZATION=${coptimization}  ROTATIONS=${rot} PRECISION=${precision} OPTIMIZE=${optimize} ${targets}

exit 0

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API