<rcurtin[m]>
interesting that you needed -framework Accelerate... can you open /opt/homebrew/include/armadillo_bits/config.hpp and see if the line #define ARMA_USE_WRAPPER is commented or uncommented?
<TarekElsayed[m]>
No it's not commented
<rcurtin[m]>
okay... can you try one more thing... if you compile with -DARMA_USE_WRAPPER, but not -framework Accelerate, does it link successfully?
<TarekElsayed[m]>
Yes it links successfully
<rcurtin[m]>
it links successfully without -framework Accelerate? I just want to double check because that is not the result I expected 😃
<TarekElsayed[m]>
Yes
<TarekElsayed[m]>
```tareknasser@Tareks-MacBook ml % g++ -std=c++11 -o test test.cpp -L/opt/homebrew/lib/ -larmadillo -DARMA_USE_WRAPPER
<TarekElsayed[m]>
tareknasser@Tareks-MacBook ml % ```
<TarekElsayed[m]>
It compiles
<rcurtin[m]>
huh... okay... I am wondering if this is a homebrew packaging issue or something... why would ARMA_USE_WRAPPER not be enabled by default if it is uncommented in config.hpp?
<TarekElsayed[m]>
I can test uninstalling brew version and then building from source later
<TarekElsayed[m]>
Is this issue related to only m1 macs ?
<rcurtin[m]>
wait, hang on... is it possible you have multiple installations of Armadillo on your system?
<TarekElsayed[m]>
yes. I faced a similar issue before with a different project
<TarekElsayed[m]>
By the way I have g++ itself installed from brew and sometimes I test with it
<TarekElsayed[m]>
but in this situation I only used apple clang
<zoq[m]>
I think you used the autodownloader as well?
<TarekElsayed[m]>
What is the autodownloader?
<zoq[m]>
I think it this case you ended-up with multiple armadillo versions as rcurtin pointed out.
<zoq[m]>
-DDOWNLOAD_DEPENDENCIES=ON
<TarekElsayed[m]>
Yes I used it
<rcurtin[m]>
the autodownloader shouldn't download Armadillo if a version is already installed on the system, but yeah, the issue here is that there are multiple Armadillo versions that are configured differently
<rcurtin[m]>
now that I look more closely through the error messages, you have a version in /usr/local/ where I bet /usr/local/include/armadillo_bits/config.hpp has ARMA_USE_WRAPPER commented out; then, you have a version in /opt/homebrew/ where ARMA_USE_WRAPPER is defined... this means that the Armadillo headers you are including by default have no use for the wrapper library /opt/homebrew/lib/libarmadillo.dylib, unless you manually define
<rcurtin[m]>
ARMA_USE_WRAPPER
<rcurtin[m]>
I'd suggest removing the version in /usr/local/ and this should fix your issues, and you won't need to append a special -framework Accelerate to your CMake command for mlpack
<TarekElsayed[m]>
Yes this is exactly the issue
<TarekElsayed[m]>
/usr/local/include/armadillo_bits/config.hpp has ARMA_USE_WRAPPER commented out