You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to compile MATLAB bindings on MacOS 14.1.1 (Sonoma), aarch64 (M1 Max) fails with the following error:
mex adiosopenc.c -largeArrayDims -DDEBUG CFLAGS="-g -std=c99 -fPIC -O0" -I. -I/opt/homebrew/opt/adios2/include "LDFLAGS=-Wl,-rpath,/opt/homebrew/opt/adios2/lib -L/opt/homebrew/opt/adios2/lib -ladios2_c -ladios2_core"
Building with 'Xcode with Clang'.
/Users/tomgade/src/ADIOS2/bindings/Matlab/adiosopenc.c:143:28: error: too many arguments provided to function-like macro invocation
adiosobj = adios2_init(false);
^
/opt/homebrew/opt/adios2/include/adios2/c/adios2_c_adios.h:49:9: note: macro 'adios2_init' defined here
#define adios2_init() adios2_init_serial()
^
/Users/tomgade/src/ADIOS2/bindings/Matlab/adiosopenc.c:143:16: error: use of undeclared identifier 'adios2_init'
adiosobj = adios2_init(false);
^
2 errors generated.
The issue stems from this code block in <root>/bindings/C/adios2/c/adios2_c_adios.h : 47-50 (below)
#else
#define adios2_init() adios2_init_serial() // issue #1 (above) - adios2_init is called with an argument in line 143 of <root>/bindings/Matlab/adiosopenc.c
#define adios2_init_config(config_file) adios2_init_config_seria(config_file) // issue #2 (below) - note "adios2_init_config_**seria**(config_file)"
#endif
There appears to be a typo in the same location <root>/bindings/C/adios2/c/adios2_c_adios.h :: 49. It will likely lead to a link error later, once issue 1 is fixed.
To Reproduce
Steps to reproduce the behavior:
Install ADIOS2 via homebrew and clone the git repository
OR
Alternatively clone the git repository and compile using the "minimal" instructions in <root>/bindings/Matlab/README.txt : cmake -DCMAKE_INSTALL_PREFIX=/opt/adios/lean -DADIOS2_USE_MPI=OFF -DADIOS2_USE_Fortran=OFF -DADIOS2_USE_Python=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DADIOS2_ENABLE_PIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DADIOS2_USE_SST=OFF -DADIOS2_USE_BZip2=OFF -DADIOS2_USE_DataMan=OFF ..
cd bindings/Matlab
Modify Makefile to use correct install directories (comment out all other invalid definitions in the above sections)
### General - this should work everywhere
ADIOS_DIR=/opt/homebrew/opt/adios2
ADIOS_INC=-I${ADIOS_DIR}/include
ADIOS_LIBS=-Wl,-rpath,${ADIOS_DIR}/lib -L${ADIOS_DIR}/lib -ladios2_c -ladios2_core
MEXLIBS="LDFLAGS=${ADIOS_LIBS}"
Note: the examples stating ADIOS_LIBS=-Wl,-rpath=<path>.... are invalid (on Mac, maybe others) and should read ...-rpath,<path>... (using a comma, not an equals sign)
5. PATH=$PATH:/Applications/MATLAB_R2023b.app/bin make matlab
6. See error
Expected behavior
MATLAB bindings compile - mex and .dylib files are generated for adiosopen, adiosclose, adiosread, adioswrite.
Desktop (please complete the following information):
Macbook Pro M1 Max, MacOS 14.1.1 Sonoma, aarch64
Xcode 15.0.1 (which seems to use clang/llvm)
ADIOS 2.9.2 (homebrew version), or alternatively same version from source / github repo
Additional context
I installed adios2 through homebrew, leading to this issue; however, it is also worth noting that doing compiling a "minimal" build, as contained in the readme file in /bindings/Matlab also yields this issue. The issue is a mismatch between function signatures
Follow-up
TBD
The text was updated successfully, but these errors were encountered:
I should also add:
Modifying line 143 of adiosopenc.c from: adiosobj = adios2_init(false);
to adiosobj = adios2_init(); (not sure if this is valid or not)
yields an undefined external symbol error _main.
mex adiosopenc.c -largeArrayDims -DDEBUG CFLAGS="-g -std=c99 -fPIC -O0" -I. -I/opt/homebrew/opt/adios2/include "LDFLAGS=-Wl,-rpath,/opt/homebrew/opt/adios2/lib -L/opt/homebrew/opt/adios2/lib -ladios2_c -ladios2_core"
Building with 'Xcode with Clang'.
ld: Undefined symbols:
_main, referenced from:
<initial-undefines>
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've attempted to pass the -v flag in the appropriate spot to show the ld call, but I haven't been able to figure out where to work it in to get it to ld.
Describe the bugs (x2)
The issue stems from this code block in
<root>/bindings/C/adios2/c/adios2_c_adios.h : 47-50
(below)<root>/bindings/C/adios2/c/adios2_c_adios.h :: 49
. It will likely lead to a link error later, once issue 1 is fixed.To Reproduce
Steps to reproduce the behavior:
OR
<root>/bindings/Matlab/README.txt
:cmake -DCMAKE_INSTALL_PREFIX=/opt/adios/lean -DADIOS2_USE_MPI=OFF -DADIOS2_USE_Fortran=OFF -DADIOS2_USE_Python=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DADIOS2_ENABLE_PIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DADIOS2_USE_SST=OFF -DADIOS2_USE_BZip2=OFF -DADIOS2_USE_DataMan=OFF ..
cd bindings/Matlab
Note: the examples stating
ADIOS_LIBS=-Wl,-rpath=<path>....
are invalid (on Mac, maybe others) and should read...-rpath,<path>...
(using a comma, not an equals sign)5.
PATH=$PATH:/Applications/MATLAB_R2023b.app/bin make matlab
6. See error
Expected behavior
MATLAB bindings compile - mex and .dylib files are generated for adiosopen, adiosclose, adiosread, adioswrite.
Desktop (please complete the following information):
Additional context
I installed adios2 through homebrew, leading to this issue; however, it is also worth noting that doing compiling a "minimal" build, as contained in the readme file in /bindings/Matlab also yields this issue. The issue is a mismatch between function signatures
Follow-up
TBD
The text was updated successfully, but these errors were encountered: