Imported libSDF into VOID tree

This commit is contained in:
Guilhem Lavaux 2013-02-27 13:27:23 -05:00
parent c6dd08bd7d
commit 2d09cb68df
55 changed files with 12667 additions and 0 deletions

View file

@ -0,0 +1,87 @@
# You can override the specification of any of these variables with
# make command line arguments. Those that should not be completely
# replaced require the "override" modifier.
# You can further modify these values in the Make.$(ARCH) files
ifndef defaultPAROS
defaultPAROS:=seq
endif
ifndef defaultCC
defaultCC:=cc
endif
ifndef defaultFC
defaultFC:=g77
endif
ifndef OPTIMIZE
OPTIMIZE:=-O2
CC_SPECIFIC:=$(CC_SPECIFIC) -g -Wall
endif
ifndef FOPTIMIZE
OPTIMIZE=-O
endif
PAROS:=$(defaultPAROS)
CC:=$(defaultCC)
FC:=$(defaultFC)
ifneq ($(PAROS),$(defaultPAROS))
PAROSsuf:=-$(PAROS)
endif
# Put a non-default CC into ARCH
ifneq ($(defaultCC),$(CC))
override ARCH:=$(ARCH)-$(CC)
endif
ifeq ($(FC),g77)
OPTIMIZE:=-O2
FC_SPECIFIC:=$(FC_SPECIFIC) -g -ffast-math
endif
# Some compilers turn off optimization with -g, so we don't specify
# -g by default on those machines.
ifdef DEBUG
override ARCH:=$(ARCH)-g
OPTIMIZE:=
endif
# i.e., specify PROFILE=-p or PROFILE=-pg
ifdef PROFILE
override ARCH:=$(ARCH)-p
endif
ifeq ($(PAROS),pvm)
PAROSCFLAGS:=-I$(PVM_ROOT)/include
LOADLIBES:=$(LOADLIBES) $(PVM_ROOT)/lib/$(PVM_ARCH)/libpvm3.a
endif
ifeq ($(EXTRALIB),efence)
PRELIBS:=$(treedir)/Objfiles/$(ARCH)/libefence.a
programname:=$(programname)-efence
endif
ifndef ARFLAGS
ARFLAGS:=r
endif
ifndef RANLIB
RANLIB:=@echo no ranlib
endif
ifdef fsrc
LD:=$(FC)
else
LD:=$(CC)
endif
objsuf:=.o
libext:=.a
CFLAGS:=$(DEBUG) $(OPTIMIZE) $(PROFILE) $(CC_SPECIFIC) $(ARCH_SPECIFIC)
FFLAGS:=$(DEBUG) $(FOPTIMIZE) $(PROFILE) $(FC_SPECIFIC) $(ARCH_SPECIFIC)
LDFLAGS:=$(DEBUG) $(PROFILE) $(LDFLAGS)

217
external/libsdf/Make-common/Make.generic vendored Normal file
View file

@ -0,0 +1,217 @@
## This is a 'generic' makefile with all the stuff that we seem to
## repeat over and over in all our application (and library!) Makefiles.
incdir=$(treedir)/include/libsdf
objdir=Objfiles/$(ARCH)
libdir=$(treedir)/Objfiles/$(ARCH)
override CFLAGS:=-I$(incdir) $(CFLAGS) $(EXTRACFLAGS)
override LDFLAGS:=$(LDFLAGS) $(EXTRALDFLAGS)
ifndef tarname
tarname:=$(programname)
endif
tarpath:=$(TARPREFIX)$(tarname)
excludepath:=$(TARPREFIX)exclude
# Allow the local directory to do arch-specific stuff...
localmake:=$(wildcard Make.$(ARCH))
ifneq ($(localmake),)
include $(localmake)
endif
ifeq ($(PAROS),$(defaultPAROS))
# we don't need mpmy if we are using the default PAROS!
LIBDEPENDS=$(libdir)/libsw.a
else
LIBDEPENDS=$(libdir)/mpmy_$(PAROS)$(objsuf) \
$(libdir)/libsw.a
endif
# If we're going to the trouble to list out the full directory names
# in LIBDEPENDS, there's not much point in making the linker figure them
# out (possibly erroneously) again with -L... -l...
LOADLIBES_:=$(PRELIBS) $(LIBDEPENDS) -L$(libdir) -lm $(POSTLIBS) $(LOADLIBES)
ifdef programname
bin:=$(programname).$(ARCH)$(PAROSsuf)
# Substitue for the string PAROS in the 'src' variable
# It would be really nice if we could then check to make sure the
# file exists, and if not, substitue with, e.g., "generic". But
# I can't figure out how to do that.
_src:=$(subst PAROS,$(PAROS),$(src))
obj=$(patsubst %.c,$(objdir)/%$(objsuf),$(src)) \
$(patsubst %.cu,$(objdir)/%$(objsuf),$(cusrc)) \
$(patsubst %.f,$(objdir)/%$(objsuf),$(fsrc))
ifndef special_rule_for_all
all: $(bin)
endif
$(bin) : $(objdir) $(obj) $(LIBDEPENDS)
$(LD) $(LDFLAGS) -o $@ $(obj) $(LOADLIBES_)
$(finishlink)
release : $(bin)
rsync -abq $(bin) ../release
else
bin:=
endif
ifdef libname
lib:=$(libdir)/$(libname)$(libext)
libobj=$(patsubst %.c,$(lib)($(objdir)/%$(objsuf)),$(src))
ifeq ($(libname),libsw)
libobj:=$(libobj) $(patsubst %.c,$(lib)($(objdir)/%$(objsuf)),$(swsrc)) \
$(patsubst %.s,$(lib)($(objdir)/%$(objsuf)),$(asmsrc)) \
$(patsubst %.S,$(lib)($(objdir)/%$(objsuf)),$(cppasmsrc))
endif
ifndef special_rule_for_all
all: $(lib)
endif
$(lib) : $(objdir) $(libdir) $(libobj)
$(RANLIB) $@
endif
$(objdir)/%$(objsuf) : %.c
$(CC) $(CFLAGS) -c $<
-@mv $*$(objsuf) $@
$(objdir)/%$(objsuf) : %.cu
$(CUDACC) $(CUDACFLAGS) -c $<
-@mv $*$(objsuf) $@
$(objdir)/%$(objsuf) : %.f
$(FC) $(FFLAGS) -c $<
-@mv $*$(objsuf) $@
$(objdir)/%$(objsuf) : $(asmdir)/%.s
(cd $(asmdir); $(AS) $(ASFLAGS) -o $*$(objsuf) $*.s)
-@mv $(asmdir)/$*$(objsuf) $@
$(objdir)/%$(objsuf) : $(asmdir)/%.S
(cd $(asmdir); $(CC) $(ASFLAGS) -c -o $*$(objsuf) $*.S)
-@mv $(asmdir)/$*$(objsuf) $@
# Gnu tar doesn't seem to do -X exclude properly?? It's probably
# because it uses names without a leading './'. I could add a sed to
# double each line in exclude???
ifndef TAR
TAR=/bin/tar
endif
ifndef FIND
FIND=/usr/bin/find
endif
MAKEDEPEND=makedepend
ifndef RANLIB
RANLIB=/usr/bin/ranlib
endif
$(objdir) :
if [ ! -d Objfiles ]; then mkdir Objfiles; fi
if [ ! -d $(objdir) ]; then mkdir $(objdir); fi
$(libdir) :
if [ ! -d $(treedir)/Objfiles ]; then mkdir $(treedir)/Objfiles; fi
if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
# Use appexcludes to exclude any particular application-specific directories.
# e.g.,
# appexcludes="-name data -prune -o -name secret_dir -prune"
ifdef appexcludes
extraexcludes=\( $(appexcludes) \) -o
endif
ifndef treedir_sed
treedir_sed:=$(treedir)
endif
# Exclude emacs backups (*~), and auto-saves (#*#)
# Exclude anything in one of the object dirs, or misc.*,
# anything named 'core' or *.tar.* or anything that's executable and
# bigger than 10k or anything at all that's bigger than 100k.
# In addition, just in case they don't exist yet, we have to explicitly
# exclude the $(tarname).tar.Z and .gz targets.
# Finally exclude the "proprietary" ibm assembly language
$(excludepath) : FORCE
($(FIND) . $(extraexcludes) -name Objfiles -prune -o -name '*.o' -o -name '#*#' -o -name '*~' -o -name '*-' -o -name '*.bak' -o -name '*.bak2' -o -name Obsolete -o -name NOT_PORTED -o -name '*.orig' -o -name core -o -name 'lsv.core.*' -o -name 'misc.*' -o -name '*.tar.*' -o -name '*gz' -o \( -perm +0111 -and -size +10k \) -o -size +100k -o -name '*readrtc.s*' ; \
echo ./$(tarname).tar.Z ; \
echo ./$(tarname).tgz ; \
echo ./$(tarname)-dist.tgz ; \
) | sed "s/^\.\//`basename $$PWD`\//" > $@
tar : $(tarpath).tgz
dist : $(tarpath)-dist.tgz
$(tarpath).tar.Z: $(excludepath)
(dir=`basename $$PWD`; cd `dirname $$PWD`; $(TAR) cvfX - $$dir/$(excludepath) $$dir)| compress > $(tarpath).tar.Z
$(tarpath).tgz: $(excludepath)
(dir=`basename $$PWD`; cd `dirname $$PWD`; $(TAR) cvfX - $$dir/$(excludepath) $$dir)| gzip > $(tarpath).tgz
$(tarpath)-dist.tgz: $(excludepath)
(dir=`basename $$PWD`; cd `dirname $$PWD`; $(TAR) cvfX - $$dir/$(excludepath) $$dir/COPY* $$dir/Make-common $$dir/INSTRUCTIONS $$dir/GNUmakefile $$dir/include $$dir/relerr $$dir/Change* $$dir/lib* $$dir/bin $$dir/lsv $$dir/shmz $$dir/snsph $$dir/nln)| gzip > $(tarpath)-dist.tgz
# Make a floppy by writing a meta-tar file containing $(tarname).tgz
floppy: $(tarname).tgz
$(TAR) cvf /dev/fd0 $(tarname).tgz
# clean...how much should we attempt to clean up?? Should there be
# additional clean-ables set in the application-makefile?
# clean-clutter will remove the ~ files, the #*#, etc.
clean-clutter: FORCE
rm -f *~ #*# *.bak *.bakk
# clean will remove the binary and object files associated with the
# current ARCH-PAROS pair
clean: FORCE clean-clutter
rm $(bin) $(objdir)/*
# clean-all will attempt to remove all object files in Objfiles/ and
# all executables in . associated with them. USE WITH CARE!!
clean-all: FORCE clean-clutter
for dir in `ls Objfiles`; do \
set arch=`basename $$dir`; \
rm -rf Objfiles/$$dir; \
rm -f $(programname).$$dir* ; \
done
# Run makedepend, and then massage the Makfile to the symbolic names
# for the files in $(treedir). WARNING! If $(treedir) contains
# sed meta-characters you lose in a big way! We fix this by letting you
# override it with $(treedir_sed), e.g., if treedir=.., you should
# probably set treedir_sed=\.\. . This should be automatic :-(.
# This command kills the entire line with the /usr/ dependency.
# -e '/ \/usr/d' Makefile.bak2 > foo
# The sed below leaves lines with no dependency. Is that a problem?
MAKEFILENAME=GNUmakefile
#depends:
# $(MAKEDEPEND) -f$(MAKEFILENAME) '-o$$(objsuf)' '-p$$(objdir)/' -- $(CFLAGS) -- $(src)
# cp $(MAKEFILENAME) $(MAKEFILENAME).bak2
# sed \
# -e '/DO NOT DELETE/,$$s!$(treedir_sed)!$$(treedir)!g'\
# -e '/DO NOT DELETE/,$$s@ /usr/[^ ]*@@g'\
# $(MAKEFILENAME).bak2 > $(MAKEFILENAME)
# The last rule replaces -p$$(objdir)/ which doesn't work in openwin
# and presumably in X11R4 or earlier
depends:
$(MAKEDEPEND) -f$(MAKEFILENAME) '-o$$(objsuf)' -- $(CFLAGS) -- $(src)
cp $(MAKEFILENAME) $(MAKEFILENAME).bak2
sed \
-e '/DO NOT DELETE/,$$s!$(treedir_sed)!$$(treedir)!g'\
-e '/DO NOT DELETE/,$$s@ /usr/[^ ]*@@g'\
-e '/DO NOT DELETE/,$$s@ float.h@@g'\
-e '/DO NOT DELETE/,$$s@ stdarg.h@@g'\
-e '/DO NOT DELETE/,$$s@^\([A-Za-z]\)@$$(objdir)/\1@g'\
$(MAKEFILENAME).bak2 > $(MAKEFILENAME)
depends-nosed:
$(MAKEDEPEND) -f$(MAKEFILENAME) '-o$$(objsuf)' '-p$$(objdir)/' -- $(CFLAGS) -- $(src)
FORCE:

25
external/libsdf/Make-common/Make.x86_64 vendored Normal file
View file

@ -0,0 +1,25 @@
defaultCC:=gcc
CC_SPECIFIC:=-g -Wall
ARCH_SPECIFIC:=-D__iX86__=x86_64 -DLONG_NK1_KEY -DSTK_FORCE_ALIGNMENT=4 -D_FILE_OFFSET_BITS=64 -DUSE_SYSTEM_MALLOC -DUSE_MPIIO -DUSE_HWCLOCK -DPROCS_PER_NODE=8
OPTIMIZE=-O2
AGGRESSIVE_OPT=-Ofast
LDFLAGS=-g
LEX:=flex
YACC:=bison -y
include $(treedir)/Make-common/Make.default
swsrc:=lsv.c swampi.c
asmdir:=asm-sse
asmsrc=
cppasmsrc=
LOADLIBES=-lrt
MPI_ROOT=/softs/openmpi/1.6.4-ifort-13.0-torque-CentOS5
ifeq ($(PAROS),mpi)
LOADLIBES:=-L$(MPI_ROOT)/lib -L$(MPI_ROOT)/lib64 -lmpi
PAROSCFLAGS:=-I$(MPI_ROOT)/include
endif