# Opensearch knn build.sh failed for :cmakeJniLib

**URL:** <https://forum.opensearch.org/t/opensearch-knn-build-sh-failed-for-cmakejnilib/23149>\
**Category:** Build\
**Tags:** troubleshoot, configure\
**Created:** [January 21, 2025, 5:42am UTC](https://forum.opensearch.org/t/opensearch-knn-build-sh-failed-for-cmakejnilib/23149 "2025-01-21T05:42:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maha](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Maha](https://forum.opensearch.org/u/Maha)\
**Post date:** [January 21, 2025, 5:42am UTC](https://forum.opensearch.org/t/opensearch-knn-build-sh-failed-for-cmakejnilib/23149/1 "2025-01-21T05:42:23Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):

Opensearch 2.18.0

**Describe the issue** :

We are trying to build **opensearch-knn** library for our development purpose.  
We are not able to build the knn with below mentioned errors.

**Configuration** :

**Relevant Logs or Screenshots** :

– Found BLAS: /usr/lib64/libblas.so

The Fortran compiler identification is unknown  
CMake Error at cmake/init-faiss.cmake:76 (enable\_language):

No CMAKE\_Fortran\_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment

variable “FC” or the CMake cache entry CMAKE\_Fortran\_COMPILER to the full  
path to the compiler, or to the compiler name if it is in the PATH.  
Call Stack (most recent call first):

CMakeLists.txt:107 (include)

- Configuring incomplete, errors occurred!

FAILURE: Build failed with an exception.

- What went wrong:

Execution failed for task ‘:cmakeJniLib’.

> Process ‘command ‘cmake’’ finished with non-zero exit value 1

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [January 21, 2025, 10:54am UTC](https://forum.opensearch.org/t/opensearch-knn-build-sh-failed-for-cmakejnilib/23149/2 "2025-01-21T10:54:08Z")

</div>

@Maha Did you follow the suggestion from the error and set either FC env variable or CMAKE\_Fortran\_COMPILER cache entry?

---

<div class="post-metadata">

**Author:** ![KateWinslet](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/katewinslet/32/6694_2.png) [@KateWinslet](https://forum.opensearch.org/u/KateWinslet)\
**Post date:** [January 30, 2025, 8:35pm UTC](https://forum.opensearch.org/t/opensearch-knn-build-sh-failed-for-cmakejnilib/23149/3 "2025-01-30T20:35:15Z")

</div>

> [@Maha](#):
>
> **Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):
> 
> Opensearch 2.18.0
> 
> **Describe the issue** :
> 
> We are trying to build **opensearch-knn** library for our development purpose.  
> We are not able to build the knn with below mentioned errors.
> 
> **Configuration** :
> 
> **Relevant Logs or Screenshots** :
> 
> – Found BLAS: /usr/lib64/libblas.so
> 
> The Fortran compiler identification is unknown  
> CMake Error at cmake/init-faiss.cmake:76 (enable\_language):  
> [부달](https://xn--bk1bp4r.info) [تحميل تطبيق انمي سلاير](https://animeslayer.me)  
> No CMAKE\_Fortran\_COMPILER could be found.
> 
> Tell CMake where to find the compiler by setting either the environment
> 
> variable “FC” or the CMake cache entry CMAKE\_Fortran\_COMPILER to the full  
> path to the compiler, or to the compiler name if it is in the PATH.  
> Call Stack (most recent call first):
> 
> CMakeLists.txt:107 (include)
> 
> - Configuring incomplete, errors occurred!
> 
> FAILURE: Build failed with an exception.
> 
> - What went wrong:
> 
> Execution failed for task ‘:cmakeJniLib’.
> 
> > Process ‘command ‘cmake’’ finished with non-zero exit value 1

The issue is caused by a missing Fortran compiler. Install a Fortran compiler (e.g., gfortran) and set the CMake\_Fortran\_COMPILER path.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [March 31, 2025, 8:36pm UTC](https://forum.opensearch.org/t/opensearch-knn-build-sh-failed-for-cmakejnilib/23149/4 "2025-03-31T20:36:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
