farm-haystack with FAISS on Mac (Monterey) - haystack

I had a hard time installing farm-haystack with FAISS on Mac. So, I decided to document the solution here for others.
When trying to install pip install 'farm-haystack[docstores,faiss]' it failed with the following error
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
The solution was to run xcode-select --install and re-install haystack and it solved the problem.
Then when importing the haystack and running the program I got the following error -Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized
To solve this, I needed to tell Conda to not use MKL conda install nomkl. But installing nomkl after installing farm-haystack doesn't solve the problem. I need to start with a new environment.
To summarize, here are the steps.
xcode-select --install
Create new conda environment
conda install nomkl
pip install 'farm-haystack[docstores,faiss]'

Related

K framework installation repeatedly fails on MacBookPro 19 OS X Mojave 10.14.6

I am trying to install Kframework without success. I installed all the dependencies following instructions at https://github.com/kframework/k/tree/master#prerequisite-install-guide and updated the environment variables as suggested.
I have export PATH="~/z3-4.8.7-x64-osx-10.14.6/bin:$PATH" .
I am running:
brew uninstall kframework
brew uninstall z3, and uninstall the version installed outside of brew
brew clean && brew update && brew upgrade
brew install z3 kframework
Brew install kframework produces the following warning about Command Line Tools:
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
and eventually ends with
<<< ERROR!
143 org.kframework.utils.errorsystem.KEMException: [Error] Critical: Could not start z3 pr ocess (IOException: Cannot run program "z3": error=2, No such file or directory)(Even though my CLT are up to date and installed in the right place ).
My CommanLineTools seem legit. I have Xcode Version 11.3.1 (11C505),
and have installed CommanLineTools from a binary I downloaded from apple development site Command_Line_Tools_for_Xcode_11.3.1.dmg
Typing "xcode-select -p" gives
/Library/Developer/CommandLineTools
my z3 is : z3 -version
Z3 version 4.8.7 - 64 bit (binary downloaded from z3 website) .
I tried this also with Z3 version 4.8.12
Any advice appreciated.

Error installing homebrew on MacOS 10.14 Beta Mojave

Im trying to install Homebrew on a fresh install of MacOS Mojave 10.14 beta.
Yet after running /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" (this is from https://brew.sh)
I am getting the error,
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Failed during: /usr/bin/sudo /usr/bin/xcode-select --install
I have both the current command line tools from Xcode 9.4 and the beta command line tools for Xcode 10.0 beta.
Is there currently any workaround to allow me to install Homebrew?
I believe the problem is that the Command Line Tools for Xcode 10 do not install headers in /usr/include, but the install script checks there:
https://github.com/Homebrew/install/blob/bbf4a3a8b247c7dba159c3d557cc3853dd764171/install#L110
Thankfully, the code that tries to run xcode-select --install is bypassed if STDIN is not a TTY. Try adding a 0<&- after the install command to close STDIN and skip this command. I just tried it and it worked for me.
As an aside, Homebrew does not officially support 10.14 yet, and the maintainers do not want you to file issues about any problems you find. (Pull requests seem welcome, though.) Unfortunately this means that the Homebrew issue tracker is not a place to discuss problems and solutions.

Trying to install appium-xcuitest-driver

Trying to install appium-xcuitest-driver
I am getting the following error:
stderr: xcode-select: error: tool 'xcodebuild' requires Xcode, but
active developer directory '/Library/Developer/CommandLineTools'
is a command line tools instance
I have xcode installed and up and running and every solution that I am coming across says to install Xcode, so I am not sure about what to do.
Simply run sudo xcode-select -r which should automatically reset the path.
then run the following command npm install -g ios-deploy

Trouble with brew install devil

RGBDSLAM install is asking for devil
$ rosdep install rgbdslam
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rgbdslam: No definition of [libdevil-dev] for OS [osx]
But when I try to install devil I'm getting this:
$ brew install devil
Error: devil cannot be built with any available compilers.
To install this formula, you may need to:
brew install gcc
$ brew install gcc
Warning: gcc-5.3.0 already installed
How can I get around this?
Note: I have xcode installed accompanied with the command line tools.
** EDIT libdevIL installed **
for some reason gcc 5 doesn't register when devIL is looking for gcc so I had to downgrade to 4.9.
$ brew rm gcc // removes 5
$ brew install gcc49 // installs 4.9
$ brew install devil // works
$ brew install gcc // two gcc installed? this might be interesting
rgbdslam still isn't detecting libdevIL though, not sure what the deal is.
Here's some helpful notes from answers.ros.org
I set siftgpu_disable_devil = 0 in SiftGPU/makefile and
set(ENV{SIFT_GPU_MODE} 0) in CMakeLists.txt with no avail. I'm
still seeing rgbdslam: No definition of [libdevil-dev] for OS [osx]
Commenting devIL out in package.xml put me a little further but
into some seemingly OSX specific issues, trying to resolve those via
github. Will respond here once I have a solution. Thanks for your
assistance.

Error installing openCV 2.3.0 / 2.3.1 on mac os X 10.6.8

I am trying since two days to install OpenCV 2.3.0 or 2.3.1 on my mac 10.6.8 snow leopard. I followed the following commands
$ cd /Users/ateendra/Desktop/OpenCV-2.3.0/
$ mkdir build
$ cd build/
$ cmake -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C/CXX_FLAGS=-m32 ..
$ ccmake .
$ make -j8
$ sudo make install
now i get the following errors
/Users/ateendra/Desktop/OpenCV-2.3.0/modules/highgui/src/grfmt_exr.hpp:83: error: reference to ‘PixelType’ is ambiguous
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers /QuickdrawTypes.h:193: error: candidates are: typedef SInt8 PixelType
/opt/local/include/OpenEXR/ImfPixelType.h:49: error: enum Imf::PixelType
/Users/ateendra/Desktop/OpenCV-2.3.0/modules/highgui/src/grfmt_exr.hpp:83: error: ‘PixelType’ does not name a type
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/loadsave.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
Well, this is a common problem to compile opencv under mac os, though it is usually solvable by modifying opencv sources a bit. (I faced this problem twice, and I always changed sources a bit to make everything compile).
However, the last time I was installing opencv, I've just used brew:
brew install opencv
Didn't have any problems with it.
I've managed to install OpenCV 2.3.1 on OSX 10.6.8, but I've done it using MacPorts, (which I recommend as it deals with dependencies and building for you):
Make sure you've got Apple Developer Tools installed (or at least XCode with the command line tools)
Install MacPorts (if you haven't done so already)
Install OpenCV via MacPorts:
sudo port install opencv
For more details see Build via MacPorts on the wiki.
I also have to mention that I did run into an error, but that was because of a previous existing dylib in the wrong place.

Resources