Skip to content

fix macro conflict#23

Open
kirazero17 wants to merge 2 commits into
HapCommSys:mainfrom
long-in-hust:fix-log-macro-conflict
Open

fix macro conflict#23
kirazero17 wants to merge 2 commits into
HapCommSys:mainfrom
long-in-hust:fix-log-macro-conflict

Conversation

@kirazero17

Copy link
Copy Markdown

Somehow I've got this error while building ns-3.39 with p4sim:

/home/p4/ns-3/ns3.39/src/core/model/log.h:275:38: error: expected unqualified-id before numeric constant
  275 | #define NS_LOG_INFO(msg) NS_LOG(ns3::LOG_INFO, msg)

The enum LOG_INFO is conflicting with the behavioral model LOG_INFO and is replaced as ns3::<some number>, causing a compilation error.

…he libbmruntime.a from the bmv2 build folder to /usr/local/lib, then edit the cmakelist and the set_pkg_config_env script as I do
@Mingyumaz

Copy link
Copy Markdown
Contributor

I think PR #23 should remove all references to bmruntime.

bmruntime.pc may exist, but it points to -lbmruntime, while BMv2 does not actually install libbmruntime.so or libbmruntime.a into /usr/local/lib. The library is marked as non-installed by BMv2's autotools build system, so the linker fails with:

/usr/bin/ld: cannot find -lbmruntime

The correct dependency is already covered by bm.pc, which links against libbmall. libbmall contains the required bm_runtime symbols, so no separate bmruntime dependency is needed.

Suggested PR #23 changes:

  • Remove bmruntime from third_party_libraries in CMakeLists.txt.
  • Remove the find_library(BMRUNTIME_LIB ...) fallback search block.
  • Remove the bmruntime.pc generation block from set_pkg_config_env.sh.

This avoids generating or using a broken pkg-config entry for a library that BMv2 does not install.

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.

2 participants