Skip to content

Commit

Permalink
release 2,2 - a unified sifdecode (in double precision) that builds both
Browse files Browse the repository at this point in the history
single ad double output, and does not rely on sed
  • Loading branch information
dalekopera committed Oct 24, 2023
1 parent 4343d54 commit 9e37be2
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 192 deletions.
2 changes: 1 addition & 1 deletion bin/classall
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ eval "`cat $SIFDECODE/bin/sys/$ARCH`"
# Define the path to the decoder

cd $MASTSIF
CLSF=$SIFDECODE/objects/$ARCH/double/clsf
CLSF=$SIFDECODE/objects/$ARCH/clsf

[[ -e CLASSF.DB ]] && $RM CLASSF.DB
for i in *.SIF; do
Expand Down
2 changes: 1 addition & 1 deletion bin/classify
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ eval "`cat $SIFDECODE/bin/sys/$ARCH`"

# Define the path to the decoder

CLSF=$SIFDECODE/objects/$ARCH/double/clsf
CLSF=$SIFDECODE/objects/$ARCH/clsf

cd $MASTSIF
echo "n" > CLSF.DAT
Expand Down
25 changes: 3 additions & 22 deletions bin/install_sifdecode_alone
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# syntax: install_sifdecode

# N. Gould, D. Orban & Ph. Toint
# ( Last modified on 6 February 2013 at 07:15 GMT )
# ( Last modified 2023-10-24 at 14:15 GMT )

# check input arguments (if any)

Expand Down Expand Up @@ -93,26 +93,10 @@ echo "$MACHINE ($OPSYS) $COMPUSED" > $SIFDECODE/versions/$VERSION

if [[ ! -e $OBJDIR ]]; then
$MKDIR $OBJDIR
$MKDIR $OBJDIR/double $OBJDIR/single
else
if [[ ! -e $OBJDIR/double ]]; then
$MKDIR $OBJDIR/double
fi
if [[ ! -e $OBJDIR/single ]]; then
$MKDIR $OBJDIR/single
fi
fi

if [[ ! -e $MODDIR ]]; then
$MKDIR $MODDIR
$MKDIR $MODDIR/double $MODDIR/single
else
if [[ ! -e $MODDIR/double ]]; then
$MKDIR $MODDIR/double
fi
if [[ ! -e $MODDIR/single ]]; then
$MKDIR $MODDIR/single
fi
fi

# write out the sifdecode/bin/sys file for this architecture
Expand Down Expand Up @@ -168,11 +152,8 @@ echo ' ' >> $MAKEFILE
echo '# Directory for binaries' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'PRECIS = double' >> $MAKEFILE
echo 'OBJ = $(SIFDECODE)/objects/$(VERSION)/$(PRECIS)' >> $MAKEFILE
echo 'OBJS = $(SIFDECODE)/objects/$(VERSION)/single' >> $MAKEFILE
echo 'OBJD = $(SIFDECODE)/objects/$(VERSION)/double' >> $MAKEFILE
echo 'MOD = $(SIFDECODE)/modules/$(VERSION)/$(PRECIS)' >> $MAKEFILE
echo 'SEDS = $(SIFDECODE)/seds/$(PRECIS).sed' >> $MAKEFILE
echo 'OBJ = $(SIFDECODE)/objects/$(VERSION)' >> $MAKEFILE
echo 'MOD = $(SIFDECODE)/modules/$(VERSION)' >> $MAKEFILE
echo 'MVMODS = '"$MVMODS" >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Compiler options' >> $MAKEFILE
Expand Down
27 changes: 4 additions & 23 deletions bin/install_sifdecode_main
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# syntax: ginstall_sifdecode

# N. Gould, D. Orban & Ph. Toint
# ( Last modified on 18 March 2013 at 13:45 GMT )
# ( Last modified 2023-10-24 at 14:05 GMT )

export SIFDECODE=`dirs -l`
export SIFDECODE=`echo $SIFDECODE | $SED 's"/tmp_mnt""'`
Expand All @@ -28,26 +28,10 @@ echo "$MACHINE ($OPSYS) $COMPUSED" > $SIFDECODE/versions/$VERSION

if [[ ! -e $OBJDIR ]]; then
$MKDIR $OBJDIR
$MKDIR $OBJDIR/double $OBJDIR/single
else
if [[ ! -e $OBJDIR/double ]]; then
$MKDIR $OBJDIR/double
fi
if [[ ! -e $OBJDIR/single ]]; then
$MKDIR $OBJDIR/single
fi
fi

if [[ ! -e $MODDIR ]]; then
$MKDIR $MODDIR
$MKDIR $MODDIR/double $MODDIR/single
else
if [[ ! -e $MODDIR/double ]]; then
$MKDIR $MODDIR/double
fi
if [[ ! -e $MODDIR/single ]]; then
$MKDIR $MODDIR/single
fi
fi

# write out the sifdecode/bin/sys file for this architecture
Expand All @@ -57,7 +41,7 @@ SYSFILE=$SIFDECODE/bin/sys/$VERSION
echo 'RM="'$RM'"' > $SYSFILE
echo 'MAKE="'$MAKE'"' >> $SYSFILE
echo 'CAT="'$CAT'"' >> $SYSFILE
echo 'SED="'$SED'"' >> $SYSFILE
#echo 'SED="'$SED'"' >> $SYSFILE
echo 'MV="'$MV'"' >> $SYSFILE
echo 'LS="'$LS'"' >> $SYSFILE
echo 'LN="'$LN'"' >> $SYSFILE
Expand Down Expand Up @@ -97,11 +81,8 @@ echo ' ' >> $MAKEFILE
echo '# Directory for binaries' >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo 'PRECIS = double' >> $MAKEFILE
echo 'OBJ = $(SIFDECODE)/objects/$(VERSION)/$(PRECIS)' >> $MAKEFILE
echo 'OBJS = $(SIFDECODE)/objects/$(VERSION)/single' >> $MAKEFILE
echo 'OBJD = $(SIFDECODE)/objects/$(VERSION)/double' >> $MAKEFILE
echo 'MOD = $(SIFDECODE)/modules/$(VERSION)/$(PRECIS)' >> $MAKEFILE
echo 'SEDS = $(SIFDECODE)/seds/$(PRECIS).sed' >> $MAKEFILE
echo 'OBJ = $(SIFDECODE)/objects/$(VERSION)' >> $MAKEFILE
echo 'MOD = $(SIFDECODE)/modules/$(VERSION)' >> $MAKEFILE
echo 'MVMODS = '"$MVMODS" >> $MAKEFILE
echo ' ' >> $MAKEFILE
echo '# Compiler options' >> $MAKEFILE
Expand Down
3 changes: 1 addition & 2 deletions bin/select
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,9 @@ fi

eval "`cat $SIFDECODE/bin/sys/$ARCH`"


# Define the path to the decoder

SLCT=$SIFDECODE/objects/$ARCH/double/slct
SLCT=$SIFDECODE/objects/$ARCH/slct

echo $MASTSIF > SLCT.DAT
$SLCT
Expand Down
9 changes: 4 additions & 5 deletions bin/sifdecoder
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# sifdecoder: script to decode a sif file
#
# N. Gould, D. Orban & Ph. Toint, November 7th, 2000
# Updated, January 20th, 2013
# This version October 21st, 2015
# This version October 24th, 2023

display_short_help() {
echo ' Use: sifdecoder [-A architecture] [-sp] [-h] [-c] [-f] [-b] [-a j]'
Expand Down Expand Up @@ -411,11 +410,11 @@ fi

# Define the path to the decoder

DECODER=${SIFDECODE}/objects/${ARCH}/double/run_sifdecode
DECODER=${SIFDECODE}/objects/${ARCH}/run_sifdecode

if [[ ! -x $DECODER ]]; then
error "No SIF decoder sifdec found in
$SIFDECODE/objects/$ARCH/double/run_sifdecode
$SIFDECODE/objects/$ARCH/run_sifdecode
Terminating execution."
exit 4
fi
Expand Down Expand Up @@ -525,7 +524,7 @@ if [[ $DERIVCHECK == "1" ]]; then

# create the executable

OBJMAIN=$SIFDECODE/objects/$ARCH/double
OBJMAIN=$SIFDECODE/objects/$ARCH
${FORTRAN} ${FFLAGS} -o check_derivs $OBJMAIN/check_derivs_main.o \
$NSUB -L$OBJMAIN -lsifdecode

Expand Down
3 changes: 0 additions & 3 deletions seds/cutersize.sed

This file was deleted.

5 changes: 0 additions & 5 deletions seds/double.sed

This file was deleted.

20 changes: 0 additions & 20 deletions seds/single.sed

This file was deleted.

37 changes: 10 additions & 27 deletions src/check/makemaster
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Main body of the installation makefile for the SIFDECODE check package

# N. Gould, D. Orban and Ph. L. Toint.
# This version: 01 I 2017
# This version: 2023-10-24

SHELL = /bin/$(BINSHELL)

Expand All @@ -17,8 +17,6 @@ RUNFFLAGS = $(OPTIMIZATION) $(DEBUG) $(MODULES)
# names of random libraries

LS = $(OBJ)/libsifdecode.a
LSS = $(OBJS)/libsifdecode.a
LSD = $(OBJD)/libsifdecode.a

# Libraries used

Expand All @@ -31,41 +29,29 @@ ARR = $(AR) $(ARREPFLAGS) $(LS)
RMARFILE = $(SIFDECODE)/bin/rmarfile $(AR) $(GREP) $(LS)
RMOBFILE = $(SIFDECODE)/bin/rmobfile $(RM) $(OBJ)

# sed scripts

# compilation agenda

CHECKS = $(LSS)(random.o) $(LSS)(check_derivs.o) \
$(OBJS)/check_derivs_main.o
CHECKD = $(LSD)(random.o) $(LSD)(check_derivs.o) \
$(OBJD)/check_derivs_main.o

SUCC = precision version) compiled successfully
CHECKS = $(LS)(random.o) $(LS)(check_derivs.o) $(OBJ)/check_derivs_main.o

# main compilations and runs

all: check_derivs

# basic packages

check_derivs_silent: check_derivs_silent_$(PRECIS)
check_derivs_silent_single: $(CHECKS)
check_derivs_silent_double: $(CHECKD)
check_derivs_silent: $(CHECKS)

check_derivs: check_derivs_$(PRECIS)
@printf ' %-21s\n' "sifdecode: check packages ($(PRECIS) $(SUCC)"
check_derivs_single: $(CHECKS)
$(RANLIB) $(LSS)
check_derivs_double: $(CHECKD)
$(RANLIB) $(LSD)
check_derivs: $(CHECKS)
$(RANLIB) $(LS)
@printf ' %-21s\n' "sifdecode: check packages compiled successfully"

# individual compilations

random.o: $(LS)(random.o)

$(LS)(random.o): ../check/random.f90
@printf ' %-9s %-15s\t\t' "Compiling" "random"
$(SED) -f $(SEDS) ../check/random.f90 > $(OBJ)/random.f90
$(CP) ../check/random.f90 $(OBJ)/random.f90
cd $(OBJ); $(FORTRAN) -o random.o $(FFLAGS) random.f90 \
|| ( printf ' %-26s' "=> Disabling optimization " ; \
$(FORTRAN) -o random.o $(FFLAGSN) random.f90 )
Expand All @@ -78,7 +64,7 @@ check_derivs.o: $(LS)(check_derivs.o)

$(LS)(check_derivs.o): ../check/check_derivs.f90
@printf ' %-9s %-15s\t\t' "Compiling" "check_derivs"
$(SED) -f $(SEDS) ../check/check_derivs.f90 > $(OBJ)/check_derivs.f90
$(CP) ../check/check_derivs.f90 $(OBJ)/check_derivs.f90
cd $(OBJ); $(FORTRAN) -o check_derivs.o $(FFLAGS) check_derivs.f90 \
|| ( printf ' %-26s' "=> Disabling optimization " ; \
$(FORTRAN) -o check_derivs.o $(FFLAGSN) check_derivs.f90 )
Expand All @@ -93,14 +79,11 @@ check_derivs_main.o: $(OBJ)/check_derivs_main.o

$(OBJ)/check_derivs_main.o: ../check/check_derivs_main.f90
@printf ' %-9s %-15s\t\t' "Compiling" "check_derivs_main"
$(SED) -f $(SEDS) ../check/check_derivs_main.f90 > \
$(OBJ)/check_derivs_main.f90
$(CP) ../check/check_derivs_main.f90 $(OBJ)/check_derivs_main.f90
cd $(OBJ); $(FORTRAN) -o check_derivs_main.o \
$(FFLAGS) check_derivs_main.f90 \
|| ( printf ' %-26s' "=> Disabling optimization " ; \
$(FORTRAN) -o check_derivs_main.o $(FFLAGSN) check_derivs_main.f90 )
# cd $(OBJ); $(FORTRAN) -o run_check_derivs_main $(RUNFFLAGS) \
# check_derivs_main.o -L$(OBJ) $(PLIBS) ; $(RM) check_derivs_main.f90
cd $(OBJ); $(RM) check_derivs_main.f90
@printf '[ OK ]\n'

Expand All @@ -113,6 +96,6 @@ clean:

cleanall:
@printf ' %-14s\t\t' \
"Removing all $(PRECIS) precision object and module files"
"Removing all check object and module files"
$(RM) $(OBJ)/* $(MOD)/*
@printf '[ OK ]\n'
Loading

0 comments on commit 9e37be2

Please sign in to comment.