* orgbabel with fortran code @ 2021-05-05 5:41 pietru 2021-05-05 6:24 ` Eric S Fraga 2021-05-05 7:14 ` Dr. Arne Babenhauserheide 0 siblings, 2 replies; 17+ messages in thread From: pietru @ 2021-05-05 5:41 UTC (permalink / raw) To: help Emacs Orgmode Have been looking to find some examples on using orgbabel with fortran code but have not found information. Regards P* ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 5:41 orgbabel with fortran code pietru @ 2021-05-05 6:24 ` Eric S Fraga 2021-05-05 6:37 ` pietru 2021-05-05 7:14 ` Dr. Arne Babenhauserheide 1 sibling, 1 reply; 17+ messages in thread From: Eric S Fraga @ 2021-05-05 6:24 UTC (permalink / raw) To: pietru; +Cc: help Emacs Orgmode On Wednesday, 5 May 2021 at 07:41, pietru@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 ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 6:24 ` Eric S Fraga @ 2021-05-05 6:37 ` pietru 2021-05-05 6:52 ` Eric S Fraga 0 siblings, 1 reply; 17+ messages in thread From: pietru @ 2021-05-05 6:37 UTC (permalink / raw) To: Eric S Fraga; +Cc: help Emacs Orgmode Make a function and then run it with different values. > Sent: Wednesday, May 05, 2021 at 6:24 PM > From: "Eric S Fraga" <e.fraga@ucl.ac.uk> > To: pietru@caramail.com > Cc: "help Emacs Orgmode" <emacs-orgmode@gnu.org> > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 07:41, pietru@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 > > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 6:37 ` pietru @ 2021-05-05 6:52 ` Eric S Fraga 2021-05-05 7:09 ` pietru 2021-05-05 7:14 ` pietru 0 siblings, 2 replies; 17+ messages in thread From: Eric S Fraga @ 2021-05-05 6:52 UTC (permalink / raw) To: pietru; +Cc: help Emacs Orgmode [-- Attachment #1: Type: text/plain, Size: 468 bytes --] On Wednesday, 5 May 2021 at 08:37, pietru@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 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: f.org --] [-- Type: text/x-org, Size: 1668 bytes --] * 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.00000000 4.00000000 6.00000000 8.00000000 10.0000000 12.0000000 14.0000000 16.0000000 18.0000000 20.0000000 22.0000000 24.0000000 26.0000000 28.0000000 30.0000000 32.0000000 34.0000000 36.0000000 38.0000000 40.0000000 #+results: : 2.00000000 4.00000000 6.00000000 8.00000000 10.0000000 12.0000000 14.0000000 16.0000000 18.0000000 20.0000000 22.0000000 24.0000000 26.0000000 28.0000000 30.0000000 32.0000000 34.0000000 36.0000000 38.0000000 40.0000000 #+call: ftest(m=10,n=40) #+results: : 10 40 : 2.00000000 4.00000000 6.00000000 8.00000000 10.0000000 12.0000000 14.0000000 16.0000000 18.0000000 20.0000000 #+call: ftest(m=20,n=10) #+results: : 20 10 : 2.00000000 4.00000000 6.00000000 8.00000000 10.0000000 12.0000000 14.0000000 16.0000000 18.0000000 20.0000000 22.0000000 24.0000000 26.0000000 28.0000000 30.0000000 32.0000000 34.0000000 36.0000000 38.0000000 40.0000000 ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 6:52 ` Eric S Fraga @ 2021-05-05 7:09 ` pietru 2021-05-05 7:14 ` pietru 1 sibling, 0 replies; 17+ messages in thread From: pietru @ 2021-05-05 7:09 UTC (permalink / raw) To: Eric S Fraga; +Cc: help Emacs Orgmode > Sent: Wednesday, May 05, 2021 at 6:52 PM > From: "Eric S Fraga" <e.fraga@ucl.ac.uk> > To: pietru@caramail.com > Cc: "help Emacs Orgmode" <emacs-orgmode@gnu.org> > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 08:37, pietru@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 > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 6:52 ` Eric S Fraga 2021-05-05 7:09 ` pietru @ 2021-05-05 7:14 ` pietru 2021-05-05 7:20 ` Eric S Fraga 1 sibling, 1 reply; 17+ messages in thread From: pietru @ 2021-05-05 7:14 UTC (permalink / raw) To: Eric S Fraga; +Cc: help Emacs Orgmode 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" <e.fraga@ucl.ac.uk> > To: pietru@caramail.com > Cc: "help Emacs Orgmode" <emacs-orgmode@gnu.org> > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 08:37, pietru@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 > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 7:14 ` pietru @ 2021-05-05 7:20 ` Eric S Fraga 2021-05-05 7:24 ` pietru 0 siblings, 1 reply; 17+ messages in thread From: Eric S Fraga @ 2021-05-05 7:20 UTC (permalink / raw) To: pietru; +Cc: help Emacs Orgmode On Wednesday, 5 May 2021 at 09:14, pietru@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 ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 7:20 ` Eric S Fraga @ 2021-05-05 7:24 ` pietru 0 siblings, 0 replies; 17+ messages in thread From: pietru @ 2021-05-05 7:24 UTC (permalink / raw) To: Eric S Fraga; +Cc: help Emacs Orgmode > Sent: Wednesday, May 05, 2021 at 7:20 PM > From: "Eric S Fraga" <e.fraga@ucl.ac.uk> > To: pietru@caramail.com > Cc: "help Emacs Orgmode" <emacs-orgmode@gnu.org> > Subject: Re: orgbabel with fortran code > > On Wednesday, 5 May 2021 at 09:14, pietru@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 > > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 5:41 orgbabel with fortran code pietru 2021-05-05 6:24 ` Eric S Fraga @ 2021-05-05 7:14 ` Dr. Arne Babenhauserheide 2021-05-05 7:23 ` pietru 1 sibling, 1 reply; 17+ messages in thread From: Dr. Arne Babenhauserheide @ 2021-05-05 7:14 UTC (permalink / raw) To: pietru; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 390 bytes --] pietru@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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 7:14 ` Dr. Arne Babenhauserheide @ 2021-05-05 7:23 ` pietru 2021-05-05 19:50 ` Dr. Arne Babenhauserheide 0 siblings, 1 reply; 17+ messages in thread From: pietru @ 2021-05-05 7:23 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode 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" <arne_bab@web.de> > To: pietru@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > > pietru@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 > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 7:23 ` pietru @ 2021-05-05 19:50 ` Dr. Arne Babenhauserheide 2021-05-05 20:36 ` Christopher Dimech ` (3 more replies) 0 siblings, 4 replies; 17+ messages in thread From: Dr. Arne Babenhauserheide @ 2021-05-05 19:50 UTC (permalink / raw) To: pietru; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 582 bytes --] pietru@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.fsf@web.de> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1121 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 19:50 ` Dr. Arne Babenhauserheide @ 2021-05-05 20:36 ` Christopher Dimech 2021-05-05 20:46 ` pietru ` (2 subsequent siblings) 3 siblings, 0 replies; 17+ messages in thread From: Christopher Dimech @ 2021-05-05 20:36 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode 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" <arne_bab@web.de> > To: pietru@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pietru@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.fsf@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 ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 19:50 ` Dr. Arne Babenhauserheide 2021-05-05 20:36 ` Christopher Dimech @ 2021-05-05 20:46 ` pietru 2021-05-05 20:53 ` Dr. Arne Babenhauserheide 2021-05-05 21:02 ` pietru 2021-05-05 21:08 ` pietru 3 siblings, 1 reply; 17+ messages in thread From: pietru @ 2021-05-05 20:46 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode 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" <arne_bab@web.de> > To: pietru@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pietru@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.fsf@web.de> > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 20:46 ` pietru @ 2021-05-05 20:53 ` Dr. Arne Babenhauserheide 2021-05-05 21:04 ` pietru 0 siblings, 1 reply; 17+ messages in thread From: Dr. Arne Babenhauserheide @ 2021-05-05 20:53 UTC (permalink / raw) To: pietru; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 365 bytes --] pietru@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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 20:53 ` Dr. Arne Babenhauserheide @ 2021-05-05 21:04 ` pietru 0 siblings, 0 replies; 17+ messages in thread From: pietru @ 2021-05-05 21:04 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode > Sent: Thursday, May 06, 2021 at 8:53 AM > From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> > To: pietru@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > > pietru@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 > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 19:50 ` Dr. Arne Babenhauserheide 2021-05-05 20:36 ` Christopher Dimech 2021-05-05 20:46 ` pietru @ 2021-05-05 21:02 ` pietru 2021-05-05 21:08 ` pietru 3 siblings, 0 replies; 17+ messages in thread From: pietru @ 2021-05-05 21:02 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode 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" <arne_bab@web.de> > To: pietru@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pietru@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.fsf@web.de> > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: orgbabel with fortran code 2021-05-05 19:50 ` Dr. Arne Babenhauserheide ` (2 preceding siblings ...) 2021-05-05 21:02 ` pietru @ 2021-05-05 21:08 ` pietru 3 siblings, 0 replies; 17+ messages in thread From: pietru @ 2021-05-05 21:08 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode 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" <arne_bab@web.de> > To: pietru@caramail.com > Cc: emacs-orgmode@gnu.org > Subject: Re: orgbabel with fortran code > > pietru@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.fsf@web.de> > ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2021-05-05 21:09 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-05-05 5:41 orgbabel with fortran code pietru 2021-05-05 6:24 ` Eric S Fraga 2021-05-05 6:37 ` pietru 2021-05-05 6:52 ` Eric S Fraga 2021-05-05 7:09 ` pietru 2021-05-05 7:14 ` pietru 2021-05-05 7:20 ` Eric S Fraga 2021-05-05 7:24 ` pietru 2021-05-05 7:14 ` Dr. Arne Babenhauserheide 2021-05-05 7:23 ` pietru 2021-05-05 19:50 ` Dr. Arne Babenhauserheide 2021-05-05 20:36 ` Christopher Dimech 2021-05-05 20:46 ` pietru 2021-05-05 20:53 ` Dr. Arne Babenhauserheide 2021-05-05 21:04 ` pietru 2021-05-05 21:02 ` pietru 2021-05-05 21:08 ` pietru
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.