Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building MATLAB toolbox on Apple Silicon #1524

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/matlab/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import sys
from os.path import join as pjoin
from buildutils import *
from pathlib import Path

Import('env', 'build', 'install')

Expand Down Expand Up @@ -33,12 +35,16 @@ elif localenv['OS'] == 'Darwin':
linklibs += ['mx', 'mex', 'mat'] + env['LIBM']
linkflags.extend(['-Wl,-exported_symbol,_mexFunction'])

if localenv['OS_BITS'] == 64:
matlab_libs = pjoin(localenv['matlab_path'], 'bin', 'maci64')
mexSuffix = '.mexmaci64'
matlab_path = Path(localenv["matlab_path"])
if (matlab_path / "bin" / "maca64").is_dir():
matlab_libs = (matlab_path / "bin" / "maca64").as_posix()
mexSuffix = ".mexmaca64"
elif (matlab_path / "bin" / "maci64").is_dir():
matlab_libs = (matlab_path / "bin" / "maci64").as_posix()
mexSuffix = ".mexmaci64"
else:
matlab_libs = pjoin(localenv['matlab_path'], 'bin', 'macx86')
mexSuffix = '.mexmaci'
logger.error("Couldn't determine target architecture for Matlab toolbox")
sys.exit(1)

elif os.name == 'posix':
linklibs = list(env['cantera_libs'])
Expand Down
Loading