forked from datajoint/mym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Mac OS on Apple silicon (64-bit ARM; mexmaca64).
This change includes the MySQL client library from MySQL 8.4.0 LTS. Possible fix for issues datajoint#99 and datajoint#100.
- Loading branch information
Showing
45 changed files
with
15,875 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+8.14 MB
distribution/mexa64/libmysqlclient.so.18.4. → ...ion/mexmaca64/lib/libmysqlclient.24.dylib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
function compile_mexmaca64() | ||
% Build script for MyM (64-bit ARM Mac OS) | ||
% | ||
% Notes: | ||
% | ||
% 1. we're relying on the system zlib. | ||
|
||
mym_base = fileparts(fileparts(mfilename('fullpath'))); | ||
mym_src = fullfile(mym_base, 'src'); | ||
build_out = fullfile(mym_base, 'build', mexext()); | ||
distrib_out = fullfile(mym_base, 'distribution', mexext()); | ||
|
||
% Set up input and output directories | ||
mysql_base = fullfile(mym_base, 'mysqlclient'); | ||
mysql_include = fullfile(mysql_base, 'include'); | ||
% mysql_platform_include = fullfile(mysql_base, ['include_' mexext()]); | ||
mysql_lib = fullfile(mysql_base, ['lib_' mexext()]); | ||
% mariadb_lib = fullfile(mym_base, ['maria-plugin/','lib_',mexext()]); | ||
|
||
mkdir(build_out); | ||
mkdir(distrib_out); | ||
oldp = cd(build_out); | ||
pwd_reset = onCleanup(@() cd(oldp)); | ||
|
||
mex( ... | ||
'-v', ... | ||
'-largeArrayDims', ... | ||
sprintf('-I"%s"', mysql_include), ... % sprintf('-I"%s"', mysql_platform_include), ... | ||
sprintf('-L"%s"', mysql_lib), ... % sprintf('-L"%s"', mariadb_lib), ... | ||
'-lmysqlclient', ... | ||
'-lz', ... | ||
fullfile(mym_src, 'mym.cpp')); | ||
|
||
|
||
% Find old libmysqlclient path | ||
[~,old_link] = system(['otool -L ' ... | ||
fullfile(build_out, ['mym.' mexext()]) ... | ||
' | grep libmysqlclient.24.dylib | tail -1 |awk ''{print $1}''']); | ||
|
||
% Change libmysqlclient reference to mym mex directory | ||
system(['install_name_tool -change "' strip(old_link) '" "' ... | ||
fullfile('@loader_path','lib', 'libmysqlclient.24.dylib') '" "' ... | ||
fullfile(build_out, ['mym.' mexext()]) '"']); | ||
|
||
% Pack mex with all dependencies into distribution directory | ||
copyfile(['mym.' mexext()], distrib_out, 'f'); | ||
copyfile(fullfile(mym_src, 'mym.m'), distrib_out, 'f'); | ||
copyfile(fullfile(mysql_lib, 'lib*'), fullfile(distrib_out,'lib'), 'f'); | ||
% copyfile(fullfile(mariadb_lib, 'dialog.so'), distrib_out, 'f'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
function tbx = mktbx(varargin) | ||
% package as toolbox for distribution (and optionally install) | ||
|
||
install = false; | ||
if nargin > 0 | ||
install = varargin{1}; | ||
end | ||
|
||
root = fileparts(mfilename('fullpath')); | ||
|
||
wd = pwd; | ||
cd(fullfile('distribution',mexext())); | ||
docs = help('mym'); | ||
cd(wd); | ||
|
||
% exclude = {'.vscode', '.git', '.gitignore', 'build', 'lib', 'maria-plugin', ... | ||
% 'mex_compilation', 'mysql-connector', 'notebook', 'src', 'zlib', ... | ||
% '*.txt', '*.env', '*.prf', '*.md', '*.yml', 'tests', '.github'}; | ||
d = dir(pwd); | ||
exclude = {d(~endsWith({d.name},'distribution')).name}; | ||
|
||
d = dir('distribution'); | ||
% include = {d(~startsWith({d.name},".")).name}; | ||
include = fullfile('distribution',{d(~startsWith({d.name},".")).name}); | ||
|
||
ghtb.package('mym', ... | ||
'Raphael Guzman', ... | ||
'[email protected]', ... | ||
'MySQL API for MATLAB with support for BLOB objects', ... | ||
docs, ... | ||
exclude, ... | ||
@() strjoin(cellfun(@(x) num2str(x), ... | ||
struct2cell(mym('version')),'UniformOutput',false), ... | ||
'.'), ... | ||
include, ... | ||
'toolboxVersionDir', fullfile('distribution',mexext()), ... | ||
'toolboxRootDir', pwd); | ||
|
||
tbx = []; | ||
if install | ||
tbx = matlab.addons.toolbox.installToolbox('mym.mltbx'); | ||
end | ||
end |
Oops, something went wrong.