Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ANO linking warning #463

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

JohnMoon-VTS
Copy link
Contributor

Currently, when building an app that uses the Advanced Network Operator (ANO), CMake throws some warnings:

CMake Warning at operators/advanced_network/CMakeLists.txt:87 (target_link_libraries):
  Target "<target>" requests linking to directory
  "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is
  dropping the item.

Like it says, there are directories being passed into target_link_libraries with -L which is not supported.

Instead, let's use target_link_directories which is already being used in the ANO CMakeLists.txt file to pass those DPDK and DOCA directories.

@jjomier
Copy link
Contributor

jjomier commented Aug 12, 2024

@cliffburdick can you review?

@@ -83,8 +83,10 @@ target_compile_options(advanced_network_rx PUBLIC ${DPDK_CFLAGS})
target_compile_options(advanced_network_tx PUBLIC ${DPDK_CFLAGS})

target_link_libraries(advanced_network_common PUBLIC holoscan::core)
target_link_libraries(advanced_network_common PUBLIC -L${DPDK_LIBRARY_DIRS} ${DPDK_LIBRARIES} ${DPDK_EXTRA_LIBS})
target_link_libraries(advanced_network_common PUBLIC -L${DOCA_LIBRARY_DIRS} -ldoca_gpunetio libdoca_gpunetio_device.a -ldoca_common -ldoca_argp -ldoca_eth -ldoca_flow)
target_link_directories(advanced_network_common PUBLIC ${DPDK_LIBRARY_DIRS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just combine the DOCA and DPDK libs into a single line?

Copy link
Contributor

@cliffburdick cliffburdick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consolidating a couple lines

@JohnMoon-VTS JohnMoon-VTS force-pushed the cmake-ano-warning-fix branch from 929fb3e to 25862d1 Compare August 12, 2024 21:23
@jjomier
Copy link
Contributor

jjomier commented Aug 15, 2024

@cliffburdick are we good to merge?

@jjomier jjomier requested a review from cliffburdick August 15, 2024 21:22
@cliffburdick
Copy link
Contributor

@cliffburdick are we good to merge?

Yes, sorry, just saw it was addressed.

@jjomier
Copy link
Contributor

jjomier commented Aug 15, 2024

@cliffburdick are we good to merge?

Yes, sorry, just saw it was addressed.

Can you approve the review?

@JohnMoon-VTS JohnMoon-VTS force-pushed the cmake-ano-warning-fix branch from d27f105 to 7383789 Compare August 20, 2024 15:28
@JohnMoon-VTS
Copy link
Contributor Author

@cliffburdick, I went ahead and rebased - this should be ready for review. Thanks!

Currently, when building an app that uses the Advanced Network Operator
(ANO), CMake throws some warnings:

```
CMake Warning at operators/advanced_network/CMakeLists.txt:87 (target_link_libraries):
  Target "<target>" requests linking to directory
  "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is
  dropping the item.
```

Like it says, there are directories being passed into
target_link_libraries with -L which is not supported.

Instead, let's use target_link_directories which is already being used
in the ANO CMakeLists.txt file to pass those DPDK and DOCA directories.

Signed-off-by: John Moon <john.moon@vts-i.com>
@JohnMoon-VTS JohnMoon-VTS force-pushed the cmake-ano-warning-fix branch from 7383789 to cdb682e Compare August 26, 2024 15:23
@JohnMoon-VTS
Copy link
Contributor Author

@jjomier, I just rebased again. Anything else blocking merge?

@jjomier jjomier requested a review from cliffburdick August 26, 2024 16:00
@jjomier jjomier merged commit cce6d37 into nvidia-holoscan:main Aug 26, 2024
3 checks passed
sohamm17 pushed a commit that referenced this pull request Sep 3, 2024
Currently, when building an app that uses the Advanced Network Operator
(ANO), CMake throws some warnings:

```
CMake Warning at operators/advanced_network/CMakeLists.txt:87 (target_link_libraries):
  Target "<target>" requests linking to directory
  "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is
  dropping the item.
```

Like it says, there are directories being passed into
target_link_libraries with -L which is not supported.

Instead, let's use target_link_directories which is already being used
in the ANO CMakeLists.txt file to pass those DPDK and DOCA directories.

Signed-off-by: John Moon <john.moon@vts-i.com>
@JohnMoon-VTS JohnMoon-VTS deleted the cmake-ano-warning-fix branch November 5, 2024 17:01
ronyrad pushed a commit to ronyrad/holohub that referenced this pull request Nov 8, 2024
Currently, when building an app that uses the Advanced Network Operator
(ANO), CMake throws some warnings:

```
CMake Warning at operators/advanced_network/CMakeLists.txt:87 (target_link_libraries):
  Target "<target>" requests linking to directory
  "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is
  dropping the item.
```

Like it says, there are directories being passed into
target_link_libraries with -L which is not supported.

Instead, let's use target_link_directories which is already being used
in the ANO CMakeLists.txt file to pass those DPDK and DOCA directories.

Signed-off-by: John Moon <john.moon@vts-i.com>
Signed-off-by: Rony Rado <rrado@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants