Re: orgbabel with fortran code
Perhaps we can have a crack at ob-fortran again, considering you have had some successes. With the motivation that this could drive some more work on the code if useful. Would some hacking time of a few days bo possible to you? We can then compile a brief report and send it. Thank you so very much Arne. > Sent: Thursday, May 06, 2021 at 7:50 AM > From: "Dr. Arne Babenhauserheide" > To: pie...@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pie...@caramail.com writes: > > > Have you got exomples with fortran code yourself? I would like to > > scrutinise them. > > I have this, but I no longer know whether it actually executes fortran > inline or only tangles it: > > https://www.draketo.de/files/2017-04-10-Mo-fortran-commandline-tool.org > https://www.draketo.de/files/surprises.org > > From > https://www.draketo.de/english/free-software/fortran > https://www.draketo.de/light/english/fortran-surprises > > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein > ohne es zu merken > Message-ID: <87h7jh2qh7@web.de> >
Re: orgbabel with fortran code
> Sent: Thursday, May 06, 2021 at 8:53 AM > From: "Dr. Arne Babenhauserheide" > To: pie...@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > > pie...@caramail.com writes: > > > Have seen yon also use ob-latex. Have tried to display equations but was > > not > > successful. I would be grateful with some help on that Arne. > > Where did you try to use ob-latex? I mainly use latex-export (and quite a > large amount of it). It is supposed to work, so tried to crack it. Could be useful an attempts could drive some improvements. > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein > ohne es zu merken >
Re: orgbabel with fortran code
Have had a first go with your code I wrote the following, then went inside the code and slammed "C-c C-c" #+BEGIN_SRC fortran :tangle fortran-comline.f90 program cli implicit none ! no implicit declaration: all variables must be declared character(1000) :: arg call get_command_argument(1, arg) ! result is stored in arg, see ! https://gcc.gnu.org/onlinedocs/gfortran/GET_005fCOMMAND_005fARGUMENT.html if (len_trim(arg) == 0) then ! no argument given write (*,*) "Call me --world!" else if (trim(arg) == "--world") then call get_command_argument(2, arg) if (len_trim(arg) == 0) then arg = "again!" end if write (*,*) "Hello ", trim(arg) ! trim reduces the fixed-size array to non-blank letters end if end if end program #+END_SRC And then I wrote this, went inside the code and slammed "C-c C-c" #+BEGIN_SRC sh :results output :exports both gfortran -std=gnu -O3 fortran-comline.f90 -o fortran-comline ./fortran-comline ./fortran-comline --world World ./fortran-comline --world #+END_SRC But I am getting some major whining /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status sh: 2: ./fortran-comline: not found sh: 3: ./fortran-comline: not found sh: 4: ./fortran-comline: not found > Sent: Thursday, May 06, 2021 at 7:50 AM > From: "Dr. Arne Babenhauserheide" > To: pie...@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pie...@caramail.com writes: > > > Have you got exomples with fortran code yourself? I would like to > > scrutinise them. > > I have this, but I no longer know whether it actually executes fortran > inline or only tangles it: > > https://www.draketo.de/files/2017-04-10-Mo-fortran-commandline-tool.org > https://www.draketo.de/files/surprises.org > > From > https://www.draketo.de/english/free-software/fortran > https://www.draketo.de/light/english/fortran-surprises > > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein > ohne es zu merken > Message-ID: <87h7jh2qh7@web.de> >
Re: orgbabel with fortran code
pie...@caramail.com writes: > Have seen yon also use ob-latex. Have tried to display equations but was not > successful. I would be grateful with some help on that Arne. Where did you try to use ob-latex? I mainly use latex-export (and quite a large amount of it). Best wishes, Arne -- Unpolitisch sein heißt politisch sein ohne es zu merken signature.asc Description: PGP signature
Re: orgbabel with fortran code
Have seen yon also use ob-latex. Have tried to display equations but was not successful. I would be grateful with some help on that Arne. Regards Pete > Sent: Thursday, May 06, 2021 at 7:50 AM > From: "Dr. Arne Babenhauserheide" > To: pie...@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pie...@caramail.com writes: > > > Have you got exomples with fortran code yourself? I would like to > > scrutinise them. > > I have this, but I no longer know whether it actually executes fortran > inline or only tangles it: > > https://www.draketo.de/files/2017-04-10-Mo-fortran-commandline-tool.org > https://www.draketo.de/files/surprises.org > > From > https://www.draketo.de/english/free-software/fortran > https://www.draketo.de/light/english/fortran-surprises > > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein > ohne es zu merken > Message-ID: <87h7jh2qh7@web.de> >
Re: orgbabel with fortran code
I can tell you that I used Fortran for much of my secret underwater surveillance work. Richard Stallman doesn't like it and we butt heads. But you should know that I come from area known as Afro-Asia. I always win. > Sent: Thursday, May 06, 2021 at 7:50 AM > From: "Dr. Arne Babenhauserheide" > To: pie...@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pie...@caramail.com writes: > > > Have you got exomples with fortran code yourself? I would like to > > scrutinise them. > > I have this, but I no longer know whether it actually executes fortran > inline or only tangles it: > > https://www.draketo.de/files/2017-04-10-Mo-fortran-commandline-tool.org > https://www.draketo.de/files/surprises.org > > From > https://www.draketo.de/english/free-software/fortran > https://www.draketo.de/light/english/fortran-surprises > > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein > ohne es zu merken > Message-ID: <87h7jh2qh7@web.de> > - Christopher Dimech General Administrator - Naiad Informatics - GNU Project (Geocomputation) - Geophysical Simulation - Geological Subsurface Mapping - Disaster Preparedness and Mitigation - Natural Resource Exploration and Production - Free Software Advocacy
Re: orgbabel with fortran code
pie...@caramail.com writes: > Have you got exomples with fortran code yourself? I would like to scrutinise > them. I have this, but I no longer know whether it actually executes fortran inline or only tangles it: https://www.draketo.de/files/2017-04-10-Mo-fortran-commandline-tool.org https://www.draketo.de/files/surprises.org From https://www.draketo.de/english/free-software/fortran https://www.draketo.de/light/english/fortran-surprises Best wishes, Arne -- Unpolitisch sein heißt politisch sein ohne es zu merken Message-ID: <87h7jh2qh7@web.de> signature.asc Description: PGP signature
Re: orgbabel with fortran code
> Sent: Wednesday, May 05, 2021 at 7:20 PM > From: "Eric S Fraga" > To: pie...@caramail.com > Cc: "help Emacs Orgmode" > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 09:14, pie...@caramail.com wrote: > > The code is fantastic, but how may I run it exactly? Using "C-c C-c" > > tells me "'C-c C-c' can do nothing useful here". > > You may need to evaluate (require 'ob-fortran) in your init files. Yes, have done that. > -- > : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-503-g501b2a > >
Re: orgbabel with fortran code
Have you got exomples with fortran code yourself? I would like to scrutinise them. > Sent: Wednesday, May 05, 2021 at 7:14 PM > From: "Dr. Arne Babenhauserheide" > To: pie...@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > > pie...@caramail.com writes: > > > Have been looking to find some examples on using orgbabel with fortran code > > but have not found information. > > Fortran is listed as supported on > https://orgmode.org/worg/org-contrib/babel/languages/index.html > so I would hope that the standard tipps there apply. > > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein > ohne es zu merken >
Re: orgbabel with fortran code
On Wednesday, 5 May 2021 at 09:14, pie...@caramail.com wrote: > The code is fantastic, but how may I run it exactly? Using "C-c C-c" > tells me "'C-c C-c' can do nothing useful here". You may need to evaluate (require 'ob-fortran) in your init files. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-503-g501b2a
Re: orgbabel with fortran code
> Sent: Wednesday, May 05, 2021 at 6:52 PM > From: "Eric S Fraga" > To: pie...@caramail.com > Cc: "help Emacs Orgmode" > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 08:37, pie...@caramail.com wrote: > > Make a function and then run it with different values. > > Have a look at the attachment. Doesn't create a /function/ in the > Fortran sense but shows how you can definitely call some code with > different values. Thank you so very much, I will check it out. > That's about all I can help with as it's been years since I used Fortran > (although I did cut my teeth on Fortran 66... ;-)). Is there anyone in particular who would know some more things about fortran in org-babel? > -- > : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-395-g82fbdd >
Re: orgbabel with fortran code
The code is fantastic, but how may I run it exactly? Using "C-c C-c" tells me "'C-c C-c' can do nothing useful here". > Sent: Wednesday, May 05, 2021 at 6:52 PM > From: "Eric S Fraga" > To: pie...@caramail.com > Cc: "help Emacs Orgmode" > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 08:37, pie...@caramail.com wrote: > > Make a function and then run it with different values. > > Have a look at the attachment. Doesn't create a /function/ in the > Fortran sense but shows how you can definitely call some code with > different values. > > That's about all I can help with as it's been years since I used Fortran > (although I did cut my teeth on Fortran 66... ;-)). > > -- > : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-395-g82fbdd >
Re: orgbabel with fortran code
pie...@caramail.com writes: > Have been looking to find some examples on using orgbabel with fortran code > but have not found information. Fortran is listed as supported on https://orgmode.org/worg/org-contrib/babel/languages/index.html so I would hope that the standard tipps there apply. Best wishes, Arne -- Unpolitisch sein heißt politisch sein ohne es zu merken signature.asc Description: PGP signature
Re: orgbabel with fortran code
On Wednesday, 5 May 2021 at 08:37, pie...@caramail.com wrote: > Make a function and then run it with different values. Have a look at the attachment. Doesn't create a /function/ in the Fortran sense but shows how you can definitely call some code with different values. That's about all I can help with as it's been years since I used Fortran (although I did cut my teeth on Fortran 66... ;-)). -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-395-g82fbdd * testing ob fortran #+name: ftest #+begin_src fortran :var m=20 :var n=30 :results output real, dimension(m,n) :: a real, dimension(n,m) :: c real, dimension(m) :: b integer :: i print *, m, n a = reshape( (/ (real(i), i=1,m*n) /), (/ m, n /) ) b = (/ (2*i, i=1,m) /) c = reshape( a, (/ n, m /) ) print *, b #+end_src #+results: ftest : 20 30 : 2. 4. 6. 8. 10.000 12.000 14.000 16.000 18.000 20.000 22.000 24.000 26.000 28.000 30.000 32.000 34.000 36.000 38.000 40.000 #+results: : 2. 4. 6. 8. 10.000 12.000 14.000 16.000 18.000 20.000 22.000 24.000 26.000 28.000 30.000 32.000 34.000 36.000 38.000 40.000 #+call: ftest(m=10,n=40) #+results: : 10 40 : 2. 4. 6. 8. 10.000 12.000 14.000 16.000 18.000 20.000 #+call: ftest(m=20,n=10) #+results: : 20 10 : 2. 4. 6. 8. 10.000 12.000 14.000 16.000 18.000 20.000 22.000 24.000 26.000 28.000 30.000 32.000 34.000 36.000 38.000 40.000
Re: orgbabel with fortran code
Make a function and then run it with different values. > Sent: Wednesday, May 05, 2021 at 6:24 PM > From: "Eric S Fraga" > To: pie...@caramail.com > Cc: "help Emacs Orgmode" > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 07:41, pie...@caramail.com wrote: > > Have been looking to find some examples on using orgbabel with fortran code > > but have not found information. > > What is it you wish to do? > -- > : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-395-g82fbdd > >
Re: orgbabel with fortran code
On Wednesday, 5 May 2021 at 07:41, pie...@caramail.com wrote: > Have been looking to find some examples on using orgbabel with fortran code > but have not found information. What is it you wish to do? -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-395-g82fbdd
orgbabel with fortran code
Have been looking to find some examples on using orgbabel with fortran code but have not found information. Regards P*