Ns3-gym build error in ns3.36

86 views
Skip to first unread message

sarathb...@gmail.com

unread,
Jun 9, 2024, 1:06:44 PM6/9/24
to ns-3-users
Does any one face the same buld error while installing ns3-gym. How can I solve it ?
./ns3 build
[0/2] Re-checking globbed directories...
[78/1468] Building CXX object contrib/...rn.dir/interference-pattern/mygym.cc.o
FAILED: contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/mygym.cc.o
/usr/bin/c++ -DCMAKE_EXAMPLE_AS_TEST -DHAVE_LIBXML2 -DHAVE_SQLITE3 -DNS3_ASSERT_ENABLE -DNS3_BUILD_PROFILE_DEBUG -DNS3_ENABLE_EXAMPLES -DNS3_LOG_ENABLE -DPROJECT_SOURCE_PATH=\"/home/sarath/ns-allinone-3.36.1/ns-3.36.1\" -D__LINUX__ -I/usr -I/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gtk-3.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/libxml2 -I/usr/include/python3.10 -O2 -g -DNDEBUG -fPIE   -fno-semantic-interposition -fdiagnostics-color=always -Wall -std=gnu++17 -Winvalid-pch -include /home/sarath/ns-allinone-3.36.1/ns-3.36.1/cmake-cache/CMakeFiles/stdlib_pch_exec.dir/cmake_pch.hxx -MD -MT contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/mygym.cc.o -MF contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/mygym.cc.o.d -o contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/mygym.cc.o -c /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/mygym.cc
In file included from /usr/include/c++/11/complex.h:38,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/matrix-based-channel-model.h:25,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/spectrum-module.h:17,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/mygym.h:27,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/mygym.cc:21:
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:138:79: error: expected ‘>’ before ‘(’ token
  138 | template <typename V, typename T, template <typename...> class U, typename ...I,
      |                                                                               ^
In file included from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/core-module.h:19,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/mygym.cc:23:
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:142:29: error: expansion pattern ‘(__complex__ float){0.0f, 1.0e+0f}’ contains no parameter packs
  142 | DoMakeAccessorHelperOne (U<I...> T::*memberContainer)
      |                             ^~~
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:142:32: error: template argument 1 is invalid
  142 | DoMakeAccessorHelperOne (U<I...> T::*memberContainer)
      |                                ^
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h: In function ‘ns3::Ptr<const ns3::AttributeAccessor> ns3::DoMakeAccessorHelperOne(int T::*)’:
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:152:25: error: expansion pattern ‘(__complex__ float){0.0f, 1.0e+0f}’ contains no parameter packs
  152 |     MemberContainer (U<I...> T::*memberContainer)
      |                         ^~~
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:152:28: error: template argument 1 is invalid
  152 |     MemberContainer (U<I...> T::*memberContainer)
      |                            ^
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:180:8: error: expansion pattern ‘(__complex__ float){0.0f, 1.0e+0f}’ contains no parameter packs
  180 |     U<I...> T::*m_memberContainer;  // Address of the class data member.
      |        ^~~
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:180:11: error: template argument 1 is invalid
  180 |     U<I...> T::*m_memberContainer;  // Address of the class data member.
      |           ^
[92/1468] Building CXX object contrib/...tern.dir/interference-pattern/sim.cc.o
FAILED: contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/sim.cc.o
/usr/bin/c++ -DCMAKE_EXAMPLE_AS_TEST -DHAVE_LIBXML2 -DHAVE_SQLITE3 -DNS3_ASSERT_ENABLE -DNS3_BUILD_PROFILE_DEBUG -DNS3_ENABLE_EXAMPLES -DNS3_LOG_ENABLE -DPROJECT_SOURCE_PATH=\"/home/sarath/ns-allinone-3.36.1/ns-3.36.1\" -D__LINUX__ -I/usr -I/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gtk-3.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/libxml2 -I/usr/include/python3.10 -O2 -g -DNDEBUG -fPIE   -fno-semantic-interposition -fdiagnostics-color=always -Wall -std=gnu++17 -Winvalid-pch -include /home/sarath/ns-allinone-3.36.1/ns-3.36.1/cmake-cache/CMakeFiles/stdlib_pch_exec.dir/cmake_pch.hxx -MD -MT contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/sim.cc.o -MF contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/sim.cc.o.d -o contrib/opengym/examples/CMakeFiles/interference-pattern.dir/interference-pattern/sim.cc.o -c /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/sim.cc
In file included from /usr/include/c++/11/complex.h:38,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/matrix-based-channel-model.h:25,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/spectrum-module.h:17,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/mygym.h:27,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/sim.cc:21:
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:138:79: error: expected ‘>’ before ‘(’ token
  138 | template <typename V, typename T, template <typename...> class U, typename ...I,
      |                                                                               ^
In file included from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/core-module.h:19,
                 from /home/sarath/ns-allinone-3.36.1/ns-3.36.1/contrib/opengym/examples/interference-pattern/sim.cc:23:
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:142:29: error: expansion pattern ‘(__complex__ float){0.0f, 1.0e+0f}’ contains no parameter packs
  142 | DoMakeAccessorHelperOne (U<I...> T::*memberContainer)
      |                             ^~~
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:142:32: error: template argument 1 is invalid
  142 | DoMakeAccessorHelperOne (U<I...> T::*memberContainer)
      |                                ^
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h: In function ‘ns3::Ptr<const ns3::AttributeAccessor> ns3::DoMakeAccessorHelperOne(int T::*)’:
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:152:25: error: expansion pattern ‘(__complex__ float){0.0f, 1.0e+0f}’ contains no parameter packs
  152 |     MemberContainer (U<I...> T::*memberContainer)
      |                         ^~~
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:152:28: error: template argument 1 is invalid
  152 |     MemberContainer (U<I...> T::*memberContainer)
      |                            ^
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:180:8: error: expansion pattern ‘(__complex__ float){0.0f, 1.0e+0f}’ contains no parameter packs
  180 |     U<I...> T::*m_memberContainer;  // Address of the class data member.
      |        ^~~
/home/sarath/ns-allinone-3.36.1/ns-3.36.1/build/include/ns3/attribute-container-accessor-helper.h:180:11: error: template argument 1 is invalid
  180 |     U<I...> T::*m_memberContainer;  // Address of the class data member.
      |           ^
[100/1468] Building CXX object src/csm...sma-obj.dir/model/csma-net-device.cc.o
ninja: build stopped: subcommand failed.
Finished executing the following commands:
cd cmake-cache; cmake --build . -j 23 ; cd ..

Gabriel Ferreira

unread,
Jun 9, 2024, 3:59:40 PM6/9/24
to ns-3-users
This happens due to the complex.h inclusion in  matrix-based-channel-model.h
You can go there and undefine I with #undef I, or move the complex header include to the end of the list.

Sarath Babu

unread,
Jun 10, 2024, 2:42:22 AM6/10/24
to ns-3-...@googlegroups.com
Thank you. I tried undef #undef I. Now, it is building properly.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/a6ba75b0-506c-45f0-9c2b-f354923ae18dn%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages