-
Notifications
You must be signed in to change notification settings - Fork 85
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
undefined reference to "shm_xxx" #111
Comments
I temporarily fixed the linking error by modifying the build file, build-support/macros-and-definitions.cmake. However, new command lines will be needed for building dependency to ns3-ai modules. if(${NS3_STATIC} AND (NOT BEXEC_STANDALONE)) |
Hi, @mkris0714. Could you provide your OS version and the command you are running, to reproduce the error? |
Hi, @ShenMuyuan.
In addition, "ns3-ai v1.2.0" is compatible with ns3 version 3.37, not with version 3.38 (based on "rl-tcp example" execution). please check, ns3-ai v1.2.0 with ns3 3.38 Thank you ! |
In development of the main branch, we used a mix of Ubuntu 22.04 virtual machine and WSL, rather than Ubuntu 20.04 in docker. Your issue may be the difference of system libraries, as in our Ubuntu 22.04 the ns3ai_apb_gym can run without librt linking explicitly. So,
build_lib(
LIBNAME ai
SOURCE_FILES ${msg_interface_srcs} ${gym_interface_srcs}
HEADER_FILES ${msg_interface_hdrs} ${gym_interface_hdrs}
LIBRARIES_TO_LINK ${libcore} Boost::program_options protobuf::libprotobuf rt
) This method avoids changing the global build process of ns-3.
The v1.2.0 is outdated (with the old API) and we have no plan to update its compatibility. We will release a new version soon (with the new API), based on current main branch. |
Thank you for your kind solution ! I support the ns3-ai module. That module is very convenient for running rl on ns3. Have a nice day |
In the ns3-ai build processing, the below undefined error occurred.
It's the problem that cmake should be performed including the option "-lrt".
I tried to address the problem using in "set(CXXFLAGS="-lrt") command" or ns3 configure CXXFLAGS, but I failed.
How can I fix it ?
[100%] Linking CXX shared library /root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/build/lib/libns3.38-core-default.so
[100%] Linking CXX shared library /root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/build/lib/libns3.38-ai-default.so
[100%] Building CXX object contrib/ai/examples/a-plus-b/CMakeFiles/ns3ai_apb_gym.dir/use-gym/apb.cc.o
[100%] Linking CXX executable /root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/build/contrib/ai/examples/a-plus-b/ns3.38-ns3ai_apb_gym-default
/usr/bin/ld: /root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/build/lib/libns3.38-ai-default.so: undefined reference to
shm_open' /usr/bin/ld: /root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/build/lib/libns3.38-ai-default.so: undefined reference to
shm_unlink'collect2: error: ld returned 1 exit status
make[3]: *** [contrib/ai/examples/a-plus-b/CMakeFiles/ns3ai_apb_gym.dir/build.make:101: /root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/build/contrib/ai/examples/a-plus-b/ns3.38-ns3ai_apb_gym-default] Error 1
make[2]: *** [CMakeFiles/Makefile2:4673: contrib/ai/examples/a-plus-b/CMakeFiles/ns3ai_apb_gym.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:4679: contrib/ai/examples/a-plus-b/CMakeFiles/ns3ai_apb_gym.dir/rule] Error 2
make: *** [Makefile:1038: ns3ai_apb_gym] Error 2
Finished executing the following commands:
cd cmake-cache; /usr/local/bin/cmake --build . -j 7 --target ns3ai_apb_gym ; cd ..
The text was updated successfully, but these errors were encountered: