Include AMOS in OpenLibm.

This commit is contained in:
Viral B. Shah 2012-10-29 15:00:54 +05:30
parent 820c38cbd2
commit e8bf368573
4 changed files with 46 additions and 25 deletions

View file

@ -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

View file

@ -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);

View file

@ -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)

View file

@ -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