Commit Graph

1214 Commits

Author SHA1 Message Date
Alex Arslan
fcf6c6a3c8 Fix shared library builds on platforms other than Linux and macOS (#209)
* Fix detection of systems other than Linux and macOS

The way the logic is currently laid out, any platform that isn't Linux
gets assigned the .dylib shared library extension and the macOS-specific
compiler flags. This reverses the logic to check for macOS first, and
have the fallback use the Linux definitions, which apply to most other
systems as well.

* Use SHLIB_EXT instead of SO_SUF

The former is more standard, as jakirkham pointed out in a comment.
2018-05-14 20:41:03 -05:00
Field G. Van Zee
6f7f51048c Echo cc_vendor when printing compiler version.
Details:
- Echo the ${cc_vendor} when informing the user of the compiler's version.
  Previously, the actual ${cc} (which could be a path to the executable)
  was being printed, which has already been printed by that point in the
  configure script.
2018-05-14 18:41:56 -05:00
Field G. Van Zee
ad67dc4e34 Communicate cc, cc_vendor to make via config.mk.
Details:
- Historically, the compiler selection has happened statically in the
  various make_defs.mk and would only be overriden by setting CC (either
  prior to running configure or as a configure argument). However, in
  the last couple months, configure has evolved to contain rather
  sophisticated compiler detection logic for the purposes of blacklisting
  sub-configurations. It only makes sense that configure now fully take
  over the responsibility of selecting a compiler from the GNU make side
  of the build system. Thanks to Alex Arslan for his help exposing this
  issue.
- Substitute found_cc into CC in config.mk via configure.
- Set a new variable, CC_VENDOR, in config.mk via substitution from
  configure, and disable the corresponding CC_VENDOR code in common.mk.
- Disabled default compiler selection (usually gcc) in the sub-configs'
  various make_def.mk files.
2018-05-14 18:35:28 -05:00
Field G. Van Zee
20af119fc9 Added README.md to 'config' directory.
Details:
- Added a brief README.md file to the config directory to redirect those
  who may be exploring the source tree to the ConfigurationHowTo wiki.
  (Included is a very brief explanation of configurations for those who
  don't have time to read the wiki.) Thanks to Nico Schlömer for this
  suggestion.
2018-05-14 17:44:58 -05:00
Field G. Van Zee
9dbce16269 Search for 'cc clang gcc' on OpenBSD, FreeBSD.
Details:
- Swapped gcc and clang in the compiler search list for OpenBSD.
- Use the same search list for FreeBSD as above.
2018-05-14 17:04:54 -05:00
Field G. Van Zee
55ebf24d63 Change compiler search order on OpenBSD.
Details:
- Set a compiler search list (and order) as a function of the OS detected
  via 'uname -s'. By default, this list and order is 'gcc clang cc' for
  Linux and Darwin (OS X), and any other OS except OpenBSD). On OpenBSD,
  we use 'cc gcc clang' because OpenBSD's default installation of gcc
  (4.2.1) is too old for BLIS. Thanks to Alex Arslan for reporting this
  issue and suggesting a fix.
2018-05-14 16:19:08 -05:00
Field G. Van Zee
4fb353bd90 Merge branch 'master' into dev 2018-05-13 17:50:51 -05:00
Field G. Van Zee
8a2857b5e3 Fixed README.md typo; mention 'make check'. 2018-05-11 18:42:05 -05:00
Field G. Van Zee
543935c02f Updated README.md with Ubuntu packages link.
Details:
- Created a separate section of README.md for external packages, with
  one bullet each for Dave Love's rpms and Nico Schlömer's Ubuntu apt
  packages. Thanks to Dave and Nico for their contributions.
2018-05-11 18:35:32 -05:00
Field G. Van Zee
af1d8470b5 Better handling of shared libraries on OS X.
Details:
- Use the .dylib shared library suffix on OS X (instead of .so in Linux).
- Link with the -dynamiclib and -install_name options on OS X (instead of
  -shared and -soname in Linux).
- Determine operating system (e.g. Linux, Darwin) during configure and
  substitute into config.mk.in rather than run 'uname -s' during make.
- Echo operating system during configure.
2018-05-11 17:49:58 -05:00
Field G. Van Zee
4b72a462d7 Enable building shared library by default.
Details:
- Tweaked configure so that the shared library is generated by default.
- Updated --help text and configure's feedback messages reporting the
  status of the static/shared builds.
- Changed the order of build product installation so that headers are
  installed last, after libraries and symlinks.
2018-05-10 18:35:38 -05:00
Field G. Van Zee
b699bb1ff0 Adopt Linux-like .so versioning at install-time.
Details:
- Changed the naming conventions used for installed libraries and
  symlinks to more closely mirror patterns used by typical GNU/Linux
  libraries. Whereas previously static and shared libraries were
  installed and symlinked as follows:

    (library) libblis-0.3.2-15-haswell.a
    (library) libblis-0.3.2-15-haswell.so
    (symlink) libblis.a -> libblis-0.3.2-15-haswell.a
    (symlink) libblis.so -> libblis-0.3.2-15-haswell.so

  we now use the following naming conventions:

    (library) libblis.a
    (symlink) libblis.so -> libblis.so.0.1.2
    (symlink) libblis.so.0 -> libblis.so.0.1.2
    (library) libblis.so.0.1.2

  where 0.1.2 indicates shared library major, minor, and build versions
  of 0, 1, and 2, respectively. The conventional version string can
  still be queried by linking to the library in question and then calling
  bli_info_get_version_str(). (The testsuite binary does this
  automatically at startup.)
- Added logic to common.mk to set the soname field in the shared library
  via the -soname linker flag.
- Added a 'so_version' file to the top-level directory containing two
  lines. The first line specifies the .so major version number, and the
  second line specifies the minor and build version numbers joined with
  a '.'. This file is read by configure and those values substituted
  into build/config.mk.in to define SO_MAJOR, SO_MINORB, and SO_MMB
  variables.
2018-05-10 15:54:17 -05:00
Field G. Van Zee
fc2d9ec6bf Tweaks to top-level clean and distclean targets.
Details:
- Moved the removal of bli_config.h from cleanh to distclean.
- Removed cleantest as a dependency of clean.
2018-05-09 15:19:28 -05:00
Field G. Van Zee
bf03503059 Renamed (shortened) a few build system variables.
Details:
- Renamed the following variables in config.mk (via build/config.mk.in):
    BLIS_ENABLE_VERBOSE_MAKE_OUTPUT -> ENABLE_VERBOSE
    BLIS_ENABLE_STATIC_BUILD        -> MK_ENABLE_STATIC
    BLIS_ENABLE_SHARED_BUILD        -> MK_ENABLE_SHARED
    BLIS_ENABLE_BLAS2BLIS           -> MK_ENABLE_BLAS
    BLIS_ENABLE_CBLAS               -> MK_ENABLE_CBLAS
    BLIS_ENABLE_MEMKIND             -> MK_ENABLE_MEMKIND
  and also renamed all uses of these variables in makefiles and makefile
  fragments. Notice that we use the "MK_" prefix so that those variables
  can be easily differentiated (such as via grep) from their "BLIS_" C
  preprocessor macro counterparts.
- Other whitespace changes to build/config.mk.in.
- Renamed the following C preprocessor macros in bli_config.h (via
  build/bli_config.h.in):
    BLIS_ENABLE_BLAS2BLIS        -> BLIS_ENABLE_BLAS
    BLIS_DISABLE_BLAS2BLIS       -> BLIS_DISABLE_BLAS
    BLIS_BLAS2BLIS_INT_TYPE_SIZE -> BLIS_BLAS_INT_TYPE_SIZE
  and also renamed all relevant uses of these macros in BLIS source
  files.
- Renamed "blas2blis" variable occurrences in configure to "blas", as
  was done in build/config.mk.in and build/bli_config.h.in.
- Renamed the following functions in frame/base/bli_info.c:
    bli_info_get_enable_blas2blis() -> bli_info_get_enable_blas()
    bli_info_get_blas2blis_int_type_size()
                                    -> bli_info_get_blas_int_type_size()
- Remove bli_config.h during 'make cleanh' target of top-level Makefile.
2018-05-08 16:49:22 -05:00
Field G. Van Zee
4b36e85be9 Converted function-like macros to static functions.
Details:
- Converted most C preprocessor macros in bli_param_macro_defs.h and
  bli_obj_macro_defs.h to static functions.
- Reshuffled some functions/macros to bli_misc_macro_defs.h and also
  between bli_param_macro_defs.h and bli_obj_macro_defs.h.
- Changed obj_t-initializing macros in bli_type_defs.h to static
  functions.
- Removed some old references to BLIS_TWO and BLIS_MINUS_TWO from
  bli_constants.h.
- Whitespace changes in select files (four spaces to single tab).
2018-05-08 14:26:30 -05:00
Field G. Van Zee
7e5648ca15 Add configure support for --libdir, --includedir.
Details:
- Added support for two new configure options: --libdir and --includedir.
  They specify the precise install directories for libraries and header
  files, respectively, and override any location implied by the --prefix
  option (including the default install prefix, if --prefix was not
  given). Thanks to Nico Schlömer for suggesting this via issue #195.
- Removed the INSTALL_PREFIX definition/anchor from build/config.mk.in
  and replaced it with corresponding definitions/anchors for libdir and
  includedir.
- Updated top-level Makefile to use the new variables, INSTALL_LIBDIR
  and INSTALL_INCDIR, instead of INSTALL_PREFIX (which is now no longer
  needed by make).
- Set default sane values for INSTALL_LIBDIR and INSTALL_INCDIR in
  common.mk when configure has not been run, as is already done for
  DIST_PATH. This is to safeguard against statements in the top-level
  Makefile that use 'find' to locate old libraries and headers for the
  uninstall targets, which run regardless of make target. Without setting
  INSTALL_LIBDIR and INSTALL_INCDIR, those variables are empty and the
  'find' ends up looking at '/', which is obviously not what we want.
  (Also enclosed those definitions in an IS_CONFIGURED guard so that they
  won't get evaluated unless configure has been run.)
- Rearranged "ifeq ($(IS_CONFIGURED),yes)" conditionals in Makefile to
  reduce occurrences and separated "local" and top-level components of
  cleanblastest and cleanblistest targets to improve readability.
- Adjusted out-of-tree builds so that they are no longer oblivious to
  the .git directories, if present, and thus now properly augment version
  strings with the appropriate patch number.
- Include missing version string in 'configure --help' output.
2018-05-07 18:59:19 -05:00
Field G. Van Zee
b09e4e8852 Allow 'make clean' and friends without configuring.
Details:
- Modified top-level Makefile so that a user can run 'make distclean',
  'make clean', or any of the other clean-related targets prior to
  running configure (or after a previous 'make distclean'). Thanks to
  Nico Schlömer for suggesting this via issue #197.
- Made the cleanblastest and cleanblistest more comprehensive in that
  they now clean out build products that would have resulted from local
  compilation (ie: builds performed within the 'blastest' or 'testsuite'
  directories).
- Added "cc" to list of expected compiler "vendors" since the CC variable
  seems to automatically be set to "cc" on Ubuntu 16.04 (which is just an
  alias to gcc).
- Comment update to build/config.mk.in.
2018-05-07 14:37:50 -05:00
Field G. Van Zee
35c5a1449c No longer update version file during configure.
Details:
- Recycled the core functionality of build/update-version-file.sh into a
  function in configure, disabling the updating of the 'version' file in
  the process. Instead of writing the patched version string back to the
  version file and then reading it again from within configure, the
  patched version string is now saved directly to a variable in the main()
  function in configure. This will prevent developers from accidentally
  committing configure-induced changes to the version file in between
  releases.
2018-05-07 12:04:57 -05:00
Mathieu Poumeyrol
8adb2f919b Some cross compilations fixes (#198)
* cross-compilation fixes
* add doc ranlib variable
* icc support -dumpversion, posix compatible test, plus one stupid mistake
* retab
* revert version as requested
2018-05-06 12:58:16 -05:00
Field G. Van Zee
89acd9ebe5 Merge branch 'amd' 2018-05-02 12:53:35 -05:00
Nisanth M P
4cff432d70 AMD specific optimizations for target 'zen' (#194)
Re-enabled AMD-specific optimizations for zen.

Details:
- Re-enabled Zen-specific cache blocksizes for 'zen' sub-configuration.
- Re-enabled small matrix gemm optimization for 'zen'.
- These were both temporarily disabled during a previous merge simply due to lack of Zen hardware for testing.
2018-05-02 12:50:42 -05:00
Field G. Van Zee
8eda5fe7f6 Typo fix in README.md. 2018-05-02 12:20:37 -05:00
Nisanth M P
0557eba78f Re-enabling the small matrix gemm optimization for target zen
Change-Id: I13872784586984634d728cd99a00f71c3f904395
2018-05-02 11:03:43 +05:30
Nisanth M P
df78ceb3d6 Re-enabling Zen optimized cache block sizes for config target zen
Change-Id: I8191421b876755b31590323c66156d4a814575f1
2018-05-02 11:03:20 +05:30
Field G. Van Zee
5e515f9a76 Tweaked new language in README.md. 2018-05-01 13:44:10 -05:00
Field G. Van Zee
1ddd9e316a Added link to Dave Love's Fedora Copr page.
Details:
- Added a blurb to README.md advertising Dave Love's Copr homepage,
  which contains rpm packages for RHEL/Fedora-like distributions.
2018-05-01 13:36:28 -05:00
Field G. Van Zee
078a852f73 Minor tweaks to top-level 'make clean' target.
Details:
- Execute 'cleanh' target as part of 'clean'
- Remove cblas.h file from 'include/<configname>/' as part of 'cleanh'
  target.
- Updated the echoed (non-verbose) text for uniformity.
2018-04-30 16:15:26 -05:00
Field G. Van Zee
75d0d1057d Renamed various datatype-related macros/functions.
Details:
- Renamed the following macros in bli_obj_macro_defs.h and
  bli_param_macro_defs.h:
  - bli_obj_datatype()                 -> bli_obj_dt()
  - bli_obj_target_datatype()          -> bli_obj_target_dt()
  - bli_obj_execution_datatype()       -> bli_obj_exec_dt()
  - bli_obj_set_datatype()             -> bli_obj_set_dt()
  - bli_obj_set_target_datatype()      -> bli_obj_set_target_dt()
  - bli_obj_set_execution_datatype()   -> bli_obj_set_exec_dt()
  - bli_obj_datatype_proj_to_real()    -> bli_obj_dt_proj_to_real()
  - bli_obj_datatype_proj_to_complex() -> bli_obj_dt_proj_to_complex()
  - bli_datatype_proj_to_real()        -> bli_dt_proj_to_real()
  - bli_datatype_proj_to_complex()     -> bli_dt_proj_to_complex()
- Renamed the following functions in bli_obj.c:
  - bli_datatype_size()                -> bli_dt_size()
  - bli_datatype_string()              -> bli_dt_string()
  - bli_datatype_union()               -> bli_dt_union()
- Removed a pair of old level-1f penryn intrinsics kernels that were no
  longer in use.
2018-04-30 14:57:33 -05:00
Field G. Van Zee
01c4173238 CHANGELOG update (0.3.2) 2018-04-28 14:07:34 -05:00
Field G. Van Zee
2fb4408766 Version file update (0.3.2) 0.3.2 2018-04-28 14:07:31 -05:00
Field G. Van Zee
cdf041ddad Use config.mk instead of common.mk in bump-version.sh.
Details:
- Fixed inadvertent targeting of common.mk when testing whether configure
  had already been run, rather than config.mk.
2018-04-28 14:05:00 -05:00
Field G. Van Zee
6ded8f9f03 Account for recent 'make distclean' in bump-version.sh.
Details:
- Added logic to build/bump-version.sh that will run './configure auto'
  if 'common.mk' is not present (usually because 'make distclean' was run
  recently).
2018-04-28 14:01:29 -05:00
Field G. Van Zee
7c16fdce43 Fixed typo in RELEASING file. 2018-04-28 13:50:55 -05:00
Field G. Van Zee
5e5ca4984f README updates.
Details:
- Updates to the top-level README files in the top-level directory as
  well as the 'examples/oapi' directory.
2018-04-28 13:48:01 -05:00
Field G. Van Zee
627b045e30 Added an example of using transposition with gemm.
Details:
- Added an example to examples/oapi/8level3.c to show how to indicate
  transposition when performing a gemm operation.
2018-04-27 18:11:19 -05:00
Field G. Van Zee
13a0eadc69 Added more transposition/conjugation examples.
Details:
- Added code to examples/oapi/5level1m.c that demonstrates transposing
  (and conjugate-transposing) unstructured matrices.
- Comment updates to 6level1m_diag.c to maintain consistency with new
  examples in 5level1m.c.
2018-04-27 18:00:07 -05:00
Field G. Van Zee
5606cd8881 Added utility module to examples/oapi.
Details:
- Added a new code example file to examples/oapi demonstrating how to use
  various utility operations.
- Comment updates to other example files.
- README updates.
2018-04-27 17:13:10 -05:00
Field G. Van Zee
ff26c94c64 Added missing gcc version constraint for knl.
Details:
- Previously forgot to add explicit enforcement of a minimum gcc version
  in configure script when 'knl' sub-configuration is requested.
- Comment updates to configure.
2018-04-27 12:31:34 -05:00
Field G. Van Zee
4d97574e47 Added object API example code.
Details:
- Added an 'examples' directory at the top level.
- Added an 'oapi' subdirectory in 'examples' that contains a tutorial-like
  sequence of example code demostrating the core functionality of BLIS's
  object-based API, along with a Makefile and README. Thanks to Victor
  Eijkhout for being the first to suggest including such code in BLIS.
2018-04-24 18:48:09 -05:00
Field G. Van Zee
d6ab25a323 Add setijm, getijm operations.
Details:
- Added bli_setgetijm.c, which defines bli_setijm(), bli_getijm(), and
  related functions that can be used to read and write individual
  elements of an obj_t.
- Defined a new function, bli_obj_create_conf_to(), in bli_obj.c that will
  create a new object with dimensions conformal to an existing object.
  Transposition and conjugation states on the existing object are ignored,
  as are structure and uplo fields.
- Defined a new function, bli_datatype_string(), in bli_obj.c that returns
  a char* to a string representation of the name of each num_t datatype.
  For example, BLIS_DOUBLE is "double" and BLIS_DCOMPLEX is "dcomplex".
  BLIS_INT is included (as "int"), but BLIS_CONSTANT is not, and thus is
  not a valid input argument to bli_datatype_string().
- Added calls to bli_init_once() to various functions in bli_obj.c, the
  most important of which was bli_obj_create_without_buffer().
- Removed unintended/extra newline from the end of printv output.
- Whitespace changes to
  - frame/base/bli_machval.c
  - frame/base/bli_machval.h
  - frame/0/copysc/bli_copysc.c
- Trivial changes to README.md and common.mk.
2018-04-24 18:43:03 -05:00
Field G. Van Zee
a731a428f7 Another README.md update. 2018-04-17 16:44:55 -05:00
Field G. Van Zee
c734ee928a README.md update. 2018-04-17 16:40:05 -05:00
Field G. Van Zee
03ecad372d Added RELEASING file.
Details:
- Added a file named 'RELEASING' that contains basic notes on how to
  create a new version/release of BLIS. This is mostly just a reminder
  to myself, but also may become useful if/when others take over
  development and administration of the project.
2018-04-17 14:16:59 -05:00
Field G. Van Zee
24b3c3149c Merge branch 'dev' of github.com:flame/blis into dev 2018-04-16 18:49:38 -05:00
Field G. Van Zee
60366a3fab Updates to knl kernels and related code.
Details:
- Imported the 24x16 knl sgemm microkernel (and its corresonding spackm
  kernel) from TBLIS and enabled its use in the knl sub-config. Also
  Added sgemm microkernel prototype to bli_kernels_knl.h.
- Updated dgemm and dpackm microkernels from TBLIS, which included an
  important change regarding the offsets array (changed from extern
  declaration to static declaration/definition).
- Activated use of level-1v and -1f zen kernels in skx and knl
  sub-configs.
- Removed some old macros no longer needed in bli_family_skx.h now that
  libmemkind support exists in configure.
- Moved bli_avx512_macros.h to frame/include and adjusted #includes in
  skx and knl kernels accordingly.
- Moved unused kernels in kernels/knl/3 to kernels/knl/3/other
  directory.
- Fixed a minor bug in the 'make' output per compile when verboseness
  is not turned on. The rule-generating function 'make-kernel-rule' was
  previously passing in the name of the config, rather than the name of
  the kernel set returned by get-config-for-kset, which could give
  misleading information to the user when the kconfig_map mapped a
  kernel set to a sub-configuration that did not share the same name.
  (This didn't affect the CFLAGS that were actually used.)
- Updated test/3m4m/Makefile, removing acml targets and renaming the
  remaining targets.
2018-04-16 18:46:21 -05:00
Field G. Van Zee
817b67c017 Merge branch 'dev' of github.com:flame/blis into dev 2018-04-16 14:06:26 -05:00
Field G. Van Zee
67c9c2f86d Retired haswell gemm microkernels.
Details:
- Moved microkernels in kernels/haswell/3 to kernels/haswell/3/old. These
  microkernels were no longer being used and only sowed confusion to
  anyone inspecting the repository without being fully cognizant of the
  build system and how it works (and sometimes even to those who wrote
  the build system). Note that the haswell configuration currently
  employs the zen microkernels.
2018-04-16 14:03:12 -05:00
Field G. Van Zee
2b7108a8ef Minor updates to test driver makefiles.
Details:
- Cleaned up and homogenized the various test driver Makefiles in
  testsuite and test directories.
- Very minor updates to test driver code.
2018-04-16 12:35:53 -05:00
Field G. Van Zee
9f56df9557 Trivial tweaks to configure blacklisting output.
Details:
- Updated output of information vis-a-vis configuration blacklisting.
2018-04-11 14:51:36 -05:00
Field G. Van Zee
f56481efeb Cleaned up assembler version query on OS X.
Details:
- Swiched from querying version of 'objdump' to 'as' (e.g. the
  assembler).
- Fixed the outputting of the version of 'as' on OS X, which required
  this beauty:
    ...=$(as -v /dev/null -o /dev/null 2>&1)
- Only add sub-configs to blacklist if the sub-config hasn't already
  been added.
2018-04-10 19:02:21 -05:00