Re: grdmath problems
Branden Christensen <[email protected]>
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <CAK3C9dXt6gFFL0Aw+zWQ-YJB+KnVrKiztztUUusNFzmFmDdHQQ@mail.gmail.com> |
Marcelo: Some more information: When I execute /usr/src/gmt-4.5.11/bin/grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd It tries to find 1.grd at /usr/src/gmt-4.5.11/bin/ and when it doesn't it spits out the buffer overflow error. But when I change the command a little (see bold), no error!: /usr/src/gmt-4.5.11/bin/grdmath */home/osop/*1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd The strange thing is that it does not need the complete path for 2.grd... Thoughts? *Branden Christensen* The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/ Take a Virtual Tour: http://www.osop.com.pa/tour Sign up for the OSOP mailing list: http://www.osop.com.pa/about/osop-mailing-list/ On Thu, Jan 23, 2014 at 7:04 PM, Branden Christensen < [email protected]> wrote: > Marcelo: > > > Excellent. We are making progress! > > > After running "export PATH=$PATH:/usr/src/gmt-4.5.11/bin" I get the same > as you: > > osop@osop-displays2:~$ grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP DUP > DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH DUP > DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL EXCH > DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD MUL > EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd > osop@osop-displays2:~$ /usr/src/gmt-4.5.11/bin/grdmath 1.grd DUP DUP 10 > LE 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 > MUL 0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV > -0.07 MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 > DIV -0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd > DIV EXCH POW MUL = 3.grd > *** buffer overflow detected ***: /usr/src/gmt-4.5.11/bin/grdmath > terminated > > I am relying on another program that calls grdmath using an explicit path. > So is there a fix to make it work with the explicit path? > > Thanks again! > > > Kind Regards, > > > *Branden Christensen* > The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/ > Take a Virtual Tour: http://www.osop.com.pa/tour > Sign up for the OSOP mailing list: > http://www.osop.com.pa/about/osop-mailing-list/ > > > On Thu, Jan 23, 2014 at 6:02 PM, Marcelo Banik <[email protected]>wrote: > >> Hi Branden, >> >> >> I didn't execute script siposg4511-1.sh because: >> >> # dirty link creation to find gdal.h >> >> rm -R /usr/local/include >> >> ln -s /usr/include/gdal /usr/local/include >> >> >> Appears to be much aggressive to my system. >> >> >> I decide to use the original install_gmt4.sh script, without your minor >> modification, and some minimal modification in your GMT4param.txt to fit my >> system configuration (see attached file). Then from a directory with files: >> >> $ ls >> >> gmt-4.5.11-src.tar.bz2 GMT4param.txt gshhg-gmt-nc4-2.2.4.tar.gz >> install_gmt4.sh >> >> >> I run the command: >> >> $ sudo sh -c "sh install_gmt4.sh GMT4param.txt" > install.log 2>&1 >> >> >> And did the test: >> >> $ /usr/src/gmt-4.5.11/bin/grdmath -R0/10/0/10 -I1 X = 1.grd >> >> $ /usr/src/gmt-4.5.11/bin/grdmath -R0/10/0/10 -I1 X = 2.grd >> >> $ /usr/src/gmt-4.5.11/bin/grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP >> DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH >> DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL >> EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD >> MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd >> >> *** buffer overflow detected ***: /usr/src/gmt-4.5.11/bin/grdmath >> terminated >> >> >> Finally I get your error! >> >> >> Then I did: >> >> $ export PATH=$PATH:/usr/src/gmt-4.5.11/bin >> >> $ which grdmath >> >> /usr/src/gmt-4.5.11/bin/grdmath >> >> >> $ grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 >> LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH DUP DUP DUP 20 GT >> EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL EXCH DUP DUP DUP >> 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD MUL EXCH 40 GT >> 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd >> >> >> And now it works. >> >> >> For some unknown reason, it fails if an explicit path is used. I don't >> have this problem with my gmt4.5.11 installation. I'm not sure if it have >> some relation with your choice to not use shared lib. I could test it >> later, but first, let us now if including /usr/src/gmt-4.5.11/bin to your >> PATH works. >> >> >> Regards, >> >> >> Marcelo >> >> >> >> >> On Thu, Jan 23, 2014 at 2:36 PM, Branden Christensen < >> [email protected]> wrote: >> >>> Marcelo: >>> >>> >>> I also get: >>> >>> e51a8827d9b0ce3f36cfe6be01f24931 gmt-4.5.11-src.tar.bz2 >>> >>> Attached is the script I used to install GMT 4.5.11. Unpack this tgz >>> file, cd to usr/src and execute "siposg4511-1.sh". >>> >>> >>> Kind Regards, >>> >>> >>> *Branden Christensen* >>> The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/ >>> Take a Virtual Tour: http://www.osop.com.pa/tour >>> Sign up for the OSOP mailing list: >>> http://www.osop.com.pa/about/osop-mailing-list/ >>> >>> >>> On Thu, Jan 23, 2014 at 4:07 PM, Marcelo Banik <[email protected]>wrote: >>> >>>> Hi Branden, >>>> >>>> >>>> Here I have: >>>> >>>> $ uname -a >>>> >>>> Linux acer 3.2.0-41-generic #66-Ubuntu SMP Thu Apr 25 03:27:11 UTC 2013 >>>> x86_64 x86_64 x86_64 GNU/Linux >>>> >>>> >>>> $ cat /etc/issue >>>> >>>> Ubuntu 12.04.4 LTS \n \l >>>> >>>> >>>> It isn't identical, but I didn't expect that these minor differences >>>> could be an issue. >>>> >>>> >>>> From source files, I get: >>>> >>>> $ md5sum *.bz2 >>>> >>>> fd4abdbbc5cb48087a12a4c762b87123 gmt-4.5.11-non-gpl-src.tar.bz2 >>>> >>>> e51a8827d9b0ce3f36cfe6be01f24931 gmt-4.5.11-src.tar.bz2 >>>> >>>> >>>> Did you get the same values? >>>> >>>> >>>> Could you send your GMT4param.txt file? I could try to install here >>>> using it, just to try to reproduce your results. I don't expect that it >>>> could change any thing, but I don't know what to do. >>>> >>>> >>>> I only get a “buffer overflow detected” when I accidentally included >>>> option -Vd, but it don't appear to be your case. >>>> >>>> >>>> Regards, >>>> >>>> >>>> Marcelo >>>> >>>> >>>> >>>> >>>> On Thu, Jan 23, 2014 at 1:08 PM, Branden Christensen < >>>> [email protected]> wrote: >>>> >>>>> Hi all: >>>>> >>>>> >>>>> Marcelo, thank you for taking the time to try that. >>>>> >>>>> I just created a new, virgin virtual machine with 12.04: >>>>> >>>>> osop@shakemap:~$ uname -a >>>>> Linux shakemap 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 >>>>> 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux >>>>> osop@shakemap:~$ cat /etc/issue >>>>> Ubuntu 12.04.2 LTS \n \l >>>>> >>>>> I then installed GMT 4.5.11 from source. >>>>> >>>>> And then I attempted: >>>>> >>>>> osop@shakemap:~$ /usr/src/gmt-4.5.11/bin/grdmath -R0/10/0/10 -I1 X = >>>>> 1.grd >>>>> osop@shakemap:~$ /usr/src/gmt-4.5.11/bin/grdmath -R0/10/0/10 -I1 X = >>>>> 2.grd >>>>> osop@shakemap:~$ /usr/src/gmt-4.5.11/bin/grdmath 1.grd DUP DUP 10 LE >>>>> 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL >>>>> 0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 >>>>> MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV >>>>> -0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV >>>>> EXCH POW MUL = 3.grd >>>>> *** buffer overflow detected ***: /usr/src/gmt-4.5.11/bin/grdmath >>>>> terminated >>>>> >>>>> So I am getting the same results.... >>>>> >>>>> >>>>> Kind Regards, >>>>> >>>>> >>>>> >>>>> *Branden Christensen* >>>>> The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/ >>>>> Take a Virtual Tour: http://www.osop.com.pa/tour >>>>> Sign up for the OSOP mailing list: >>>>> http://www.osop.com.pa/about/osop-mailing-list/ >>>>> >>>>> >>>>> On Wed, Jan 22, 2014 at 7:59 PM, Marcelo Banik < >>>>> [email protected]> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> It works fine at my ubuntu 12.04 LTS 64bits GMT 4.5.11 installed from >>>>>> source code. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Marcelo >>>>>> >>>>>> >>>>>> >>>>>> On Wed, Jan 22, 2014 at 5:54 PM, J.J. Green < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Sounds like a flakey GMT in Ubuntu, see earlier messages >>>>>>> on this list. On >>>>>>> >>>>>>> jjg@flounder ~ $ cat /etc/issue >>>>>>> Linux Mint 16 Petra \n \l >>>>>>> >>>>>>> with >>>>>>> >>>>>>> jjg@flounder ~ $ apt-cache policy gmt >>>>>>> gmt: >>>>>>> Installed: 4.5.7-2ubuntu1 >>>>>>> Candidate: 4.5.7-2ubuntu1 >>>>>>> Package pin: 4.5.7-2ubuntu1 >>>>>>> Version table: >>>>>>> 4.5.9-1 1001 >>>>>>> 500 http://archive.ubuntu.com/ubuntu/ saucy/universe amd64 >>>>>>> Packages >>>>>>> *** 4.5.7-2ubuntu1 1001 >>>>>>> 500 http://archive.ubuntu.com/ubuntu/ raring/universe amd64 >>>>>>> Packages >>>>>>> 100 /var/lib/dpkg/status >>>>>>> >>>>>>> This achieved with >>>>>>> >>>>>>> jjg@flounder ~ $ cat /etc/apt/preferences.d/pin-gmt4 >>>>>>> Package: gmt >>>>>>> Pin: release n=raring* >>>>>>> Pin-Priority: 1001 >>>>>>> >>>>>>> Package: gmt-doc >>>>>>> Pin: release v=13.04, l=Ubuntu >>>>>>> Pin-Priority: 1001 >>>>>>> >>>>>>> Package: libgmt4 >>>>>>> Pin: release v=13.04, l=Ubuntu >>>>>>> Pin-Priority: 1001 >>>>>>> >>>>>>> Package: * >>>>>>> Pin: release v=13.04, l=Ubuntu >>>>>>> Pin-Priority: -1 >>>>>>> >>>>>>> I get no error for >>>>>>> >>>>>>> jjg@flounder ~ $ GMT grdmath -R0/10/0/10 -I1 X = 1.grd >>>>>>> jjg@flounder ~ $ GMT grdmath -R0/10/0/10 -I1 X = 2.grd >>>>>>> jjg@flounder ~ $ GMT grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH >>>>>>> DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL >>>>>>> EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD >>>>>>> MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 >>>>>>> ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = >>>>>>> 3.grd >>>>>>> >>>>>>> and >>>>>>> >>>>>>> jjg@flounder ~ $ ls -l *.grd >>>>>>> -rw-r--r-- 1 jjg jjg 1240 Jan 22 19:41 1.grd >>>>>>> -rw-r--r-- 1 jjg jjg 1240 Jan 22 19:41 2.grd >>>>>>> -rw-r--r-- 1 jjg jjg 1508 Jan 22 19:42 3.grd >>>>>>> >>>>>>> perhaps you could revert to 4.5.7 too >>>>>>> >>>>>>> Cheers >>>>>>> >>>>>>> Jim >>>>>>> -- >>>>>>> J.J. Green, Seaview Sensing Ltd., >>>>>>> http://seaviewsensing.com >>>>>>> >>>>>>> >>>>>>> To unsubscribe, send the message "signoff gmt-help" to >>>>>>> [email protected] >>>>>>> >>>>>> >>>>>> To unsubscribe, send the message "signoff gmt-help" to >>>>>> [email protected] >>>>>> >>>>> >>>>> To unsubscribe, send the message "signoff gmt-help" to >>>>> [email protected] >>>>> >>>> >>>> To unsubscribe, send the message "signoff gmt-help" to >>>> [email protected] >>>> >>> >>> To unsubscribe, send the message "signoff gmt-help" to >>> [email protected] >>> >> >> To unsubscribe, send the message "signoff gmt-help" to >> [email protected] >> > > To unsubscribe, send the message "signoff gmt-help" to [email protected]