Merge pull request #12 from HaoZeke/darwin-support

BLD: Darwin support
This commit is contained in:
Mateusz Sokół 2024-08-05 15:41:27 +02:00 committed by GitHub
commit 7d4b13333c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 49 additions and 23 deletions

View File

@ -1,6 +1,5 @@
name: meson build
#on: [push, pull_request]
on:
push:
branches:
@ -21,11 +20,12 @@ permissions:
jobs:
build:
if: "github.repository == 'HaoZeke/OpenBLAS'"
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
build: [meson]
fortran: [gfortran]
openmp: [0]
@ -37,7 +37,14 @@ jobs:
- name: Print system information
run: |
cat /proc/cpuinfo
if [ "$RUNNER_OS" == "Linux" ]; then
cat /proc/cpuinfo
elif [ "$RUNNER_OS" == "macOS" ]; then
sysctl -a | grep machdep.cpu
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: Set up Python
uses: actions/setup-python@v5
with:
@ -46,7 +53,17 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get install -y gfortran libtinfo5
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y gfortran libtinfo5
elif [ "$RUNNER_OS" == "macOS" ]; then
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
brew reinstall gcc
brew install coreutils
brew install llvm
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: Install packages
run: |
python -m pip install meson ninja

View File

@ -513,8 +513,8 @@ foreach _kop : driver_kops
# Add standard flags for naming conventions
_ext_cargs += [
f'-DASMNAME=@sym_name@',
f'-DASMFNAME=@sym_underscored@',
f'-DASMNAME=@asm_name_prefix@@sym_name@',
f'-DASMFNAME=@asm_name_prefix@@sym_underscored@',
f'-DNAME=@sym_underscored@',
f'-DCNAME=@sym_name@',
f'-DCHAR_NAME="@sym_underscored@"',

View File

@ -438,8 +438,8 @@ foreach _kop : driver_kops
# Add standard flags for naming conventions
_ext_cargs += [
f'-DASMNAME=@sym_name@',
f'-DASMFNAME=@sym_underscored@',
f'-DASMNAME=@asm_name_prefix@@sym_name@',
f'-DASMFNAME=@asm_name_prefix@@sym_underscored@',
f'-DNAME=@sym_underscored@',
f'-DCNAME=@sym_name@',
f'-DCHAR_NAME="@sym_underscored@"',

View File

@ -52,12 +52,12 @@ foreach op : others_ops
# Add standard flags for naming conventions
c_args += [
'-DASMNAME=@0@'.format(sym_name),
'-DASMFNAME=@0@_'.format(sym_name),
'-DNAME=@0@_'.format(sym_name),
'-DCNAME=@0@'.format(sym_name),
'-DCHAR_NAME="@0@_"'.format(sym_name),
'-DCHAR_CNAME="@0@"'.format(sym_name)
f'-DASMNAME=@asm_name_prefix@@sym_name@',
f'-DASMFNAME=@asm_name_prefix@@sym_name@_',
f'-DNAME=@sym_name@_',
f'-DCNAME=@sym_name@',
f'-DCHAR_NAME="@sym_name@_"',
f'-DCHAR_CNAME="@sym_name@"',
]
# Append the current configuration

View File

@ -626,12 +626,12 @@ foreach conf : _blas_roots
sources: [conf['fname'], config_h],
include_directories: _inc,
c_args: compiler_args + [
f'-DASMNAME=@sym_name@',
f'-DASMFNAME=@sym_underscored@',
f'-DASMNAME=@asm_name_prefix@@sym_name@',
f'-DASMFNAME=@asm_name_prefix@@sym_underscored@',
f'-DNAME=@sym_underscored@',
f'-DCNAME=@sym_name@',
f'-DCHAR_NAME="@sym_underscored@"',
f'-DCHAR_CNAME="@sym_name@"'
f'-DCHAR_CNAME="@sym_name@"',
]
)
_interface_libs += lib
@ -649,12 +649,12 @@ foreach conf : _blas_roots
include_directories: _inc,
c_args: compiler_args + [
'-DCBLAS',
f'-DASMNAME=@cblas_sym_name@',
f'-DASMFNAME=@cblas_sym_underscored@',
f'-DASMNAME=@asm_name_prefix@@cblas_sym_name@',
f'-DASMFNAME=@asm_name_prefix@@cblas_sym_underscored@',
f'-DNAME=@cblas_sym_underscored@',
f'-DCNAME=@cblas_sym_name@',
f'-DCHAR_NAME="@cblas_sym_underscored@"',
f'-DCHAR_CNAME="@cblas_sym_name@"'
f'-DCHAR_CNAME="@cblas_sym_name@"',
]
)
_interface_libs += cblas_lib

View File

@ -1486,8 +1486,8 @@ foreach _kop : base_kops
sym_name = base.replace('?', mode) + ext
sym_underscored = f'@sym_name@_'
_ext_cargs += [
f'-DASMNAME=@sym_name@',
f'-DASMFNAME=@sym_underscored@',
f'-DASMNAME=@asm_name_prefix@@sym_name@',
f'-DASMFNAME=@asm_name_prefix@@sym_underscored@',
f'-DNAME=@sym_underscored@',
f'-DCNAME=@sym_name@',
f'-DCHAR_NAME="@sym_underscored@"',

View File

@ -67,12 +67,21 @@ max_stack_alloc = get_option('max_stack_alloc')
quad_prec = get_option('quad_precision')
exprecision = get_option('exprecision')
if host_machine.system() == 'linux'
is_linux = host_machine.system() == 'linux'
is_darwin = host_machine.system() == 'darwin'
if is_linux or is_darwin
no_affinity = true
else
no_affinity = false
endif
if cc_id == 'clang'
asm_name_prefix = '_'
else
asm_name_prefix = ''
endif
_check_prefix = []
conf_data = configuration_data()
is_win = host_machine.system() == 'windows' or host_machine.system() == 'cygwin'