From e8bf368573491852eb3471299e448461ae2e8e99 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Mon, 29 Oct 2012 15:00:54 +0530 Subject: [PATCH] Include AMOS in OpenLibm. --- LICENSE.md | 20 ++++++++++++++++++-- Make.inc | 29 ++++++++++++++--------------- Makefile | 11 ++++++----- README.md | 11 ++++++++--- 4 files changed, 46 insertions(+), 25 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 9fd1c46..89ac281 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -23,7 +23,7 @@ OpenLIBM is licensed under the MIT LICENSE. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## Derived from FREEBSD MSUN +## FREEBSD MSUN Copyright 1992-2011 The FreeBSD Project. All rights reserved. @@ -54,7 +54,7 @@ OpenLIBM is licensed under the MIT LICENSE. official policies, either expressed or implied, of the FreeBSD Project. -## Derived from FDLIBM +## FDLIBM Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -62,3 +62,19 @@ OpenLIBM is licensed under the MIT LICENSE. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved. + +## AMOS + +The AMOS library is part of SLATEC and covered by the same license. The following +is reproduced from Section 4 of the SLATEC guide (http://www.netlib.org/slatec/guide). + + The Library is in the public domain and distributed by the Energy Science + and Technology Software Center. + + Energy Science and Technology Software Center + P.O. Box 1020 + Oak Ridge, TN 37831 + + Telephone 615-576-2606 + E-mail estsc%a1.adonis.mrouter@zeus.osti.gov + diff --git a/Make.inc b/Make.inc index f05828f..5bd7c55 100644 --- a/Make.inc +++ b/Make.inc @@ -1,6 +1,11 @@ +# -*- mode: makefile-gmake -*- + OS = $(shell uname) ARCH = $(shell uname -m) +FC = gfortran +FFLAGS = -O3 + USEGCC = 1 USECLANG = 0 @@ -18,10 +23,13 @@ endif default: all %.c.o: %.c - $(QUIET_CC)$(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ + +%.f.o: %.f + $(FC) $(FFLAGS) -c $< -o $@ %.S.o: %.S - $(QUIET_ASM)$(CC) $(filter -f% -m% -B% -I% -D%,$(CFLAGS)) -c $< -o $@ + $(CC) $(filter -f% -m% -B% -I% -D%,$(CFLAGS)) -c $< -o $@ clean: rm -fr *.o *.c.o *.S.o *~ test-double test-float test-double-system test-float-system *.dSYM @@ -42,36 +50,27 @@ endif ifeq ($(OS), MINGW32_NT-6.1) OS=WINNT CFLAGS+=-nodefaultlibs +FFLAGS+=-nodefaultlibs endif ifeq ($(OS), Linux) SHLIB_EXT = so CFLAGS+=-fPIC +FFLAGS+=-fPIC endif ifeq ($(OS), FreeBSD) SHLIB_EXT = so CFLAGS+=-fPIC +FFLAGS+=-fPIC endif ifeq ($(OS), Darwin) SHLIB_EXT = dylib CFLAGS+=-fPIC +FFLAGS+=-fPIC endif ifeq ($(OS), WINNT) SHLIB_EXT = dll endif - -# Colors for make - -CCCOLOR="\033[34m" -LINKCOLOR="\033[34;1m" -SRCCOLOR="\033[33m" -BINCOLOR="\033[37;1m" -MAKECOLOR="\033[32;1m" -ENDCOLOR="\033[0m" - -QUIET_CC = @printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR); -QUIET_ASM = @printf ' %b %b\n' $(CCCOLOR)ASM$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR); -QUIET_LINK = @printf ' %b %b\n' $(LINKCOLOR)LINK$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR); diff --git a/Makefile b/Makefile index 0f284ec..f3e5a63 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ OPENLIBM_HOME=$(abspath .) include ./Make.inc -SUBDIRS = src ld80 $(ARCH) bsdsrc +SUBDIRS = src ld80 $(ARCH) bsdsrc amos define INC_template TEST=test @@ -17,15 +17,16 @@ $(foreach dir,$(SUBDIRS),$(eval $(call INC_template,$(dir)))) DUPLICATE_NAMES = $(filter $(patsubst %.S,%,$($(ARCH)_SRCS)),$(patsubst %.c,%,$(src_SRCS))) DUPLICATE_SRCS = $(addsuffix .c,$(DUPLICATE_NAMES)) -OBJS = $(patsubst %.S,%.S.o,\ - $(patsubst %.c,%.c.o,$(filter-out $(addprefix src/,$(DUPLICATE_SRCS)),$(SRCS)))) +OBJS = $(patsubst %.f,%.f.o,\ + $(patsubst %.S,%.S.o,\ + $(patsubst %.c,%.c.o,$(filter-out $(addprefix src/,$(DUPLICATE_SRCS)),$(SRCS))))) all: libopenlibm.a libopenlibm.$(SHLIB_EXT) $(MAKE) -C test libopenlibm.a: $(OBJS) - $(QUIET_LINK)ar -rcs libopenlibm.a $(OBJS) + ar -rcs libopenlibm.a $(OBJS) libopenlibm.$(SHLIB_EXT): $(OBJS) - $(QUIET_LINK)$(CC) -shared $(OBJS) -o libopenlibm.$(SHLIB_EXT) + $(FC) -shared $(OBJS) -o libopenlibm.$(SHLIB_EXT) distclean: rm -f $(OBJS) *.a *.$(SHLIB_EXT) diff --git a/README.md b/README.md index 481303a..c202df0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ -## OpenLIBM v0.2 +## OpenLibm -OpenLIBM is an effort to have a high quality standalone LIBM +OpenLibm is an effort to have a high quality standalone LIBM library. It is meant to be used standalone in applications and programming language implementations. -OpenLIBM builds on Linux, Mac OS X, and Windows, and with little effort, +OpenLibm also includes the AMOS library from Netlib, which is +a portable package for Bessel Functions of a Complex Argument +and Nonnegative Order. AMOS contains subroutines for computing Bessel +functions and Airy functions. + +OpenLibm builds on Linux, Mac OS X, and Windows, and with little effort, should build on FreeBSD as well. It builds with both, GCC and clang. The OpenLIBM code derives from the FreeBSD msun implementation, which