# Not able to build the project

**URL:** <https://forum.opensearch.org/t/not-able-to-build-the-project/11120>\
**Category:** Build\
**Tags:** troubleshoot, configure, install\
**Created:** [October 3, 2022, 5:52am UTC](https://forum.opensearch.org/t/not-able-to-build-the-project/11120 "2022-10-03T05:52:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harisalam](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@harisalam](https://forum.opensearch.org/u/harisalam)\
**Post date:** [October 3, 2022, 5:52am UTC](https://forum.opensearch.org/t/not-able-to-build-the-project/11120/1 "2022-10-03T05:52:29Z")

</div>

Hello OpenSearch Team,

From the past 2-3 weeks I have been struggling to build the project successfully, and now I have decided to seek help of amazing and talented people here. I have tried different configuration for CMake but all he time the buildJniLib fails with the following errors:

– Found Threads.

– OS: Darwin

– Compiler: Clang 14.0.0

– CXX flags release: -Wall -Wunreachable-code -Wcast-align -O3 -DNDEBUG -std=c++11 -DHAVE\_CXX0X -pthread -fpic -march=native

– CXX flags debug: -Wall -Wunreachable-code -Wcast-align -ggdb -DNDEBUG -std=c++11 -DHAVE\_CXX0X -pthread -fpic -march=native

– Found OpenMP\_C: -Xpreprocessor -fopenmp

– Found OpenMP\_CXX: -Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include

– Found OpenMP: TRUE

– Found OpenMP\_C: -Xpreprocessor -fopenmp

– Found OpenMP\_CXX: -Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include

– Found OpenMP: TRUE (found version “4.5”)

– Could NOT find MKL (missing: MKL\_LIBRARIES)

– Configuring done

– Generating done

– Build files have been written to: /Users/harisalam/Desktop/OpenSearch K-NN/k-NN/jni/googletest-download

[11%] Performing update step for ‘googletest’

[22%] No patch step for ‘googletest’

[33%] No configure step for ‘googletest’

[44%] No build step for ‘googletest’

[55%] No install step for ‘googletest’

[66%] No test step for ‘googletest’

[77%] Completed ‘googletest’

[100%] Built target googletest

– Configuring done

– Generating done

– Build files have been written to: /Users/harisalam/Desktop/OpenSearch K-NN/k-NN/jni

**\> Task :buildJniLib** FAILED

[2%] Building CXX object external/nmslib/similarity\_search/src/CMakeFiles/NonMetricSpaceLib.dir/distcomp\_bregman.cc.o

clang: error: the clang compiler does not support ‘-march=native’

make[3]: \*\*\* [external/nmslib/similarity\_search/src/CMakeFiles/NonMetricSpaceLib.dir/distcomp\_bregman.cc.o] Error 1

make[2]: \*\*\* [external/nmslib/similarity\_search/src/CMakeFiles/NonMetricSpaceLib.dir/all] Error 2

make[1]: \*\*\* [CMakeFiles/opensearchknn\_nmslib.dir/rule] Error 2

make: \*\*\* [opensearchknn\_nmslib] Error 2

FAILURE: Build failed with an exception.

- What went wrong:

Execution failed for task ‘:buildJniLib’.

> Process ‘command ‘make’’ finished with non-zero exit value 2

- Try:

> Run with **–stacktrace** option to get the stack trace.

> Run with **–info** or **–debug** option to get more log output.

> Run with **–scan** to get full insights.

- Get more help at **[https://help.gradle.org](https://help.gradle.org)**

**BUILD FAILED** in 2s

---

<div class="post-metadata">

**Author:** ![rishabh6788](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@rishabh6788](https://forum.opensearch.org/u/rishabh6788)\
**Post date:** [October 25, 2022, 10:22pm UTC](https://forum.opensearch.org/t/not-able-to-build-the-project/11120/2 "2022-10-25T22:22:46Z")

</div>

It seems you are building on Apple M1. Have you tried this [c++ - Why does march=native not work on Apple M1? - Stack Overflow](https://stackoverflow.com/questions/65966969/why-does-march-native-not-work-on-apple-m1)

---

<div class="post-metadata">

**Author:** ![harisalam](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@harisalam](https://forum.opensearch.org/u/harisalam)\
**Post date:** [October 30, 2022, 11:22pm UTC](https://forum.opensearch.org/t/not-able-to-build-the-project/11120/3 "2022-10-30T23:22:02Z")

</div>

@rishabh6788 I was able to override that error, but right now integTest is failing because it’s not able to resolve opensearch:3.0.0-SNAPSHOT.  
 ![Screen Shot 2022-10-30 at 5.03.49 PM](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/4/4e6dfbcff23ca93abb2e172f5581f099db16fe13.png)

---

<div class="post-metadata">

**Author:** ![harisalam](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@harisalam](https://forum.opensearch.org/u/harisalam)\
**Post date:** [October 30, 2022, 11:24pm UTC](https://forum.opensearch.org/t/not-able-to-build-the-project/11120/4 "2022-10-30T23:24:27Z")

</div>

@rishabh6788 [https://artifacts.opensearch.org/snapshots/core/opensearch/3.0.0-SNAPSHOT/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64-latest.tar.gz](https://artifacts.opensearch.org/snapshots/core/opensearch/3.0.0-SNAPSHOT/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64-latest.tar.gz) isn’t accessible and getting PERMISSION DENIED error when I try to access it is using HTTPS.
