# DOCA sample compile error

**URL:** <https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190>\
**Category:** Enterprise Networking\
**Created:** [March 23, 2023, 1:50pm UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190 "2023-03-23T13:50:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy690100391](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@andy690100391](https://forums.developer.nvidia.com/u/andy690100391)\
**Post date:** [March 23, 2023, 1:50pm UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/1 "2023-03-23T13:50:27Z")

</div>

Hi,  
I have tried to compile sample code on BF2, but face error below. And I have tried the method in document [1.1. Meson Complains About Missing Dependencies](https://docs.nvidia.com/doca/archive/doca-v1.3/troubleshooting/index.html#meson-complains-about-missing-dependencies) . It still didn’t work, How to fix the problem thx.

ubuntu@localhost\*\*: **/opt/mellanox/doca/samples/doca\_flow/flow\_monitor\_meter** $ sudo meson build

**The Meson build system**

Version: 0.61.2

Source dir: **/opt/mellanox/doca/samples/doca\_flow/flow\_monitor\_meter**

Build dir: **/opt/mellanox/doca/samples/doca\_flow/flow\_monitor\_meter/build**

Build type: **native build**

Program **cat** found: **YES** (/usr/bin/cat)

Project name: **DOCA\_SAMPLE**

Project version: **1.5.0055**

C compiler for the host machine: **cc** (gcc 9.4.0 “cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0”)

C linker for the host machine: **cc** ld.bfd 2.34

C++ compiler for the host machine: **c++** (gcc 9.4.0 “c++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0”)

C++ linker for the host machine: **c++** ld.bfd 2.34

Host machine cpu family: **aarch64**

Host machine cpu: **aarch64**

Found pkg-config: **/usr/bin/pkg-config** (0.29.1)

Found CMake: **/usr/bin/cmake** (3.16.3)

Run-time dependency **doca-common** found: **NO** (tried pkgconfig and cmake)

meson.build:29:0: **ERROR:** Dependency “doca-common” not found, tried pkgconfig and cmake

---

<div class="post-metadata">

**Author:** ![satish.puri](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@satish.puri](https://forums.developer.nvidia.com/u/satish.puri)\
**Post date:** [April 18, 2023, 9:14pm UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/2 "2023-04-18T21:14:30Z")

</div>

I also got the same error. The information provided in the trouble shooting document did not work. Please provide any suggestion.

---

<div class="post-metadata">

**Author:** ![andy690100391](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@andy690100391](https://forums.developer.nvidia.com/u/andy690100391)\
**Post date:** [April 19, 2023, 6:41am UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/3 "2023-04-19T06:41:47Z")

</div>

I have tried to unset PKG\_CONFIG\_PATH and tried to follow trouble shooting document again and it worked

---

<div class="post-metadata">

**Author:** ![ys\_liu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ys\_liu](https://forums.developer.nvidia.com/u/ys_liu)\
**Post date:** [April 25, 2023, 9:03am UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/4 "2023-04-25T09:03:46Z")

</div>

try with command “sudo -E meson build” which passes user environmental variables to sudo

---

<div class="post-metadata">

**Author:** ![IamAries](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/iamaries/32/261634_2.png) [@IamAries](https://forums.developer.nvidia.com/u/IamAries)\
**Post date:** [July 13, 2023, 12:10pm UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/5 "2023-07-13T12:10:01Z")

</div>

Have you tried setting these environment variables?

export PKG\_CONFIG\_PATH=${PKG\_CONFIG\_PATH}:/opt/mellanox/doca/lib/aarch64-linux-gnu/pkgconfig:/opt/mellanox/flexio/lib/pkgconfig  
export PKG\_CONFIG\_PATH=${PKG\_CONFIG\_PATH}:/opt/mellanox/dpdk/lib/aarch64-linux-gnu/pkgconfig  
export PATH=${PATH}:/opt/mellanox/doca/tools

-J

---

<div class="post-metadata">

**Author:** ![cs.lev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/cs.lev/32/83987_2.png) [@cs.lev](https://forums.developer.nvidia.com/u/cs.lev)\
**Post date:** [February 14, 2024, 3:48am UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/6 "2024-02-14T03:48:30Z")

</div>

Thanks.  
I had a runtime dependency to `doca`, without the `-common`, but your advise was a solution for me. Thanks.

After this, I am wondering that if we can compile source on the Bluefield, why does the documentation recommend us to install and download a dev-container on the Bluefield. For now, it seems like an unnecessary extra layer that can clearly complicate things when it comes to remote code development…

---

<div class="post-metadata">

**Author:** ![cs.lev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/cs.lev/32/83987_2.png) [@cs.lev](https://forums.developer.nvidia.com/u/cs.lev)\
**Post date:** [February 15, 2024, 6:32am UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/7 "2024-02-15T06:32:46Z")

</div>

I want to run the ARM storm sample app that is using doca-flow. But after trying to compile it, now I have a similar issue as above w.r.t. doca-flow.

```auto
Run-time dependency doca-flow found: NO (tried pkgconfig and cmake)

meson.build:37:0: ERROR: Dependency "doca-flow" not found, tried pkgconfig and cmake

```

The above exports do not help, but I indeed see the libdoca\_flow modules under the path we add, i.e., `/opt/mellanox/doca/lib/aarch64-linux-gnu/`

Any suggestions?

---

<div class="post-metadata">

**Author:** ![nikewang\_2022](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nikewang\_2022](https://forums.developer.nvidia.com/u/nikewang_2022)\
**Post date:** [February 26, 2024, 9:48am UTC](https://forums.developer.nvidia.com/t/doca-sample-compile-error/247190/8 "2024-02-26T09:48:27Z")

</div>

“vim /etc/profile”, then add below command to the tail!  
export PKG\_CONFIG\_PATH=/opt/mellanox/doca/lib/aarch64-linux-gnu//pkgconfig/:/opt/mellanox/dpdk/lib/aarch64-linux-gnu/pkgconfig/:/opt/mellanox/flexio/lib/pkgconfig/:/opt/mellanox/grpc/lib/pkgconfig/:/opt/mellanox/grpc/share/pkgconfig/:/opt/mellanox/spdk/lib/pkgconfig/

then exec command “source /etc/profile”;  
anyway , you‘d better be root role
