Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This is update for configure, build and install of vector math library.
Installation of libm.so as linker script only in case of libmvec.so build.

2015-05-14  Andrew Senkevich  <andrew.n.senkevich@gmail.com>

    * Makeconfig (rpath-dirs, all-subdirs): Added mathvec folder.
    (libmvec): New variable.
    * configure.ac: Added option for mathvec build.
    * configure: Regenerated.
    * mathvec/Depend: New file.
    * mathvec/Makefile: New file.
    * shlib-versions: Added libmvec.
    * math/Makefile: Added rule for libm.so installation.
  • Loading branch information
Andrew Senkevich committed May 14, 2015
1 parent 202d48d commit 5695d46
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
@@ -1,5 +1,14 @@
2015-05-14 Andrew Senkevich <andrew.senkevich@intel.com> 2015-05-14 Andrew Senkevich <andrew.senkevich@intel.com>


* Makeconfig (rpath-dirs, all-subdirs): Added mathvec folder.
(libmvec): New variable.
* configure.ac: Added option for mathvec build.
* configure: Regenerated.
* mathvec/Depend: New file.
* mathvec/Makefile: New file.
* shlib-versions: Added libmvec.
* math/Makefile: Added rule for libm.so installation.

* bits/math-vector.h: New file. * bits/math-vector.h: New file.
* bits/libm-simd-decl-stubs.h: New header. * bits/libm-simd-decl-stubs.h: New header.
* math/Makefile (headers): Added new header * math/Makefile (headers): Added new header
Expand Down
6 changes: 4 additions & 2 deletions Makeconfig
Expand Up @@ -498,7 +498,7 @@ link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
link-libc-tests = $(link-libc-tests-rpath-link) \ link-libc-tests = $(link-libc-tests-rpath-link) \
$(link-libc-before-gnulib) $(gnulib-tests) $(link-libc-before-gnulib) $(gnulib-tests)
# This is how to find at build-time things that will be installed there. # This is how to find at build-time things that will be installed there.
rpath-dirs = math elf dlfcn nss nis rt resolv crypt rpath-dirs = math elf dlfcn nss nis rt resolv crypt mathvec
rpath-link = \ rpath-link = \
$(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%))) $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
else else
Expand Down Expand Up @@ -1074,8 +1074,10 @@ endif


ifeq ($(build-shared),yes) ifeq ($(build-shared),yes)
libm = $(common-objpfx)math/libm.so$(libm.so-version) libm = $(common-objpfx)math/libm.so$(libm.so-version)
libmvec = $(common-objpfx)mathvec/libmvec.so$(libmvec.so-version)
else else
libm = $(common-objpfx)math/libm.a libm = $(common-objpfx)math/libm.a
libmvec = $(common-objpfx)mathvec/libmvec.a
endif endif


# These are the subdirectories containing the library source. The order # These are the subdirectories containing the library source. The order
Expand All @@ -1085,7 +1087,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
stdlib stdio-common libio malloc string wcsmbs time dirent \ stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \ grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \ gnulib iconv iconvdata wctype manual shadow gshadow po argp \
crypt localedata timezone rt conform debug \ crypt localedata timezone rt conform debug mathvec \
$(add-on-subdirs) dlfcn elf $(add-on-subdirs) dlfcn elf


ifndef avoid-generated ifndef avoid-generated
Expand Down
17 changes: 17 additions & 0 deletions configure
Expand Up @@ -777,6 +777,7 @@ enable_systemtap
enable_build_nscd enable_build_nscd
enable_nscd enable_nscd
enable_pt_chown enable_pt_chown
enable_mathvec
with_cpu with_cpu
' '
ac_precious_vars='build_alias ac_precious_vars='build_alias
Expand Down Expand Up @@ -1441,6 +1442,8 @@ Optional Features:
--disable-build-nscd disable building and installing the nscd daemon --disable-build-nscd disable building and installing the nscd daemon
--disable-nscd library functions will not contact the nscd daemon --disable-nscd library functions will not contact the nscd daemon
--enable-pt_chown Enable building and installing pt_chown --enable-pt_chown Enable building and installing pt_chown
--enable-mathvec Enable building and installing mathvec [default
depends on architecture]
Optional Packages: Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -3845,6 +3848,14 @@ gnu*)
;; ;;
esac esac


# Check whether --enable-mathvec was given.
if test "${enable_mathvec+set}" = set; then :
enableval=$enable_mathvec; build_mathvec=$enableval
else
build_mathvec=notset
fi


# We keep the original values in `$config_*' and never modify them, so we # We keep the original values in `$config_*' and never modify them, so we
# can write them unchanged into config.make. Everything else uses # can write them unchanged into config.make. Everything else uses
# $machine, $vendor, and $os, and changes them whenever convenient. # $machine, $vendor, and $os, and changes them whenever convenient.
Expand Down Expand Up @@ -7215,6 +7226,12 @@ $as_echo "running configure fragment for $dir" >&6; }
fi fi
done done


if test x"$build_mathvec" = xnotset; then
build_mathvec=no
fi
config_vars="$config_vars
build-mathvec = $build_mathvec"







Expand Down
11 changes: 11 additions & 0 deletions configure.ac
Expand Up @@ -381,6 +381,12 @@ gnu*)
;; ;;
esac esac


AC_ARG_ENABLE([mathvec],
[AS_HELP_STRING([--enable-mathvec],
[Enable building and installing mathvec @<:@default depends on architecture@:>@])],
[build_mathvec=$enableval],
[build_mathvec=notset])

# We keep the original values in `$config_*' and never modify them, so we # We keep the original values in `$config_*' and never modify them, so we
# can write them unchanged into config.make. Everything else uses # can write them unchanged into config.make. Everything else uses
# $machine, $vendor, and $os, and changes them whenever convenient. # $machine, $vendor, and $os, and changes them whenever convenient.
Expand Down Expand Up @@ -1994,6 +2000,11 @@ for dir in $sysnames; do
fi fi
done done


if test x"$build_mathvec" = xnotset; then
build_mathvec=no
fi
LIBC_CONFIG_VAR([build-mathvec], [$build_mathvec])

AC_SUBST(libc_extra_cflags) AC_SUBST(libc_extra_cflags)
AC_SUBST(libc_extra_cppflags) AC_SUBST(libc_extra_cppflags)


Expand Down
16 changes: 16 additions & 0 deletions math/Makefile
Expand Up @@ -86,6 +86,22 @@ generated += $(foreach s,.c .S l.c l.S f.c f.S,$(calls:s_%=m_%$s))
routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts)) routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts))
long-c-yes = $(calls:=l) long-c-yes = $(calls:=l)


ifeq ($(build-mathvec),yes)
# We need to install libm.so as linker script
# for more comfortable use of vector math library.
install-lib-ldscripts := libm.so
install_subdir: $(inst_libdir)/libm.so
$(inst_libdir)/libm.so: $(common-objpfx)format.lds \
$(libm) \
$(libmvec) \
$(+force)
(echo '/* GNU ld script'; echo '*/';\
cat $<; \
echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \
'AS_NEEDED ( $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
) > $@
endif

# Rules for the test suite. # Rules for the test suite.
tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \ tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \ test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \
Expand Down
1 change: 1 addition & 0 deletions mathvec/Depend
@@ -0,0 +1 @@
math
35 changes: 35 additions & 0 deletions mathvec/Makefile
@@ -0,0 +1,35 @@
# Copyright (C) 2014-2015 Free Software Foundation, Inc.
# This file is part of the GNU C Library.

# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.

# Makefile for the vector math library.

subdir := mathvec

include ../Makeconfig

ifeq ($(build-mathvec),yes)
extra-libs := libmvec
extra-libs-others = $(extra-libs)

libmvec-routines = $(strip $(libmvec-support))

$(objpfx)libmvec.so: $(libm)
endif

# Rules for the test suite are in math directory.

include ../Rules
3 changes: 3 additions & 0 deletions shlib-versions
Expand Up @@ -71,3 +71,6 @@ libanl=1
# This defines the libgcc soname version this glibc is to load for # This defines the libgcc soname version this glibc is to load for
# asynchronous cancellation to work correctly. # asynchronous cancellation to work correctly.
libgcc_s=1 libgcc_s=1

# The vector math library
libmvec=1

0 comments on commit 5695d46

Please sign in to comment.