# Build opencv with LAPACK/EIGEN for ios/android

**URL:** <https://forum.opencv.org/t/build-opencv-with-lapack-eigen-for-ios-android/4893>\
**Category:** C++\
**Tags:** build\
**Created:** [August 23, 2021, 4:21pm UTC](https://forum.opencv.org/t/build-opencv-with-lapack-eigen-for-ios-android/4893 "2021-08-23T16:21:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shirbar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/shirbar/32/6895_2.png) [@shirbar](https://forum.opencv.org/u/shirbar)\
**Post date:** [August 23, 2021, 4:21pm UTC](https://forum.opencv.org/t/build-opencv-with-lapack-eigen-for-ios-android/4893/1 "2021-08-23T16:21:56Z")

</div>

Hi,  
In my project I need to use the optimized version of ransac( **cv::USAC\_FAST** ) like this:

cv::findEssentialMat(ref\_points, curr\_points, 1.0,  
cv::Point2d(0, 0), cv::USAC\_FAST, confg,  
thre, status\_e);  
I’m getting this error while running on ios:

terminating with uncaught exception of type cv::Exception: OpenCV(4.5.1) /Users/shir.barzel/opencv/modules/calib3d/src/usac/essential\_solver.cpp:197: error: (-213:The function/feature is not implemented) To use essential matrix solver LAPACK or Eigen has to be installed! in function ‘estimate’

as I understand I need EIGEN or LAPACK  
There is no option for that in the:  
opencv/platforms/ios/build\_framework.py script  
so I’ve tried to add the cmake flags:  
WITH\_EIGEN or WITH\_LAPACK to the script, but it’s doesn’t really works  
anyone has some tutorial on how to do it?  
Thanks

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [August 23, 2021, 5:15pm UTC](https://forum.opencv.org/t/build-opencv-with-lapack-eigen-for-ios-android/4893/2 "2021-08-23T17:15:32Z")

</div>

cant help with LAPACK, but adding Eigen support should be as easy as:

- download : [http://eigen.tuxfamily.org/](http://eigen.tuxfamily.org/) and unzip  
(it is a “headers only” lib, no “install” needed)
- WITH\_EIGEN=ON (cmake)
- EIGEN\_INCLUDE\_PATH=/path/to/Eigen\_toplevel\_folder (cmake)

  

carefully observe the cmake output,  
it should show up under " Other third-party libraries:"
