Skip to content

Commit

Permalink
Merge master code 2018-10-25 to amd-staging-rel1.3 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
cpulib-git committed Jan 1, 2019
2 parents f92e789 + 550cdcf commit 10c9201
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 207 deletions.
99 changes: 62 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Makefile
#
# Field G. Van Zee
#
#
# Top-level makefile for libflame linear algebra library.
#
#
Expand Down Expand Up @@ -89,18 +89,18 @@ ALL_FLAMEC_DLL_NAME := libflame.so
MK_ALL_FLAMEC_LIB := $(BASE_LIB_DIR)/$(ALL_FLAMEC_LIB_NAME)
MK_ALL_FLAMEC_DLL := $(BASE_LIB_DIR)/$(ALL_FLAMEC_DLL_NAME)

MK_BASE_FLAMEC_SRC :=
MK_BASE_FLAMEC_OBJS :=
MK_BASE_FLAMEC_SRC :=
MK_BASE_FLAMEC_OBJS :=

MK_BLAS_FLAMEC_SRC :=
MK_BLAS_FLAMEC_OBJS :=
MK_BLAS_FLAMEC_SRC :=
MK_BLAS_FLAMEC_OBJS :=

MK_LAPACK_FLAMEC_SRC :=
MK_LAPACK_FLAMEC_OBJS :=
MK_LAPACK_FLAMEC_SRC :=
MK_LAPACK_FLAMEC_OBJS :=


MK_MAP_LAPACK2FLAMEC_SRC :=
MK_MAP_LAPACK2FLAMEC_OBJS :=
MK_MAP_LAPACK2FLAMEC_SRC :=
MK_MAP_LAPACK2FLAMEC_OBJS :=

MK_MAP_LAPACK2FLAMEC_F2C_SRC :=
MK_MAP_LAPACK2FLAMEC_F2C_OBJS :=
Expand All @@ -111,8 +111,8 @@ MK_MAP_LAPACK2FLAMEC_F2C_FLAMEC_OBJS :=
MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_SRC :=
MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_OBJS :=

MK_FLABLAS_F2C_SRC :=
MK_FLABLAS_F2C_OBJS :=
MK_FLABLAS_F2C_SRC :=
MK_FLABLAS_F2C_OBJS :=

# --- Define install target names for static libraries ---
MK_FLAMEC_LIBS := $(MK_ALL_FLAMEC_LIB)
Expand Down Expand Up @@ -242,6 +242,7 @@ FFLAGS := $(FFLAGS) $(INCLUDE_PATHS)
# Convert source file paths to object file paths by replaying the base source
# directory with the base object directory, and also replacing the source file
# suffix (ie: '.c' or '.f') with '.o'.

MK_FLABLAS_F2C_OBJS := $(patsubst $(SRC_DIR)/%.c, $(BASE_OBJ_DIR)/%.o, \
$(filter %.c, $(MK_FLABLAS_F2C_SRC)))

Expand Down Expand Up @@ -269,7 +270,7 @@ MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_OBJS := $(patsubst $(SRC_DIR)/%.c, $(BASE_OBJ_D
# Combine the base, blas, and lapack libraries.
MK_ALL_FLAMEC_OBJS := $(MK_BASE_FLAMEC_OBJS) \
$(MK_BLAS_FLAMEC_OBJS) \
$(MK_LAPACK_FLAMEC_OBJS)
$(MK_LAPACK_FLAMEC_OBJS)

# Prepend the flablas source code files, if requested

Expand All @@ -288,13 +289,13 @@ ifeq ($(FLA_ENABLE_LAPACK2FLAME),no)
MK_FLABLAS_F2C_OBJS := $(MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_OBJS) \
$(MK_FLABLAS_F2C_OBJS)
endif

MK_ALL_FLAMEC_OBJS := $(MK_FLABLAS_F2C_OBJS) \
$(MK_ALL_FLAMEC_OBJS)
endif

### Kyungjoo 2015.10.21
AR_CHUNK_SIZE=4096
#AR_CHUNK_SIZE=4096
AR_CHUNK_SIZE=1024

#
# --- Targets/rules ------------------------------------------------------------
Expand Down Expand Up @@ -373,63 +374,88 @@ endif

# --- Static library archiver rules for libflame ---
$(MK_ALL_FLAMEC_LIB): $(MK_ALL_FLAMEC_OBJS)

ifeq ($(FLA_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
### Kyungjoo 2015.10.21
$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $@
### Previous hack (works on linux, not on osx)
### Previous hack (works on linux, not on osx; osx's ar does not support @file)
# echo $(ARFLAGS) $@ > $(AR_ARG_LIST_FILE)
# $(CAT) $(AR_OBJ_LIST_FILE) >> $(AR_ARG_LIST_FILE)
# $(AR) @$(AR_ARG_LIST_FILE)
$(RANLIB) $@
else
$(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
$(AR) $(ARFLAGS) $@ $^
endif
$(RANLIB) $@
mkdir -p include_local
cp -f $(MK_HEADER_FILES) include_local
else
@echo "Archiving $@"
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
### Kyungjoo 2015.10.21
@$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $@
### Previous hack (works on linux, not on osx)
### Previous hack (works on linux, not on osx; osx's ar does not support @file)
# @echo $(ARFLAGS) $@ > $(AR_ARG_LIST_FILE)
# @$(CAT) $(AR_OBJ_LIST_FILE) >> $(AR_ARG_LIST_FILE)
# @$(AR) @$(AR_ARG_LIST_FILE)
@$(RANLIB) $@
else
@$(AR) $(ARFLAGS) $@ $?
@$(RANLIB) $@
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
@$(AR) $(ARFLAGS) $@ $^
endif
@$(RANLIB) $@
@mkdir -p include_local
@cp -f $(MK_HEADER_FILES) include_local
endif



# --- Dynamic library linker rules for libflame ---
$(MK_ALL_FLAMEC_DLL): $(MK_ALL_FLAMEC_OBJS)
ifeq ($(FLA_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
$(file > [email protected],$^)
$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @[email protected]
$(RM) [email protected]
$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @$(AR_OBJ_LIST_FILE)
else
$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $?
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $^
endif
else
@echo "Dynamically linking $@"
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
@$(file > [email protected],$^)
@$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @[email protected]
@$(RM) [email protected]
@$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @$(AR_OBJ_LIST_FILE)
else
@$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $?
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
@$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $^
endif
endif

# Original implementation of the rule above.
# FGVZ: This rule has been observed to not work on at least one system, where
# it appears the ".in" file is not fully written out, or written out at all,
# prior to the shared library link command being executed.
#$(MK_ALL_FLAMEC_DLL): $(MK_ALL_FLAMEC_OBJS)
#ifeq ($(FLA_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
#ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
# $(file > [email protected],$^)
# $(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @[email protected]
# $(RM) [email protected]
#else
# $(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $^
#endif
#else
# @echo "Dynamically linking $@"
#ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
# @$(file > [email protected],$^)
# @$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @[email protected]
# @$(RM) [email protected]
#else
# @$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $^
#endif
#endif




# --- Test suite rules ---
Expand Down Expand Up @@ -533,11 +559,10 @@ endif

# --- Clean rules ---
cleanmost: check-config
- $(FIND) $(BASE_OBJ_DIR) -name "*.o" | $(XARGS) $(RM_F)
- $(FIND) $(BASE_LIB_DIR) -name "*.a" | $(XARGS) $(RM_F)
- $(FIND) $(BASE_LIB_DIR) -name "*.so" | $(XARGS) $(RM_F)
- $(FIND) $(BASE_OBJ_DIR) -name "*.o" | $(XARGS) $(RM_F)
- $(FIND) $(BASE_LIB_DIR) -name "*.a" | $(XARGS) $(RM_F)
- $(FIND) $(BASE_LIB_DIR) -name "*.so" | $(XARGS) $(RM_F)
- $(RM_F) $(AR_OBJ_LIST_FILE)
# - $(RM_F) $(AR_ARG_LIST_FILE)
- $(RM_F) $(INCLUDE_LOCAL)/*.h

distclean: check-config cleanmost cleanmk
Expand All @@ -551,7 +576,7 @@ distclean: check-config cleanmost cleanmk
- $(RM_RF) config.sys_type

cleanmk: check-config
- $(FIND) $(SRC_DIR) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
- $(FIND) $(SRC_DIR) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)

cleanleaves: check-config
- $(FIND) $(SRC_DIR) -name "*.[osx]" | $(XARGS) $(RM_F)
Expand Down
13 changes: 4 additions & 9 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@

libflame library
README
---

Thank you for deciding to try out the libflame library!
# libflame library

libflame is a portable library for dense matrix computations, providing
much of the functionality present in LAPACK. In fact, libflame includes
Expand All @@ -30,18 +25,18 @@ source. You may also find a nightly build of the document here:
You can keep in touch with developers and other users of the project by
joining the following mailing list:

o libflame-discuss - http://groups.google.com/group/libflame-discuss
- libflame-discuss - http://groups.google.com/group/libflame-discuss
Please join and post to this mailing list if you have general questions
or feedback regarding libflame.

o (NOTE: We do not yet have a developer's mailing list. For now,
- (NOTE: We do not yet have a developer's mailing list. For now,
developers and those with developer-related questions can simply post
to libflame-discuss.

Also, please read the LICENSE file for information on copying and
distributing this software.

Thanks again for your interest in libflame!
Thanks for your interest in libflame!

Regards,

Expand Down
60 changes: 0 additions & 60 deletions build/ac-macros/fla_check_with_extra_cflags.m4

This file was deleted.

4 changes: 4 additions & 0 deletions build/ac-macros/fla_set_c_sse_flags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ AC_DEFUN([FLA_SET_C_SSE_FLAGS],
gcc)
fla_c_sse_flags='-msse3'
;;
dnl Clang.
clang)
fla_c_sse_flags='-msse3'
;;
dnl PathScale pathcc
pathcc)
fla_c_sse_flags='unknown'
Expand Down
28 changes: 11 additions & 17 deletions build/config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ FLA_ENABLE_BUILTIN_BLAS := @fla_enable_builtin_blas@
FLA_ENABLE_LAPACK2FLAME := @fla_enable_lapack2flame@
FLA_MULTITHREADING_MODEL := @fla_multithreading_model@

# Alias the variable 'V' to the flag for verbosity.
ifeq ($(V),1)
FLA_ENABLE_VERBOSE_MAKE_OUTPUT := yes
endif




Expand Down Expand Up @@ -90,26 +95,15 @@ endif

# Aggregate all of the flags into two groups: one for optimizable code, and
# one for code that should not be optimized.
CFLAGS := $(CDBGFLAGS) $(COPTFLAGS) $(CVECFLAGS) $(CWARNFLAGS) $(CMISCFLAGS) $(CPPROCFLAGS)
CFLAGS_NOOPT := $(CDBGFLAGS) $(CWARNFLAGS) $(CMISCFLAGS) $(CPPROCFLAGS)

# If the user requested that he supplement configure's CFLAGS with this own,
# add them in.
# *** Notice that we ALSO modify the 'no optimization' set of flags.
# THIS IS DANGEROUS. THE USER MUST TAKE CARE NOT TO ADD "EXTRA FLAGS"
# THAT WOULD DISRUPT THE NUMERICAL PROPERTIES OF SLAMCH/DLAMCH. ***
ifeq (@fla_with_extra_cflags@,yes)
CFLAGS += @fla_extra_cflags@
CFLAGS_NOOPT += @fla_extra_cflags@
endif
CFLAGS := $(strip $(CDBGFLAGS) $(COPTFLAGS) $(CVECFLAGS) $(CWARNFLAGS) $(CMISCFLAGS) $(CPPROCFLAGS))
CFLAGS_NOOPT := $(strip $(CDBGFLAGS) $(CWARNFLAGS) $(CMISCFLAGS) $(CPPROCFLAGS))

# If the user provided his own CFLAGS, allow them to override our own.
# *** Notice that we ALSO modify the 'no optimization' set of flags.
# THIS IS DANGEROUS. THE USER MUST TAKE CARE NOT TO ADD "EXTRA FLAGS"
# THAT WOULD DISRUPT THE NUMERICAL PROPERTIES OF SLAMCH/DLAMCH. ***
# *** Notice that wo do not also modify the 'no optimization' set of flags.
# We do this to avoid potential numerical disruption of routines such
# as slamch/dlamch.
ifneq (@fla_userdef_cflags@,)
CFLAGS := @CFLAGS@
CFLAGS_NOOPT := @CFLAGS@
CFLAGS := @CFLAGS@ $(CFLAGS)
endif


Expand Down
2 changes: 1 addition & 1 deletion build/gen-make-frags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
#

# Generate makefile fragments recursively, level 1 verbosity.
./build/gen-make-frag.sh -rhv1 build/templates/fragment.mk src
./build/gen-make-frag.sh -rhv0 build/templates/fragment.mk src

9 changes: 3 additions & 6 deletions build/post-configure.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ echo " C compiler debug flags....................... : @fla_c_debug_flags@"
echo "Enable compiler profiling symbols............... : @fla_enable_compiler_profiling@"
echo " C compiler profiling flags................... : @fla_c_prof_flags@"

echo ""
echo "User-specified CFLAGS (prepended)............... : @fla_userdef_cflags@"

echo ""
echo "Enable internal error checking.................. : @fla_enable_internal_error_checking@"
if [ "@fla_enable_internal_error_checking@" = "yes" ] ; then
Expand Down Expand Up @@ -142,12 +145,6 @@ echo " Unmangled name............................... : @fla_f77_foobar_unmangl
echo " Mangled name................................. : @fla_f77_foobar_mangled@"
fi

echo ""
echo "Compile with extra C compiler flags............. : @fla_with_extra_cflags@"
if [ "@fla_with_extra_cflags@" = "yes" ] ; then
echo " User-requested extra C compiler flags........ : @fla_extra_cflags@"
fi

echo ""
echo "libflame install directory prefix............... : @prefix@"
echo ""
Expand Down
Loading

0 comments on commit 10c9201

Please sign in to comment.