clang: error: invalid arch name '-arch=native'
make[2]: *** [src/chrono/CMakeFiles/ChronoEngine.dir/core/ChLog.cpp.o] Error 1
make[1]: *** [src/chrono/CMakeFiles/ChronoEngine.dir/all] Error 2
1. What should I type in CMAKE_OSX_ARCHITECTURES in case of apple M1.
2. IRRLICHT_ROOT also does not automatically designate. Can I specify like
'/opt/homebrew/Cellar/irrlicht/1.8.5'. I think that PATH of brew is diffrent with native mac.
3.MATLAB_SDK_ROOT can be specified like '/Applications/MATLAB_R2021b.app/extern'
Thanks.
Thanks for the quick issue support. But, I got a mesage with matlab.
How do I have to when I need MATLAB?
I think that some file that include some dyanmic lilbrary for matlab trying to compile for x86_64 arch.
I am using apple m1 silicon.
ld: warning: ignoring file /Applications/MATLAB_R2021b.app/extern/../bin/maci64/libeng.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Applications/MATLAB_R2021b.app/extern/../bin/maci64/libmat.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Applications/MATLAB_R2021b.app/extern/../bin/maci64/libmx.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_engClose", referenced from:
chrono::ChMatlabEngine::~ChMatlabEngine() in ChMatlabEngine.cpp.o
"_engEvalString", referenced from:
chrono::ChMatlabEngine::Eval(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
"_engGetVariable", referenced from:
chrono::ChMatlabEngine::GetVariable(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
"_engOpen", referenced from:
chrono::ChMatlabEngine::ChMatlabEngine() in ChMatlabEngine.cpp.o
"_engPutVariable", referenced from:
chrono::ChMatlabEngine::PutVariable(Eigen::Ref<Eigen::Matrix<double, -1, -1, 1, -1, -1> const, 0, Eigen::OuterStride<-1> > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
"_engSetVisible", referenced from:
chrono::ChMatlabEngine::SetVisible(bool) in ChMatlabEngine.cpp.o
"_mxCreateDoubleMatrix_800", referenced from:
chrono::ChMatlabEngine::PutVariable(Eigen::Ref<Eigen::Matrix<double, -1, -1, 1, -1, -1> const, 0, Eigen::OuterStride<-1> > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
"_mxDestroyArray_800", referenced from:
chrono::ChMatlabEngine::PutVariable(Eigen::Ref<Eigen::Matrix<double, -1, -1, 1, -1, -1> const, 0, Eigen::OuterStride<-1> > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
chrono::ChMatlabEngine::GetVariable(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
"_mxGetDimensions_800", referenced from:
chrono::ChMatlabEngine::GetVariable(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
"_mxGetNumberOfDimensions_800", referenced from:
chrono::ChMatlabEngine::GetVariable(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
"_mxGetPr_800", referenced from:
chrono::ChMatlabEngine::PutVariable(Eigen::Ref<Eigen::Matrix<double, -1, -1, 1, -1, -1> const, 0, Eigen::OuterStride<-1> > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
chrono::ChMatlabEngine::GetVariable(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChMatlabEngine.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libChronoEngine_matlab.dylib] Error 1
make[1]: *** [src/chrono_matlab/CMakeFiles/ChronoEngine_matlab.dir/all] Error 2
make: *** [all] Error 2
I suspect the Matlab library you have includes code for x86_64. A quick Google search indicates that Mathworks is still working on a native version for Apple Silicon.
In any case, you can easily check that running the ‘file’ command on the libeng.dylib.
I don’t think you can mix libraries of different architectures, but I have no way of testing this.
--Radu
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
projectchron...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/projectchrono/2ecd1776-5114-438e-8d04-ee7e98700561n%40googlegroups.com.