Commit 40b2164b authored by Dmytro Kresan's avatar Dmytro Kresan
Browse files

Changes needed for Spack 0.17.0

parent 9de26b8b
......@@ -5,19 +5,20 @@
- openmpi@3.1.6 schedulers=slurm +pmi +pmix ~pmix-dstore +thread_multiple +legacylaunchers fabrics=verbs
- osu-micro-benchmarks
- scalasca
- hdf5+mpi+fortran+hl
- mpfr@3.1.6
- amd.blis
- amd.libflame
- amd.fftw
- amd-scalapack
- hdf5+mpi+fortran+hl+cxx
- mpfr
- amdblis
- amdlibflame
- amdfftw
- amdscalapack
- openblas
- tmux
- screen
- gsl@2.5
- gsl
- py-matplotlib
- py-numpy@1.18.5
- py-numpy
- py-pandas
- py-tensorflow~cuda~nccl
- protobuf@3.11.2
concretization: together
view: false
......@@ -3,7 +3,8 @@
- pmix@2.2.2
- slurm@18-08-9-1 +pmix sysconfdir=/etc/slurm
- openmpi@3.1.6%intel@19.1.1.217 schedulers=slurm +pmi +pmix ~pmix-dstore +thread_multiple +legacylaunchers fabrics=verbs
- hdf5@1.10.6+mpi+fortran+hl
- openblas
- hdf5@1.10.6+mpi+fortran+hl+cxx
- openblas@0.3.10
- libgcrypt@1.8.5
concretization: together
view: false
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.pkg.vae_backports.blis import BlisBase
class Amdblis(BlisBase):
"""AMD Optimized BLIS.
BLIS is a portable software framework for instantiating high-performance
BLAS-like dense linear algebra libraries. The framework was designed to
isolate essential kernels of computation that, when optimized, immediately
enable optimized implementations of most of its commonly used and
computationally intensive operations.
"""
_name = 'amdblis'
homepage = "https://developer.amd.com/amd-aocl/blas-library/"
url = "https://github.com/amd/blis/archive/3.0.tar.gz"
git = "https://github.com/amd/blis.git"
maintainers = ['amd-toolchain-support']
version('3.0', sha256='ac848c040cd6c3550fe49148dbdf109216cad72d3235763ee7ee8134e1528517')
version('2.2', sha256='e1feb60ac919cf6d233c43c424f6a8a11eab2c62c2c6e3f2652c15ee9063c0c9')
def configure_args(self):
spec = self.spec
args = super(Amdblis, self).configure_args()
if spec.satisfies('@3.0 %aocc'):
""" To enabled Fortran to C calling convention for
complex types when compiling with aocc flang"""
args.append('CFLAGS={0}'.format("-DAOCL_F2C"))
args.append('CXXFLAGS={0}'.format("-DAOCL_F2C"))
return args
--- a/configure 2020-09-09 18:44:01.241188553 +0530
+++ b/configure 2020-09-09 18:46:51.672191301 +0530
@@ -6513,6 +6513,9 @@
gcc)
fla_c_openmp_flags='-fopenmp'
;;
+ clang)
+ fla_c_openmp_flags='-fopenmp'
+ ;;
pathcc)
fla_c_openmp_flags='-mp'
;;
commit 8c06c4fd8b3f5b41431a06eb72bcc827b729db86
Author: Tiziano Müller <tiziano.mueller@chem.uzh.ch>
Date: Mon Jun 14 22:20:17 2021 +0200
use separate whole-archive/no-whole-archive to fix build with Cray compiler wrappers
diff --git a/Makefile b/Makefile
index d50f9d19..0c7c15c4 100644
--- a/Makefile
+++ b/Makefile
@@ -566,7 +566,7 @@ ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
ifeq ($(OS_NAME),Darwin)
$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS)
else
- $(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive,$(LIBFLAME_A),--no-whole-archive $(LDFLAGS)
+ $(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive $(LIBFLAME_A) -Wl,--no-whole-archive $(LDFLAGS)
endif
else
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
@@ -580,7 +580,7 @@ ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
ifeq ($(OS_NAME),Darwin)
@$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS)
else
- @$(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive,$(LIBFLAME_A),--no-whole-archive $(LDFLAGS)
+ @$(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive $(LIBFLAME_A) -Wl,--no-whole-archive $(LDFLAGS)
endif
else
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
# ----------------------------------------------------------------------------\
from spack.pkg.vae_backports.libflame import LibflameBase
class Amdlibflame(LibflameBase):
"""libFLAME (AMD Optimized version) is a portable library for
dense matrix computations, providing much of the functionality
present in Linear Algebra Package (LAPACK). It includes a
compatibility layer, FLAPACK, which includes complete LAPACK
implementation.
The library provides scientific and numerical computing communities
with a modern, high-performance dense linear algebra library that is
extensible, easy to use, and available under an open source
license. libFLAME is a C-only implementation and does not
depend on any external FORTRAN libraries including LAPACK.
There is an optional backward compatibility layer, lapack2flame
that maps LAPACK routine invocations to their corresponding
native C implementations in libFLAME. This allows legacy
applications to start taking advantage of libFLAME with
virtually no changes to their source code.
In combination with BLIS library which includes optimizations
for the AMD EPYC processor family, libFLAME enables running
high performing LAPACK functionalities on AMD platform.
"""
_name = 'amdlibflame'
homepage = "https://developer.amd.com/amd-cpu-libraries/blas-library/#libflame"
url = "https://github.com/amd/libflame/archive/3.0.tar.gz"
git = "https://github.com/amd/libflame.git"
maintainers = ['amd-toolchain-support']
version('3.0', sha256='d94e08b688539748571e6d4c1ec1ce42732eac18bd75de989234983c33f01ced')
version('2.2', sha256='12b9c1f92d2c2fa637305aaa15cf706652406f210eaa5cbc17aaea9fcfa576dc')
patch('aocc-2.2.0.patch', when="@:2", level=1)
patch('cray-compiler-wrapper.patch')
provides('flame@5.2', when='@2:')
depends_on('python+pythoncmd', type='build')
@property
def lapack_libs(self):
"""find lapack_libs function"""
shared = True if '+shared' in self.spec else False
return find_libraries(
'libflame', root=self.prefix, shared=shared, recursive=True
)
def configure_args(self):
"""configure_args function"""
args = super(Amdlibflame, self).configure_args()
args.append("--enable-external-lapack-interfaces")
"""To enabled Fortran to C calling convention for
complex types when compiling with aocc flang"""
if "@3.0: %aocc" in self.spec:
args.append("--enable-f2c-dotc")
return args
def install(self, spec, prefix):
"""make install function"""
# make install in parallel fails with message 'File already exists'
make("install", parallel=False)
From bc16ec7d1e2a30ce4a751255b70c9cbe87409e4f Mon Sep 17 00:00:00 2001
From: "Field G. Van Zee" <field@cs.utexas.edu>
Date: Mon, 23 Sep 2019 15:37:33 -0500
Subject: [PATCH] Set execute bits of shared library at install-time.
Details:
- Modified the 0644 octal code used during installation of shared
libraries to 0755 (for Linux/OSX only). Thanks to Adam J. Stewart
for reporting this issue via #343.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 9cc81c9d..3c0e27f3 100644
--- a/Makefile
+++ b/Makefile
@@ -953,11 +953,11 @@ ifeq ($(IS_WIN),no)
$(INSTALL_LIBDIR)/%.$(LIBBLIS_SO_MMB_EXT): $(BASE_LIB_PATH)/%.$(SHLIB_EXT) $(CONFIG_MK_FILE)
ifeq ($(ENABLE_VERBOSE),yes)
$(MKDIR) $(@D)
- $(INSTALL) -m 0644 $< $@
+ $(INSTALL) -m 0755 $< $@
else
@echo "Installing $(@F) into $(INSTALL_LIBDIR)/"
@$(MKDIR) $(@D)
- @$(INSTALL) -m 0644 $< $@
+ @$(INSTALL) -m 0755 $< $@
endif
else # ifeq ($(IS_WIN),yes)
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
# Although this looks like an Autotools package, it's not one. Refer to:
# https://github.com/flame/blis/issues/17
# https://github.com/flame/blis/issues/195
# https://github.com/flame/blis/issues/197
class BlisBase(Package):
"""Base class for building BLIS, shared with the AMD optimized version
of the library in the 'amdblis' package.
"""
depends_on('python@2.7:2.8,3.4:', type=('build', 'run'))
variant(
'threads', default='none',
description='Multithreading support',
values=('pthreads', 'openmp', 'none'),
multi=False
)
variant(
'blas', default=True,
description='BLAS compatibility',
)
variant(
'cblas', default=True,
description='CBLAS compatibility',
)
variant(
'shared', default=True,
description='Build shared library',
)
variant(
'static', default=True,
description='Build static library',
)
# TODO: add cpu variants. Currently using auto.
# If one knl, should the default be memkind ?
# BLIS has it's own API but can be made compatible with BLAS
# enabling CBLAS automatically enables BLAS.
provides('blas', when="+blas")
provides('blas', when="+cblas")
phases = ['configure', 'build', 'install']
def configure_args(self):
spec = self.spec
config_args = []
config_args.append("--enable-threading=" +
spec.variants['threads'].value)
if '+cblas' in spec:
config_args.append("--enable-cblas")
else:
config_args.append("--disable-cblas")
if '+blas' in spec:
config_args.append("--enable-blas")
else:
config_args.append("--disable-blas")
if '+shared' in spec:
config_args.append("--enable-shared")
else:
config_args.append("--disable-shared")
if '+static' in spec:
config_args.append("--enable-static")
else:
config_args.append("--disable-static")
return config_args
def configure(self, spec, prefix):
config_args = self.configure_args()
# To ensure auto should always be the
# last argument for base and derived class
config_args.append("auto")
configure("--prefix=" + prefix,
*config_args)
def build(self, spec, prefix):
make()
@run_after('build')
@on_package_attributes(run_tests=True)
def check(self):
make('check')
def install(self, spec, prefix):
make('install')
@run_after('install')
def darwin_fix(self):
# The shared library is not installed correctly on Darwin; fix this
if self.spec.satisfies('platform=darwin'):
fix_darwin_install_name(self.prefix.lib)
@property
def libs(self):
return find_libraries(
["libblis", "libblis-mt"],
root=self.prefix,
shared='+shared' in self.spec,
recursive=True
)
class Blis(BlisBase):
"""BLIS is a portable software framework for instantiating high-performance
BLAS-like dense linear algebra libraries.
The framework was designed to isolate essential kernels of computation
that, when optimized, immediately enable optimized implementations of
most of its commonly used and computationally intensive operations. BLIS
is written in ISO C99 and available under a new/modified/3-clause BSD
license. While BLIS exports a new BLAS-like API, it also includes a
BLAS compatibility layer which gives application developers access to
BLIS implementations via traditional BLAS routine calls.
An object-based API unique to BLIS is also available.
"""
homepage = "https://github.com/flame/blis"
url = "https://github.com/flame/blis/archive/0.7.0.tar.gz"
git = "https://github.com/flame/blis.git"
version('master', branch='master')
version('0.8.1', sha256='729694128719801e82fae7b5f2489ab73e4a467f46271beff09588c9265a697b')
version('0.8.0', sha256='5e05868c4a6cf5032a7492f8861653e939a8f907a4fa524bbb6e14394e170a3d')
version('0.7.0', sha256='7e345d666799e15bba570bd125f97042f17bf752a61dcf314486a6cd096d5f68')
version('0.6.1', sha256='76b22f29b7789cf117c0873d2a6b2a6d61f903869168148f2e7306353c105c37')
version('0.6.0', sha256='ad5765cc3f492d0c663f494850dafc4d72f901c332eb442f404814ff2995e5a9')
version('0.5.0', sha256='1a004d69c139e8a0448c6a6007863af3a8c3551b8d9b8b73fe08e8009f165fa8')
version('0.4.0', sha256='9c7efd75365a833614c01b5adfba93210f869d92e7649e0b5d9edc93fc20ea76')
version('0.3.2', sha256='b87e42c73a06107d647a890cbf12855925777dc7124b0c7698b90c5effa7f58f')
version('0.3.1', sha256='957f28d47c5cf71ffc62ce8cc1277e17e44d305b1c2fa8506b0b55617a9f28e4')
version('0.3.0', sha256='d34d17df7bdc2be8771fe0b7f867109fd10437ac91e2a29000a4a23164c7f0da')
version('0.2.2', sha256='4a7ecb56034fb20e9d1d8b16e2ef587abbc3d30cb728e70629ca7e795a7998e8')
# Problems with permissions on installed libraries:
# https://github.com/flame/blis/issues/343
patch('Makefile_0.6.0.patch', when='@0.4.0:0.6.0')
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import *
class IntelMkl(IntelPackage):
"""Intel Math Kernel Library."""
homepage = "https://software.intel.com/en-us/intel-mkl"
version('2020.4.304', sha256='2314d46536974dbd08f2a4e4f9e9a155dc7e79e2798c74e7ddfaad00a5917ea5',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16917/l_mkl_2020.4.304.tgz')
version('2020.3.279', sha256='2b8e434ecc9462491130ba25a053927fd1a2eca05e12acb5936b08c486857a04',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16903/l_mkl_2020.3.279.tgz')
version('2020.2.254', sha256='ed00a267af362a6c14212bd259ab1673d64337e077263033edeef8ac72c10223',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16849/l_mkl_2020.2.254.tgz')
version('2020.1.217', sha256='082a4be30bf4f6998e4d6e3da815a77560a5e66a68e254d161ab96f07086066d',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16533/l_mkl_2020.1.217.tgz')
version('2020.0.166', sha256='f6d92deb3ff10b11ba3df26b2c62bb4f0f7ae43e21905a91d553e58f0f5a8ae0',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16232/l_mkl_2020.0.166.tgz')
version('2019.5.281', sha256='9995ea4469b05360d509c9705e9309dc983c0a10edc2ae3a5384bc837326737e',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15816/l_mkl_2019.5.281.tgz')
version('2019.4.243', sha256='fcac7b0369665d93f0c4dd98afe2816aeba5410e2b760655fe55fc477f8f33d0',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15540/l_mkl_2019.4.243.tgz')
version('2019.3.199', sha256='06de2b54f4812e7c39a118536259c942029fe1d6d8918ad9df558a83c4162b8f',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15275/l_mkl_2019.3.199.tgz')
version('2019.2.187', sha256='2bf004e6b5adb4f956993d6c20ea6ce289bb630314dd501db7f2dd5b9978ed1d',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15095/l_mkl_2019.2.187.tgz')
version('2019.1.144', sha256='5205a460a9c685f7a442868367389b2d0c25e1455346bc6a37c5b8ff90a20fbb',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/14895/l_mkl_2019.1.144.tgz')
version('2019.0.117', sha256='4e1fe2c705cfc47050064c0d6c4dee1a8c6740ac1c4f64dde9c7511c4989c7ad',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13575/l_mkl_2019.0.117.tgz')
version('2018.4.274', sha256='18eb3cde3e6a61a88f25afff25df762a560013f650aaf363f7d3d516a0d04881',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13725/l_mkl_2018.4.274.tgz')
version('2018.3.222', sha256='108d59c0927e58ce8c314db6c2b48ee331c3798f7102725f425d6884eb6ed241',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13005/l_mkl_2018.3.222.tgz')
version('2018.2.199', sha256='e28d12173bef9e615b0ded2f95f59a42b3e9ad0afa713a79f8801da2bfb31936',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/12725/l_mkl_2018.2.199.tgz')
version('2018.1.163', sha256='f6dc263fc6f3c350979740a13de1b1e8745d9ba0d0f067ece503483b9189c2ca',
url='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/12414/l_mkl_2018.1.163.tgz')
version('2018.0.128', sha256='c368baa40ca88057292512534d7fad59fa24aef06da038ea0248e7cd1e280cec',
url='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/12070/l_mkl_2018.0.128.tgz')
version('2017.4.239', sha256='dcac591ed1e95bd72357fd778edba215a7eab9c6993236373231cc16c200c92a',
url='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/12147/l_mkl_2017.4.239.tgz')
version('2017.3.196', sha256='fd7295870fa164d6138c9818304f25f2bb263c814a6c6539c9fe4e104055f1ca',
url='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/11544/l_mkl_2017.3.196.tgz')
version('2017.2.174', sha256='0b8a3fd6bc254c3c3d9d51acf047468c7f32bf0baff22aa1e064d16d9fea389f',
url='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/11306/l_mkl_2017.2.174.tgz')
version('2017.1.132', sha256='8c6bbeac99326d59ef3afdc2a95308c317067efdaae50240d2f4a61f37622e69',
url='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/11024/l_mkl_2017.1.132.tgz')
version('2017.0.098', sha256='f2233e8e011f461d9c15a853edf7ed0ae8849aa665a1ec765c1ff196fd70c4d9',
url='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/9662/l_mkl_2017.0.098.tgz')
# built from parallel_studio_xe_2016.3.x
version('11.3.3.210', sha256='ff858f0951fd698e9fb30147ea25a8a810c57f0126c8457b3b0cdf625ea43372',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/9068/l_mkl_11.3.3.210.tgz')
# built from parallel_studio_xe_2016.2.062
version('11.3.2.181', sha256='bac04a07a1fe2ae4996a67d1439ee90c54f31305e8663d1ccfce043bed84fc27',
url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/8711/l_mkl_11.3.2.181.tgz')
depends_on('cpio', type='build')
variant('shared', default=True, description='Builds shared library')
variant('ilp64', default=False, description='64 bit integers')
variant(
'threads', default='none',
description='Multithreading support',
values=('openmp', 'tbb', 'none'),
multi=False
)
provides('blas')
provides('lapack')
provides('scalapack')
provides('mkl')
provides('fftw-api@3', when='@2017:')
if sys.platform == 'darwin':
# there is no libmkl_gnu_thread on macOS
conflicts('threads=openmp', when='%gcc')
--- a/Makefile 2019-07-30 00:12:13.030672681 -0500
+++ b/Makefile 2019-07-30 00:14:16.535602616 -0500
@@ -370,10 +370,8 @@
# --- Static library archiver rules for libflame ---
$(MK_ALL_FLAMEC_LIB): $(MK_ALL_FLAMEC_OBJS)
-define EOL
-endef
ifeq ($(FLA_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
@$(eval ar_args:=)
From 4356779fe843fb30b3728f5fdab049c7291d89c6 Mon Sep 17 00:00:00 2001
From: "Field G. Van Zee" <field@cs.utexas.edu>
Date: Mon, 23 Sep 2019 15:15:15 -0500
Subject: [PATCH] Set execute bits of shared library at install-time.
Details:
- Modified the 0644 octal code used during installation of shared
libraries to 0755. Thanks to Adam J. Stewart for reporting this
issue in #24.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index d856af4c..6bd8bdce 100644
--- a/Makefile
+++ b/Makefile
@@ -643,11 +643,11 @@ endif
$(INSTALL_LIBDIR)/%.$(LIBFLAME_SO_MMB_EXT): $(BASE_LIB_PATH)/%.$(SHLIB_EXT) $(CONFIG_MK_FILE)
ifeq ($(ENABLE_VERBOSE),yes)
$(MKDIR) $(@D)
- $(INSTALL) -m 0644 $< $@
+ $(INSTALL) -m 0755 $< $@
else
@echo "Installing $(@F) into $(INSTALL_LIBDIR)/"
@$(MKDIR) $(@D)
- @$(INSTALL) -m 0644 $< $@
+ @$(INSTALL) -m 0755 $< $@
endif
From 6dd3c19978a0b805b0e294271ce8f5ef2f421425 Mon Sep 17 00:00:00 2001
From: "Field G. Van Zee" <field@cs.utexas.edu>
Date: Wed, 25 Sep 2019 12:46:23 -0500
Subject: [PATCH] Use OSX-specific SOFLAGS when building shared lib.
Details:
- Use linker flags and shared library suffix specific to OSX/Darwin when
the user appears to be building in OSX/Darwin. The OS is queried using
'uname -s'. Thanks to Adam J. Stewart for reporting this issue in #23.
- Substitute os_name from configure into config.mk (and echo in
post-configure.sh).
- Substitute CC_VENDOR from configure into config.mk (and echo in
post-configure.sh). This variable isn't needed yet, but may be in the
future.
- Autoconf update to configure.
- Whitespace changes.
---
Makefile | 22 +++++++++++++++++++++-
build/ac-macros/fla_observe_os_name.m4 | 11 +++++++++++
build/ac-macros/fla_require_cc.m4 | 8 ++++++--
build/config.mk.in | 5 +++++
build/post-configure.sh.in | 5 +++++
configure | 15 +++++++++++++++
configure.ac | 3 +++
7 files changed, 66 insertions(+), 3 deletions(-)
create mode 100644 build/ac-macros/fla_observe_os_name.m4
diff --git a/Makefile b/Makefile
index 6bd8bdce..f9681439 100644
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,12 @@ endif
# --- Shared library extension ---
-SHLIB_EXT := so
+# The shared (dynamic) library file suffix is different for Linux and OS X.
+ifeq ($(OS_NAME),Darwin)
+SHLIB_EXT := dylib
+else
+SHLIB_EXT := so
+endif
# --- Library names ---
@@ -107,8 +112,15 @@ LIBFLAME_SO := $(LIBFLAME).$(SHLIB_EXT)
LIBFLAME_A_PATH := $(BASE_LIB_PATH)/$(LIBFLAME_A)
LIBFLAME_SO_PATH := $(BASE_LIB_PATH)/$(LIBFLAME_SO)
+ifeq ($(OS_NAME),Darwin)
+# OS X shared library extensions.
+LIBFLAME_SO_MAJ_EXT := $(SO_MAJOR).$(SHLIB_EXT)
+LIBFLAME_SO_MMB_EXT := $(SO_MMB).$(SHLIB_EXT)
+else
+# Linux shared library extensions.
LIBFLAME_SO_MAJ_EXT := $(SHLIB_EXT).$(SO_MAJOR)
LIBFLAME_SO_MMB_EXT := $(SHLIB_EXT).$(SO_MMB)
+endif
LIBFLAME_SONAME := $(LIBFLAME).$(LIBFLAME_SO_MAJ_EXT)
LIBFLAME_SO_MAJ_PATH := $(BASE_LIB_PATH)/$(LIBFLAME_SONAME)
@@ -124,8 +136,15 @@ LIBFLAME_SO_OUTPUT_NAME := $(LIBFLAME_SO_PATH)
# Specify the shared library's 'soname' field.
# NOTE: The flag for creating shared objects is different for Linux and OS X.
+ifeq ($(OS_NAME),Darwin)
+# OS X shared library link flags.
+SOFLAGS := -dynamiclib
+SOFLAGS += -Wl,-install_name,$(LIBFLAME_SONAME)
+else
SOFLAGS := -shared
+# Linux shared library link flags.
SOFLAGS += -Wl,-soname,$(LIBFLAME_SONAME)
+endif
diff --git a/build/ac-macros/fla_observe_os_name.m4 b/build/ac-macros/fla_observe_os_name.m4
new file mode 100644
index 00000000..d3dbbf99
--- /dev/null
+++ b/build/ac-macros/fla_observe_os_name.m4
@@ -0,0 +1,11 @@
+AC_DEFUN([FLA_OBSERVE_OS_NAME],
+[
+ os_name=$(uname -s)
+ os_vers=$(uname -r)