python bindings

110 views
Skip to first unread message

Rümeysa Işıldak

unread,
Oct 30, 2023, 6:35:44 AM10/30/23
to ns-3-users
Hi all, 
I am trying to replicate src/lte/examples/lena-pathloss-traces.cc(ns3-3.40) in python. However, when attempting to run the attached code in below, I got the following error: 
"""
r**@r**-VirtualBox:~/Desktop/ns3-3.40/ns-allinone-3.40/ns-3.40$ ./ns3 run src/lte/examples/lena-pathloss-traces_risildak.py
dist =6.6005, Path Loss = 67.3587
Traceback (most recent call last):
  File "/home/risildak/Desktop/ns3-3.40/ns-allinone-3.40/ns-3.40/src/lte/examples/lena-pathloss-traces_risildak.py", line 129, in <module>
    ns.Simulator.Run()
TypeError: static void ns3::Simulator::Run() =>
    TypeError: static void ns3::Simulator::Run() =>
    TypeError: takes at most 0 arguments (4 given)
Command 'python3 /home/risildak/Desktop/ns3-3.40/ns-allinone-3.40/ns-3.40/src/lte/examples/lena-pathloss-traces_risildak.py' returned non-zero exit status 1.
"""
How can I fix this? 

risildak_trial_2.py

Gabriel Ferreira

unread,
Oct 30, 2023, 8:35:54 AM10/30/23
to ns-3-users
Is that Cppyy3? If it is, currently not supported. 

ABDULJABBAR ALSHARIF

unread,
Oct 30, 2023, 10:32:13 AM10/30/23
to ns-3-...@googlegroups.com
hi, 
Do you mean if we use cppy file to the compiler it will not work if I want to build my topology using Python? 
" if you want the rainbow you have deal with rains"




--
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/e42ccff3-3cf3-414f-b3c4-e73ae98090ccn%40googlegroups.com.

Rümeysa Işıldak

unread,
Oct 31, 2023, 1:26:02 AM10/31/23
to ns-3-users
no, I am using cppyy 2.4.2

30 Ekim 2023 Pazartesi tarihinde saat 15:35:54 UTC+3 itibarıyla Gabriel Ferreira şunları yazdı:

Gabriel Ferreira

unread,
Nov 2, 2023, 11:01:59 PM11/2/23
to ns-3-users
I've checked it out. The problem is in the MakeCallback calls before the run. 
They don't work correctly when being called from python (known limitation). 
So you need to create a c++ wrapper for them. 

Rümeysa Işıldak

unread,
Nov 3, 2023, 2:58:46 AM11/3/23
to ns-3-users
thanks a lot for your help and explanation Gabriel!

3 Kasım 2023 Cuma tarihinde saat 06:01:59 UTC+3 itibarıyla Gabriel Ferreira şunları yazdı:
Reply all
Reply to author
Forward
0 new messages