On Friday, December 21, 2018 at 3:55:42 PM UTC+1, alobo wrote: > > Rashad, > apparently, the configuration file it is not sourced in my system. > From a new terminal: > alobo@Delia:~$ otbcli > bash: otbcli: command not found > alobo@Delia:~$ . /home/alobo/OTB-6.6.0-Linux64/otbenv.profile >
sourcing otbenv.profile seperately has some advantages and consequences. (eg: adding that to bashrc) All you want is update PATH to use OTB-6.6.0-Linux64/bin (export PATH=/opt/OTB-6.6.0-Linux64/bin:$PATH) and you will have otbcli. This is also a single line command and very hard to mess up in case of multiple otb installation. if you source otbenv.profile, it has other stuff that is useful for development and could mess up compilation of some other packages. It all comes down to 1 env variable export vs N export. (always less is better). I think required env variables need to be handled in a better way and otbenv.profile will become that thing in history!. > alobo@Delia:~$ otbcli > Usage: /home/alobo/OTB-6.6.0-Linux64/bin/otbApplicationLauncherCommandLine > module_name [MODULEPATH] [arguments] > > otbcli* commands are not recognized until I source otbenv.profile. > Same from within R. > > Agus > > On Fri, Dec 21, 2018 at 12:13 PM Rashad <[email protected] > <javascript:>> wrote: > > > > > > > > On Thursday, December 20, 2018 at 11:34:37 AM UTC+1, jordi.inglada > wrote: > >> > >> Hi Agus, > >> > >> On Thu 20-Dec-2018 at 11:08:52 +01, Agustin Lobo <[email protected]> > wrote: > >> > Thanks Guillaume. I think I have "environment problems"!! > >> > > >> > >> Some will say this is fake news. > >> > >> I would suggest removing any OTB install at the system level using the > >> packages for your distribution. Using the binaries that you have in > your > >> $HOME should not be a problem in this case. With the self extracting > >> binary, you have a configuration file which sets the right paths for > >> you. > >> > >> I would also suggest avoid sourcing this configuration file in your > >> .bashrc, because it can generate issues with your gdal version for > >> instance when using QGis. I would just source it when needed : in a > >> terminal for the command line or from the script that you call from R > >> with the "system" function. > > > > > > configuration file is sourced by otbcli.sh in of package. so simply > otbcli_ is expected to work without additional export. > > > > @alobo > > > /home/alobo/test.scr: 1: /home/alobo/test.scr: source: not found > > seems like you weren't using bash or your default /bin/sh is not bash > >> > >> > >> Good luck. > >> > >> Jordi > >> > >> > >> > 1. Outside R > >> > Whenever I start a shell (Xfce Terminal) I get > >> > bash: LD_LIBRARY_PATH: command not found > >> > (do not know why and do not know if it matters) > >> > > >> > Then I do > >> > alobo@Delia:~$ echo $OTB_APPLICATION_PATH > >> > > >> > alobo@Delia:~$ echo $LD_LIBRARY_PATH > >> > :/usr/local/lib/otb > >> > > >> > All otbcli work: > >> > alobo@Delia:~$ otbcli > >> > Usage: /usr/bin/otbApplicationLauncherCommandLine module_name > >> > [MODULEPATH] [arguments] > >> > > >> > But > >> > alobo@Delia:~$ which otbcli > >> > /usr/bin/otbcli > >> > > >> > And BandMathX does not work: > >> > alobo@Delia:~$ BandMathX > >> > bash: BandMathX: command not found > >> > > >> > BandMathX works if I use the path: > >> > alobo@Delia:~$ /home/alobo/OTB-6.6.0-Linux64/bin/otbcli_BandMathX > >> > ERROR: Waiting for at least one parameter. > >> > etc > >> > > >> > Then I do > >> > alobo@Delia:~$ source /home/alobo/OTB-6.6.0-Linux64/otbenv.profile > >> > alobo@Delia:~$ echo $OTB_APPLICATION_PATH > >> > /home/alobo/OTB-6.6.0-Linux64/lib/otb/applications > >> > alobo@Delia:~$ echo $LD_LIBRARY_PATH > >> > :/usr/local/lib/otb > >> > > >> > Which sets the path for the new version > >> > alobo@Delia:~$ which otbcli > >> > /home/alobo/OTB-6.6.0-Linux64/bin/otbcli > >> > alobo@Delia:~$ which otbcli_BandMathX > >> > /home/alobo/OTB-6.6.0-Linux64/bin/otbcli_BandMathX > >> > > >> > 2. Given test.scr > >> > source /home/alobo/OTB-6.6.0-Linux64/otbenv.profile > >> > echo $OTB_APPLICATION_PATH > >> > echo $LD_LIBRARY_PATH > >> > otbcli > >> > /home/alobo/OTB-6.6.0-Linux64/bin/otbcli_BandMathX > >> > > >> > Running from within R with system("sh /home/alobo/test.scr") I get: > >> > > >> > /home/alobo/test.scr: 1: /home/alobo/test.scr: source: not found > >> > Usage: /usr/bin/otbApplicationLauncherCommandLine module_name > >> > [MODULEPATH] [arguments] > >> > /home/alobo/OTB-6.6.0-Linux64/bin/otbApplicationLauncherCommandLine: > >> > symbol lookup error: /usr/lib/x86_64-linux-gnu/libOTBCommon-6.6.so.1: > >> > undefined symbol: > >> > > _ZN3itk10LoggerBase5WriteENS0_17PriorityLevelTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE > > > >> > Error in system("sh /home/alobo/test.scr", intern = TRUE) : > >> > error in running command > >> > > >> > So, from within R, otbcli commands work, > >> > /home/alobo/OTB-6.6.0-Linux64/bin/otbcli_BandMathX does not work > >> > source is unknown (!!!??) > >> > > >> > I think I have found a clue, because > >> > /home/alobo/OTB-6.6.0-Linux64/bin/otbcli > >> > does not work either from within R (same error as otbcli_BandMathX) > >> > so the otbcli that is run from within R is a different one. > >> > > >> > Running an script with > >> > echo $OTB_APPLICATION_PATH > >> > echo $LD_LIBRARY_PATH > >> > which otbcli > >> > > >> > from within R results in: > >> > [1] "" > >> > [2] > "/usr/lib/R/lib::/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/jvm/default-java/lib/server" > > > >> > [3] "/usr/bin/otbcli" > >> > > >> > Which means I have an older otbcli that is the one actually working > >> > from within R (but otbcli_BandMatX did not exist yet), > >> > and I have a problem for running the new version OTB-6.6.0-Linux64 > >> > from within R because I cannot source otbenv.profile > >> > from within R, but why??? > >> > > >> > Any help appreciated... > >> > Agus > >> > > >> > On Wed, Dec 19, 2018 at 6:00 PM PASERO Guillaume > >> > <[email protected]> wrote: > >> >> > >> >> Hi, > >> >> > >> >> I would say it is a conflict between your standalone package > >> >> '/home/alobo/OTB-6.6.0-Linux64' and your system OTB libs > >> >> '/usr/lib/x86_64-linux-gnu/libOTBCommon-6.6.so.1'. > >> >> > >> >> Maybe add some prints in the ./tmp/test.scr script to check the > >> >> content of variables like OTB_APPLICATION_PATH, LD_LIBRARY_PATH, > just > >> >> before calling otbcli_BandMathX > >> >> > >> >> Regards, > >> >> Guillaume > >> >> > >> >> Quoting Agustin Lobo <[email protected]>: > >> >> > >> >> > In order to run otbcli* commands from within R, I normally use the > R > >> >> > system() command that let run any system command as if it were on > the > >> >> > terminal. > >> >> > > >> >> > For otbcli_BandMathX I have a problem. I write from within R a > simple > >> >> > text file with the following script (as ./tmp/test.scr) > >> >> > > >> >> > source /home/alobo/OTB-6.6.0-Linux64/otbenv.profile > >> >> > /home/alobo/OTB-6.6.0-Linux64/bin/otbcli_BandMathX -il ima1.tif > >> >> > ima2.tif -out result.tif -exp 'im1 div im2' > >> >> > > >> >> > and then try to execute with > >> >> > system("sh ./tmp/test.scr") > >> >> > > >> >> > But surprisingly I get a weird error: > >> >> > > >> >> > > /home/alobo/OTB-6.6.0-Linux64/bin/otbApplicationLauncherCommandLine: > >> >> > symbol lookup error: > /usr/lib/x86_64-linux-gnu/libOTBCommon-6.6.so.1: > >> >> > undefined symbol: > >> >> > > _ZN3itk10LoggerBase5WriteENS0_17PriorityLevelTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE > > > >> >> > > >> >> > I can run > >> >> > sh ./tmp/test.scr > >> >> > on the terminal with no problems. > >> >> > > >> >> > Does this error mean anything to you? > >> >> > I'm not trying that you solve an R problem, but I guess this is > rather > >> >> > a problem with otbcli_BandMathX, because the same approach works > for > >> >> > the rest of otbcli* commands. > >> >> > > >> >> > Agus > >> >> > > >> >> > -- > >> >> > -- > >> >> > Check the OTB FAQ at > >> >> > http://www.orfeo-toolbox.org/FAQ.html > >> >> > > >> >> > You received this message because you are subscribed to the Google > >> >> > Groups "otb-users" group. > >> >> > To post to this group, send email to [email protected] > >> >> > To unsubscribe from this group, send email to > >> >> > [email protected] > >> >> > For more options, visit this group at > >> >> > http://groups.google.com/group/otb-users?hl=en > >> >> > --- > >> >> > You received this message because you are subscribed to the Google > >> >> > Groups "otb-users" group. > >> >> > To unsubscribe from this group and stop receiving emails from it, > >> >> > send an email to [email protected]. > >> >> > For more options, visit https://groups.google.com/d/optout. > >> >> > >> >> > >> >> -- > >> >> -- > >> >> Check the OTB FAQ at > >> >> http://www.orfeo-toolbox.org/FAQ.html > >> >> > >> >> You received this message because you are subscribed to the Google > >> >> Groups "otb-users" group. > >> >> To post to this group, send email to [email protected] > >> >> To unsubscribe from this group, send email to > >> >> [email protected] > >> >> For more options, visit this group at > >> >> http://groups.google.com/group/otb-users?hl=en > >> >> --- > >> >> You received this message because you are subscribed to the Google > Groups "otb-users" group. > >> >> To unsubscribe from this group and stop receiving emails from it, > send an email to [email protected]. > >> >> For more options, visit https://groups.google.com/d/optout. > >> > > >> > -- > > > > -- > > -- > > Check the OTB FAQ at > > http://www.orfeo-toolbox.org/FAQ.html > > > > You received this message because you are subscribed to the Google > > Groups "otb-users" group. > > To post to this group, send email to [email protected] > <javascript:> > > To unsubscribe from this group, send email to > > [email protected] <javascript:> > > For more options, visit this group at > > http://groups.google.com/group/otb-users?hl=en > > --- > > You received this message because you are subscribed to the Google > Groups "otb-users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > -- -- Check the OTB FAQ at http://www.orfeo-toolbox.org/FAQ.html You received this message because you are subscribed to the Google Groups "otb-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/otb-users?hl=en --- You received this message because you are subscribed to the Google Groups "otb-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
