Skip to content

Commit

Permalink
hds: Move v4 code to its own directory
Browse files Browse the repository at this point in the history
and it just builds the C library now. The Fortran wrapper is
handled elsewhere.

dat_par.h is now a fixed file and not dynamically generated. It
is also not installed. Care must be taken to ensure that the
constants are the same in all HDS implementations.

DAT__SZLOC is only really used by the Fortran wrapper and is
a fixed size.
  • Loading branch information
timj committed Oct 31, 2014
1 parent 2023bc0 commit e752059
Show file tree
Hide file tree
Showing 186 changed files with 3,956 additions and 216 deletions.
10 changes: 10 additions & 0 deletions libraries/hds-v4/.gitignore
@@ -0,0 +1,10 @@
/hds1_types.h
/hds_machine
/hds_machine.txt
/hds_types.h
/hdsdump_v4
/make-hds-types
/hdsTest
/hds_test
/hds_test_prm
/sun92.pdf
130 changes: 130 additions & 0 deletions libraries/hds-v4/Makefile.am
@@ -0,0 +1,130 @@
## Process this file with automake to produce Makefile.in

bin_PROGRAMS = hdsdump_v4
noinst_PROGRAMS = hds_machine make-hds-types
starhelp_DATA = hds_machine.txt

lib_LTLIBRARIES = libhds_v4.la

TESTS = hdsTest hds_test_prm
check_PROGRAMS = hdsTest hds_test_prm

libhds_v4_la_SOURCES = \
$(PUBLIC_INCLUDES) \
$(PUBLIC_CINCLUDES) \
$(noinst_MESSAGES) \
$(PRIVATE_INCLUDES) \
$(C_ROUTINES)

libhds_v4_la_LIBADD = `starmem_link` `ems_link`

# Make all library code position independent. This is handy for creating
# shareable libraries from the static ones (Java JNI libraries).
if !NOPIC
libhds_v4_la_CFLAGS = $(AM_CFLAGS) -prefer-pic
endif

hds_machine_SOURCES = hds_machine.c
hds_machine_LDADD = libhds_v4.la

make_hds_types_SOURCES = make-hds-types.c

hdsdump_v4_SOURCES = hds_dev/hdsdump.c
hdsdump_v4_LDADD = libhds_v4.la

hdsTest_SOURCES = hdsTest.c
hdsTest_LDADD = libhds_v4.la

hds_test_prm_SOURCES = hds_test_prm.c
hds_test_prm_LDADD = libhds_v4.la

cincludedir = $(includedir)/star
cinclude_HEADERS = $(PUBLIC_CINCLUDES)
noinst_MESSAGES = dat_err.h

# dat_par.h was previously released so must go in the root include dir
PUBLIC_CINCLUDES = hds_v4.h hds_types.h

PRIVATE_INCLUDES = \
dat_par.h hds.h \
dat1.h hds1.h hds2.h hds1_types.h \
rec.h rec1.h str.h \
win_fixups.h \
$(noinst_MESSAGES)

C_ROUTINES = \
dat1_alloc_lcp.c dat1_annul_lcp.c dat1_check_mode.c \
dat1_check_type.c dat1_cvt_format.c dat1_cvt_order.c \
dat1_decoy.c dat1_get_ncomp.c dat1_get_odl.c dat1_getenv.c \
dat1_import_loc.c dat1_init.c dat1_init_ndr.c dat1_intune.c \
dat1_locate_name.c dat1_pack_crv.c dat1_pack_odl.c \
dat1_pack_srv.c dat1_put_ncomp.c dat1_put_odl.c \
dat1_show_ndr.c dat1_unpack_crv.c dat1_unpack_odl.c \
dat1_unpack_srv.c dat1_unpack_type.c \
dat1_free_hdsloc.c \
datClen.c datCopy.c datMsg.c datRef.c \
datDrep.c datErmsg.c datParen.c datPrec.c datPrmry.c datRefct.c \
datWhere.c datalter.c datannul.c datccopy.c daterase.c datfinind.c \
datget.c datget0x.c datinq.c datlocops.c datmap.c datmove.c datnew.c \
datnew0.c datMapN.c datPut1C.c datPutVC.c datGet1C.c datGetVC.c \
datChscn.c \
datput.c datput0x.c dattemp.c daucheck.c daucnv.c daucopy.c \
dauflush.c \
dauloc.c daumove.c dauscatgath.c daushape.c dautypes.c \
hds1_cleanup.c \
hds1_exit.c hdsCopy.c hdsEwild.c hds_globals.c hdsGtune.c \
hdsState.c hdsStop.c hdsTune.c \
hdsWild.c hdserase.c hdsgroup.c hdslock.c hdsnew.c hdsnull.c \
hdsopclos.c hdstools.c hdsInfoI.c \
dat1emsSetBigi.c dat1emsSetBigu.c dat1emsSetHdsdim.c \
rec1_alloc_frame.c rec1_clear_cbm.c rec1_close_file.c \
rec1_close_slot.c rec1_create_file.c rec1_deall_frame.c \
rec1_extend_file.c rec1_extend_frame.c rec1_find_file.c \
rec1_flush_block.c rec1_fmsg.c rec1_get_fid.c rec1_get_path.c \
rec1_getcwd.c rec1_locate_hcb.c rec1_lock_slot.c \
rec1_map_frame.c rec1_open_file.c rec1_pack_chain.c \
rec1_pack_hcb.c rec1_pack_ncomp.c rec1_pack_rcl.c \
rec1_read_file.c rec1_save_addr.c rec1_scan_cbm.c \
rec1_set_cbm.c rec1_shell.c rec1_test_cbm.c rec1_unlock_slot.c \
rec1_unmap_frame.c rec1_unpack_chain.c rec1_unpack_hcb.c \
rec1_unpack_ncomp.c rec1_unpack_rcl.c rec1_update_free.c \
rec1_write_file.c \
\
rec_adopt_record.c rec_alloc_mem.c rec_alloc_xmem.c \
rec_attach_file.c rec_close_file.c rec_create_record.c \
rec_count_files.c \
rec_deall_mem.c rec_deall_xmem.c rec_delete_record.c \
rec_end_wild.c rec_extend_record.c rec_get_handle.c \
rec_get_rcl.c rec_get_rid.c rec_list_files.c \
rec_locate_block.c rec_locate_data.c rec_locate_fns.c \
rec_lock.c rec_mark_delete.c rec_reall_mem.c rec_refcnt.c \
rec_release_block.c rec_release_data.c rec_reset_record.c \
rec_same_file.c rec_shrink_record.c rec_start.c rec_stop.c \
rec_unlock.c rec_where.c rec_wild_file.c \
rtl_fixups.c \
win_fixups.c \
hds_start.c

hds_types.h: make-hds-types$(EXEEXT)
./make-hds-types

hds1_types.h: make-hds-types$(EXEEXT)
./make-hds-types

hds_machine.txt: hds_machine$(EXEEXT)
echo "Machine characteristics, as determined by HDS" >$@
echo "" >>$@
./hds_machine >>$@

# Have to make sure that hds_types appears before DAT_PAR so that
# the include file generation routines are built in the correct order
BUILT_SOURCES = hds_types.h hds1_types.h \
$(include_MESSAGES) $(noinst_MESSAGES)

CLEANFILES = hds_machine.txt DAT_ERR dat_err.h \
hds_types.h hds1_types.h

dist_starnews_DATA = hds-v4.news

EXTRA_DIST = dat_err.msg

134 changes: 134 additions & 0 deletions libraries/hds-v4/bootstrap
@@ -0,0 +1,134 @@
#! /bin/sh -
# original bootstrap file, installed by starconf 1.3, rnum=1003000
# If you _need_ to change this file, delete `original' in the line above,
# or else starconf may overwrite it with an updated version.
#
# bootstrap.installed. Generated from bootstrap.installed.in by configure.
#
# Bootstrap a checked-out component of the Starlink software tree.
# Run this script in a freshly checked-out directory to bring the
# system to the point where you can just type ./configure;make
#
# Usage:
# ./bootstrap


# This script should be installed, by starconf, in all `component
# directories'. A `component directory' is a directory which has a
# component.xml.in file in it. All component directories will have a
# manifest file created and installed in .../manifests; non-component
# directories will not have manifest files. Everything that's
# installed should be installed as part of some component
# or other.
#
# The ./bootstrap scripts will stop recursing when they find a
# component.xml.in file. They'll warn if they find a component.xml.in
# file in any AC_CONFIG_SUBDIRS directory, but ignore it, and exit
# with an error if they do not find a component.xml.in file and there
# are no AC_CONFIG_SUBDIRS directories in which to search further.
# That is, the tree of directories which the top-level bootstrap
# traverses should have component.xml.in files at or above all its
# leaves.


# The starconf below might update bootstrap, if a newer version is
# available. Unfortunately, this confuses sh, which appears _not_ to
# keep open the script it's reading, but to reopen it afresh, or reseek
# within the file, for each line (or something like that!?).
# So rewrite this script to a temporary file and exec it.
tempfile="${TMP-/tmp}/$0-$$.tmp"
rm -f $tempfile
echo "trap 'rm -f $tempfile' 0" >$tempfile # remove temporary at exit
sed '1,/^--TRAMPOLINE--/d' $0 >>$tempfile # strip out the trampoline
exec /bin/sh $tempfile # exec the temporary
--TRAMPOLINE--


echo "Bootstrapping `pwd` ..."

if test ! -f configure.ac; then
echo "bootstrap: No configure.ac in directory `pwd`" >&2
exit 1
fi

subdirs=`autoconf --trace=AC_CONFIG_SUBDIRS:$% configure.ac`

if test -f component.xml.in; then

if starconf --show buildsupport >/dev/null 2>&1; then

# starconf is in the path
echo "...using starconf in " `starconf --show buildsupport`
starconf || exit 1

else

# The temptation here is to use ./starconf.status to find the
# starconf that it came from and invoke that explicitly. Don't do
# this, however: we don't want to be too clever, and it's better
# to be consistent with the way the autotools behave (the first
# one in your path is the one that works, and they don't have this
# sort of `phone home' cleverness in them).

echo "bootstrap error: The starconf application is not in your path"

# This doesn't stop us being helpful, however.
if test -f ./starconf.status; then
starconf_home=`./starconf.status --show buildsupport`
echo "This directory was last bootstrapped with $starconf_home/bin/starconf"
fi

exit 1
fi

# Check that there are no component.xml.in files in any subdirectories
if test -n "$subdirs"; then
for d in $subdirs
do
if test -d "$d" && test -f "$d/component.xml.in"; then
echo "bootstrap: warning: ignoring child $d/component.xml.in" >&2
fi
done
fi

# If STAR_SUPPRESS_AUTORECONF is true in the environment, then we
# suppress the call of `autoreconf'. This is here _only_ so that
# the top-level bootstrap file can suppress multiple calls of this
# in bootstrap scripts in its children. This mechanism must not
# be used by users, as it is likely to change without warning.
if ${STAR_SUPPRESS_AUTORECONF-false}; then
echo "Suppressing autoreconf in" `pwd`
else
echo autoreconf --install --symlink
autoreconf --install --symlink || exit 1
fi

else

# This is not a component directory, so simply recurse into the children.

# ...if there are any, that is.
if test -z "$subdirs"; then
echo "bootstrap: error: non-component directory `pwd` has no subdirs" >&2
exit 1
fi

# Bootstrap the child directories mentioned in AC_CONFIG_SUBDIRS.
# These bootstrap files must exist.
for d in $subdirs
do
if test -d "$d"; then
echo "Bootstrapping $d..."
if test -f $d/bootstrap; then
# good...
(cd $d; /bin/sh ./bootstrap)
else
echo "bootstrap: no file $d/bootstrap" >&2
exit 1
fi
fi
done

fi

exit 0
51 changes: 51 additions & 0 deletions libraries/hds-v4/component.xml
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!DOCTYPE component SYSTEM "componentinfo.dtd">
<!-- component.xml. Generated from component.xml.in by configure. -->

<component id="hds-v4" support="S">
<version>5.1-1</version>
<path>libraries/hds-v4</path>
<description>Hierarchical Data System Version 4</description>
<abstract>
<p>HDS is a file-based hierarchical data system designed for the
storage of a wide variety of information. It is particularly
suited to the storage of large multi-dimensional arrays (with
their ancillary data) where efficient access is needed.</p>
<p>HDS organises data into hierarchies, broadly similar to the
directory structure of a hierarchical filing system, but
contained within a single HDS container file. The
structures stored in these files are self-describing and
flexible; HDS supports modification and extension of structures
previously created, as well as deletion, copying, renaming, etc..</p>
<p>All information stored in HDS files is portable between the
machines on which HDS is implemented. Thus, there are no format
conversion problems when moving between machines.</p>
<p>The routines in this package may be used to perform operations
on any HDS data. In addition, HDS forms a toolkit for the
construction of higher level (more specialised) data structures
and the software which accesses them. HDS routines are
therefore invoked indirectly by many other items of Starlink
software.</p>
<p>This library handles HDS files version 4 and below.</p>
</abstract>
<dependencies >
<build>sae</build><build>chr</build><build>cnf</build><build>ems</build><build>starmem</build><link>chr</link><link>cnf</link><link>ems</link><link>starmem</link><test>chr</test><test>cnf</test><test>ems</test><test>prm</test><test>starmem</test><sourceset>messgen</sourceset>
</dependencies>
<developers>
<person>
<name>R. F. Warren-Smith</name>
</person>
<person>
<name>M. D. Lawden</name>
</person>
<person>
<name>Brian McIlwrath</name>
<uname>bkm</uname>
<email>B.K.McIlwrath@rl.ac.uk</email>
<role>owner</role>
</person>
</developers>
<documentation></documentation>
<bugreports>starlink@jiscmail.ac.uk</bugreports>
<!-- <notes><p></p></notes> -->
</component>
51 changes: 51 additions & 0 deletions libraries/hds-v4/component.xml.in
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!DOCTYPE component SYSTEM "componentinfo.dtd">
<!-- @configure_input@ -->

<component id="@PACKAGE@" support="S">
<version>@PACKAGE_VERSION@</version>
<path>libraries/hds-v4</path>
<description>Hierarchical Data System Version 4</description>
<abstract>
<p>HDS is a file-based hierarchical data system designed for the
storage of a wide variety of information. It is particularly
suited to the storage of large multi-dimensional arrays (with
their ancillary data) where efficient access is needed.</p>
<p>HDS organises data into hierarchies, broadly similar to the
directory structure of a hierarchical filing system, but
contained within a single HDS container file. The
structures stored in these files are self-describing and
flexible; HDS supports modification and extension of structures
previously created, as well as deletion, copying, renaming, etc..</p>
<p>All information stored in HDS files is portable between the
machines on which HDS is implemented. Thus, there are no format
conversion problems when moving between machines.</p>
<p>The routines in this package may be used to perform operations
on any HDS data. In addition, HDS forms a toolkit for the
construction of higher level (more specialised) data structures
and the software which accesses them. HDS routines are
therefore invoked indirectly by many other items of Starlink
software.</p>
<p>This library handles HDS files version 4 and below.</p>
</abstract>
<dependencies @STAR_DEPENDENCIES_ATTRIBUTES@>
@STAR_DEPENDENCIES_CHILDREN@
</dependencies>
<developers>
<person>
<name>R. F. Warren-Smith</name>
</person>
<person>
<name>M. D. Lawden</name>
</person>
<person>
<name>Brian McIlwrath</name>
<uname>bkm</uname>
<email>B.K.McIlwrath@rl.ac.uk</email>
<role>owner</role>
</person>
</developers>
<documentation>@STAR_DOCUMENTATION@</documentation>
<bugreports>@PACKAGE_BUGREPORT@</bugreports>
<!-- <notes><p></p></notes> -->
</component>

0 comments on commit e752059

Please sign in to comment.