Re: Running a source command before launching main command
Mahmood Naderan <[email protected]> Thu, 29 Jul 2021 10:16:54 +0200
| Newsgroups | gmane.comp.kde.users.kdevelop |
|---|---|
| Message-ID | <CADa2P2WnKVwm-qGbC5ES5Z2rojiptkPk34rzhS0AF=enxUzOeA@mail.gmail.com> |
--00000000000074357205c83eba09 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I also tried to run the kedevelop in the wrapper. That is ./wrapper.sh kdevelop In the terminal I see the outputs of the source command in wrapper, and see kdevelop launches. In the launch configuration, I specified the binary and arguments only, but when I run Execute, I see some errors in the output that are related to "missing source command". I like kdevelop but it seems that I am not able to use it. Regards, Mahmood On Thu, Jul 29, 2021 at 10:11 AM Mahmood Naderan <[email protected]> wrote: > OK I specified this: > > EXECUTABLE: /usr/bin/sh /home/mnaderan/accel-sim-framework/run.sh > /home/mnaderan/accel-sim-framework/gpu-simulator/bin/release/accel-sim.ou= t' > ARGS: long_argument_list > > > I am not able to Execute because I get > > /home/mnaderan/accel-sim-framework/> '/usr/bin/sh > /home/mnaderan/accel-sim-framework/run.sh > /home/mnaderan/accel-sim-framework/gpu-simulator/bin/release/accel-sim.ou= t' > -trace > ./hw_run/traces/device-0/11.2/stencil/_i__home_mnaderan_suites_parboil_da= tasets_stencil_small_input_128x128x32_bin__o__home_mnaderan_128x128x32_out_= ___128_128_32_100/traces/kernelslist.g > -config > ./gpu-simulator/gpgpu-sim/configs/tested-cfgs/SM86_RTX3070/gpgpusim.confi= g > -config ./gpu-simulator/configs/tested-cfgs/SM86_RTX3070/trace.config > *** Failure: /usr/bin/sh /home/mnaderan/accel-sim-framework/run.sh > /home/mnaderan/accel-sim-framework/gpu-simulator/bin/release/accel-sim.ou= t > has failed to start *** > > For the debug I see: > > '/usr/bin/sh /home/mnaderan/accel-sim-framework/run.sh > /home/mnaderan/accel-sim-framework/gpu-simulator/bin/release/accel-sim.ou= t' > is not an executable > > However, when I run that command in the terminal, there is no problem. > > > Regards, > Mahmood > > > > > On Wed, Jul 28, 2021 at 5:13 PM Ren=C3=A9 J.V. Bertin <[email protected]= m> > wrote: > >> On Wednesday July 28 2021 11:44:23 Mahmood Naderan wrote: >> >> >some variables and preprocessing. I know how to set variables in the >> launch >> >configuration, but I would like to know how to specify that source >> command >> >in the launch configuration where executable, arguments and working >> >directory are set. >> >> Hi, >> >> I suppose there is no clear place to specify a set-up command (I don't >> use this functionality)? >> >> In that case, your best option would be to turn your "source" command >> into a wrapper script that first does the sourcing and then exec's the >> actually intended command: >> >> ---- >> #!/bin/sh >> >> # do your source command >> >> COMMAND=3D"$1" >> shift >> exec ${COMMAND} "$@" >> --- >> >> If your launch configuration is meant to debug your code this will >> probably not work, but you could try this as the command: >> >> sh /path/to/wrapper /path/to/yourExecutable [args] >> >> (this will cause the debugger to see a binary, which at some point will >> overlay itself with your own code). >> >> If that doesn't work either you'll have no other choice but to call >> KDevelop itself via the wrapper script. Or implement the missing feature >> yourself (and propose it for inclusion). >> >> R. >> > --00000000000074357205c83eba09 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:tahoma,s= ans-serif">I also tried to run the kedevelop in the wrapper. That is</div><= div class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif"><br></d= iv><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif">./w= rapper.sh kdevelop</div><div class=3D"gmail_default" style=3D"font-family:t= ahoma,sans-serif"><br></div><div class=3D"gmail_default" style=3D"font-fami= ly:tahoma,sans-serif">In the terminal I see the outputs of the source comma= nd in wrapper, and see kdevelop launches. In the launch configuration, I sp= ecified the binary and arguments only, but when I run Execute, I see some e= rrors in the output that are related to "missing source command".= </div><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif">= <br></div><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-ser= if">I like kdevelop but it seems that I am not able to use it.</div><div cl= ass=3D"gmail_default" style=3D"font-family:tahoma,sans-serif"><br clear=3D"= all"></div><div><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail= =3D"gmail_signature"><div dir=3D"ltr"><font face=3D"tahoma,sans-serif">Rega= rds,<br>Mahmood</font><br><br><br></div></div></div><br></div><br><div clas= s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 29, 202= 1 at 10:11 AM Mahmood Naderan <<a href=3D"mailto:[email protected]">m= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quot= e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)= ;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"f= ont-family:tahoma,sans-serif">OK I specified this:</div><div class=3D"gmail= _default" style=3D"font-family:tahoma,sans-serif"><br></div><div class=3D"g= mail_default" style=3D"font-family:tahoma,sans-serif">EXECUTABLE: /usr/bin/= sh /home/mnaderan/accel-sim-framework/run.sh /home/mnaderan/accel-sim-frame= work/gpu-simulator/bin/release/accel-sim.out' <br></div><div class=3D"g= mail_default" style=3D"font-family:tahoma,sans-serif">ARGS: long_argument_l= ist</div><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-seri= f"><br></div><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-= serif"><br></div><div class=3D"gmail_default" style=3D"font-family:tahoma,s= ans-serif">I am not able to Execute because I get</div><div class=3D"gmail_= default" style=3D"font-family:tahoma,sans-serif"><br></div><div class=3D"gm= ail_default" style=3D"font-family:tahoma,sans-serif">/home/mnaderan/accel-s= im-framework/> '/usr/bin/sh /home/mnaderan/accel-sim-framework/run.s= h /home/mnaderan/accel-sim-framework/gpu-simulator/bin/release/accel-sim.ou= t' -trace ./hw_run/traces/device-0/11.2/stencil/_i__home_mnaderan_suite= s_parboil_datasets_stencil_small_input_128x128x32_bin__o__home_mnaderan_128= x128x32_out____128_128_32_100/traces/kernelslist.g -config ./gpu-simulator/= gpgpu-sim/configs/tested-cfgs/SM86_RTX3070/gpgpusim.config -config ./gpu-si= mulator/configs/tested-cfgs/SM86_RTX3070/trace.config<br>*** Failure: /usr/= bin/sh /home/mnaderan/accel-sim-framework/run.sh /home/mnaderan/accel-sim-f= ramework/gpu-simulator/bin/release/accel-sim.out has failed to start ***</d= iv><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif"><br= ></div><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif"= >For the debug I see:</div><div class=3D"gmail_default" style=3D"font-famil= y:tahoma,sans-serif"><br></div><div class=3D"gmail_default" style=3D"font-f= amily:tahoma,sans-serif">'/usr/bin/sh /home/mnaderan/accel-sim-framewor= k/run.sh /home/mnaderan/accel-sim-framework/gpu-simulator/bin/release/accel= -sim.out' is not an executable</div><div class=3D"gmail_default" style= =3D"font-family:tahoma,sans-serif"><br></div><div class=3D"gmail_default" s= tyle=3D"font-family:tahoma,sans-serif">However, when I run that command in = the terminal, there is no problem.</div><div class=3D"gmail_default" style= =3D"font-family:tahoma,sans-serif"><br></div><div class=3D"gmail_default" s= tyle=3D"font-family:tahoma,sans-serif"><br></div><div><div dir=3D"ltr"><div= dir=3D"ltr"><font face=3D"tahoma,sans-serif">Regards,<br>Mahmood</font><br= ><br><br></div></div></div><br></div><br><div class=3D"gmail_quote"><div di= r=3D"ltr" class=3D"gmail_attr">On Wed, Jul 28, 2021 at 5:13 PM Ren=C3=A9 J.= V. Bertin <<a href=3D"mailto:[email protected]" target=3D"_blank">rjvb= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote" s= tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad= ding-left:1ex">On Wednesday July 28 2021 11:44:23 Mahmood Naderan wrote:<br= > <br> >some variables and preprocessing. I know how to set variables in the la= unch<br> >configuration, but I would like to know how to specify that source comm= and<br> >in the launch configuration where executable, arguments and working<br> >directory are set.<br> <br> Hi,<br> <br> I suppose there is no clear place to specify a set-up command (I don't = use this functionality)?<br> <br> In that case, your best option would be to turn your "source" com= mand into a wrapper script that first does the sourcing and then exec's= the actually intended command:<br> <br> ----<br> #!/bin/sh<br> <br> # do your source command<br> <br> COMMAND=3D"$1"<br> shift<br> exec ${COMMAND} "$@"<br> ---<br> <br> If your launch configuration is meant to debug your code this will probably= not work, but you could try this as the command:<br> <br> sh /path/to/wrapper /path/to/yourExecutable [args]<br> <br> (this will cause the debugger to see a binary, which at some point will ove= rlay itself with your own code).<br> <br> If that doesn't work either you'll have no other choice but to call= KDevelop itself via the wrapper script. Or implement the missing feature y= ourself (and propose it for inclusion).<br> <br> R.<br> </blockquote></div> </blockquote></div> --00000000000074357205c83eba09--