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
Copy file name to clipboardexpand all lines: DEVELOPER_GUIDE.md
+5-87
Original file line number
Diff line number
Diff line change
@@ -62,11 +62,6 @@ One easy way to install on mac or linux is to use pip:
62
62
pip install cmake==3.24.0
63
63
```
64
64
65
-
On Mac M series machines, install cmake using:
66
-
```bash
67
-
brew install cmake
68
-
```
69
-
70
65
#### Faiss Dependencies
71
66
72
67
To build the *faiss* JNI library, you need to have openmp, lapack and blas installed. For more information on *faiss*
@@ -77,87 +72,15 @@ dependencies, please refer to [their documentation](https://github.com/facebookr
77
72
brew install openblas
78
73
```
79
74
80
-
Additionally, the `gcc` toolchain needs to be installed on Mac. To install, run:
81
-
```bash
82
-
brew install gcc
83
-
```
84
-
85
-
#### Additional setup for Mac M series Machines
86
-
87
-
The following commands enable running/building k-NN on M series machines:
88
-
75
+
OpenMP can be installed on Mac via:
89
76
```bash
90
-
// Go to k-NN folder
91
-
cd k-NN
92
-
93
-
// Build to generate the necessary files to be modified below (will fail)
94
-
./gradlew build
95
-
96
-
//Go to jni folder
97
-
cd jni
98
-
99
-
// File changes required
100
-
sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake
101
-
sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp
102
-
sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc
103
-
// Change -mcpu value to use chip version according to your M series, for example, -mcpu=apple-m1. You can see the supported mcpu values via gcc --print-supported-cpus
104
-
sed -i -e 's/-march=native/-mcpu=apple-m1/g' external/nmslib/similarity_search/CMakeLists.txt
105
-
sed -i -e 's/-mcpu=apple-a14/-mcpu=apple-m1/g' external/nmslib/python_bindings/setup.py
// In case of linking issues with the external libraries and clang, you can try setting the CMAKE compiler to gcc/g++ instead through the following commands:
4. You should see a opensearch-min-<version>-SNAPSHOT-darwin-x64.tar.gz file present in distribution/archives/darwin-tar/build/distributions/
134
-
5. Build k-NN by passing the OpenSearch distribution path in`./gradlew <integTest/run> -PcustomDistributionUrl="<Full path to .tar.gz file you noted above>"`
135
-
136
-
If you want to start OpenSearch directly on Mac M series, make sure to use JDK for ARM. Otherwise, you will see the following error: `mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')`. It is better to start OpenSearch by running `bash opensearch-tar-install.sh` instead of `./bin/opensearch`. To run `./bin/opensearch`, the environment variable `JAVA_LIBRARY_PATH` needs to be set correctly so that OpenSearch can find the JNI library:
137
-
138
-
```
139
-
export OPENSEARCH_HOME=the directory of opensearch...
execute_process(COMMAND sh -c "git --no-pager show HEAD | git patch-id --stable"OUTPUT_VARIABLE PATCH_ID_OUTPUT_FROM_COMMIT WORKING_DIRECTORY${CMAKE_CURRENT_SOURCE_DIR}/external/nmslib)
0 commit comments