public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Several Questions.
@ 2017-10-08 15:33 Stephen P. Molnar
  2017-10-08 15:53 ` Paul Richard Thomas
  2017-10-08 16:01 ` Steve Kargl
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen P. Molnar @ 2017-10-08 15:33 UTC (permalink / raw)
  To: fortran

Question 1.  How do I join the gfortran users mailing list?

Question 2 (a tad longer than 1):

I have the source code for a fortran program that I wrote in 1996 using 
the Microsoft FORTRAN compiler that I would like to port to gfortran as 
I no linger have a copy of the Microsoft application.

I have Debian v-9.1.0 installed on my 64bit AMD platform with the 
distribution with gcc/gfortran installed.

Much to my surprise, gfortran produced an executable file with only 
correcting a couple of typographic errors.

Naturally, there were run errors:

comp@AbNormal:~/Apps/gFortran$ ./mt3dm1 B1.prn
At line 18 of file MT3DM1.FOR (unit = 1)
Fortran runtime error: Cannot open file '': No such file or directory

Error termination. Backtrace:
#0  0x7f3b14086d4a
#1  0x7f3b14087825
#2  0x7f3b14087f79
#3  0x7f3b141478fa
#4  0x7f3b14147b3d
#5  0x4023e3
#6  0x40300c
#7  0x7f3b1358b2b0
#8  0x400a19
#9  0xffffffffffffffff

Which I assumed that the source code was not linked to the necessary 
libraries.

So I tried winking with the -static switch. Again (not surprisingly) errors:

comp@AbNormal:~/Apps/gFortran$ gfortran -static -fno-align-commons 
MT3DM1.FOR -o MT3DM1s
/home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(main.o): 
In function `_gfortrani_find_addr2line':
(.text._gfortrani_find_addr2line+0xe): undefined reference to 
`__secure_getenv'
/home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(unix.o): 
In function `_gfortrani_open_external':
(.text._gfortrani_open_external+0x86): undefined reference to 
`__secure_getenv'
collect2: error: ld returned 1 exit status

Question 2 then is what's missing?

I am sure that there will be a necessary editing of in and out 
statements, but those can wait.

Thanks in advance for yer  attention.

-- 
Stephen P. Molnar, Ph.D.		Life is a fuzzy set
www.molecular-modeling.net		Stochastic and multivariate
(614)312-7528 (c)
Skype: smolnar1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Several Questions.
  2017-10-08 15:33 Several Questions Stephen P. Molnar
@ 2017-10-08 15:53 ` Paul Richard Thomas
  2017-10-08 16:01 ` Steve Kargl
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Richard Thomas @ 2017-10-08 15:53 UTC (permalink / raw)
  To: Stephen P. Molnar; +Cc: fortran

Hi Stephen,

This, in fact, is a list for the developers of gfortran not users.

However, your problem does deserve some attention. Janne Blomqvist
picked it up earlier on this year:
https://gcc.gnu.org/ml/gcc-patches/2017-04/msg01388.html

Given the content of the thread, I rather think that you should not
use static but instead set LD_LIBRARY_PATH to include libgfortran. In
my linux distro /lib64 has the system supplied libgfortran.

Regards

Paul


On 8 October 2017 at 16:33, Stephen P. Molnar <s.molnar@sbcglobal.net> wrote:
> Question 1.  How do I join the gfortran users mailing list?
>
> Question 2 (a tad longer than 1):
>
> I have the source code for a fortran program that I wrote in 1996 using the
> Microsoft FORTRAN compiler that I would like to port to gfortran as I no
> linger have a copy of the Microsoft application.
>
> I have Debian v-9.1.0 installed on my 64bit AMD platform with the
> distribution with gcc/gfortran installed.
>
> Much to my surprise, gfortran produced an executable file with only
> correcting a couple of typographic errors.
>
> Naturally, there were run errors:
>
> comp@AbNormal:~/Apps/gFortran$ ./mt3dm1 B1.prn
> At line 18 of file MT3DM1.FOR (unit = 1)
> Fortran runtime error: Cannot open file '': No such file or directory
>
> Error termination. Backtrace:
> #0  0x7f3b14086d4a
> #1  0x7f3b14087825
> #2  0x7f3b14087f79
> #3  0x7f3b141478fa
> #4  0x7f3b14147b3d
> #5  0x4023e3
> #6  0x40300c
> #7  0x7f3b1358b2b0
> #8  0x400a19
> #9  0xffffffffffffffff
>
> Which I assumed that the source code was not linked to the necessary
> libraries.
>
> So I tried winking with the -static switch. Again (not surprisingly) errors:
>
> comp@AbNormal:~/Apps/gFortran$ gfortran -static -fno-align-commons
> MT3DM1.FOR -o MT3DM1s
> /home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(main.o):
> In function `_gfortrani_find_addr2line':
> (.text._gfortrani_find_addr2line+0xe): undefined reference to
> `__secure_getenv'
> /home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(unix.o):
> In function `_gfortrani_open_external':
> (.text._gfortrani_open_external+0x86): undefined reference to
> `__secure_getenv'
> collect2: error: ld returned 1 exit status
>
> Question 2 then is what's missing?
>
> I am sure that there will be a necessary editing of in and out statements,
> but those can wait.
>
> Thanks in advance for yer  attention.
>
> --
> Stephen P. Molnar, Ph.D.                Life is a fuzzy set
> www.molecular-modeling.net              Stochastic and multivariate
> (614)312-7528 (c)
> Skype: smolnar1



-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Several Questions.
  2017-10-08 15:33 Several Questions Stephen P. Molnar
  2017-10-08 15:53 ` Paul Richard Thomas
@ 2017-10-08 16:01 ` Steve Kargl
  2017-10-08 16:46   ` Stephen P. Molnar
  1 sibling, 1 reply; 6+ messages in thread
From: Steve Kargl @ 2017-10-08 16:01 UTC (permalink / raw)
  To: Stephen P. Molnar; +Cc: fortran

On Sun, Oct 08, 2017 at 11:33:24AM -0400, Stephen P. Molnar wrote:
> Question 1.  How do I join the gfortran users mailing list?

https://gcc.gnu.org/lists.html#subscribe

Select Fortran from the list and follow instructions.


> Naturally, there were run errors:
> 
> comp@AbNormal:~/Apps/gFortran$ ./mt3dm1 B1.prn
> At line 18 of file MT3DM1.FOR (unit = 1)
> Fortran runtime error: Cannot open file '': No such file or directory

Need to see source code, but it looks like you tried
to open unit with an empty file, i.e.,

   open(unit=1,file='')

1. Unit 1 is normally standard input, so you're closing stdin.
   Folklore suggests starting unit numbering at 10 and go up.
2. gfortran can't find a file in the current working directory
   named ''.  So, gfortran issues a runtime error.

> Error termination. Backtrace:
> #0  0x7f3b14086d4a
> #1  0x7f3b14087825
> #2  0x7f3b14087f79
> #3  0x7f3b141478fa
> #4  0x7f3b14147b3d
> #5  0x4023e3
> #6  0x40300c
> #7  0x7f3b1358b2b0
> #8  0x400a19
> #9  0xffffffffffffffff

Your system does not have libunwind or gfortran cannot find libunwind,
so the stack trace is simply addresses.  If you do not have libunwind,
you can prevent the noise by adding -fno-backtrace to your command line.

> 
> So I tried winking with the -static switch. Again (not surprisingly) errors:
> 
> comp@AbNormal:~/Apps/gFortran$ gfortran -static -fno-align-commons 
> MT3DM1.FOR -o MT3DM1s
> /home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(main.o): 
> In function `_gfortrani_find_addr2line':
> (.text._gfortrani_find_addr2line+0xe): undefined reference to 
> `__secure_getenv'
> /home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(unix.o): 
> In function `_gfortrani_open_external':
> (.text._gfortrani_open_external+0x86): undefined reference to 
> `__secure_getenv'
> collect2: error: ld returned 1 exit status
> 

Cannot help you here as I do not use Linux (or Windows).

-- 
Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Several Questions.
  2017-10-08 16:01 ` Steve Kargl
@ 2017-10-08 16:46   ` Stephen P. Molnar
  2017-10-08 18:54     ` Jerry DeLisle
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen P. Molnar @ 2017-10-08 16:46 UTC (permalink / raw)
  To: fortran

Thanks for the answers.

I wasn't sure if I was using the correct address.

I will probably post the code as soon as I have made as many edits as I can.

On 10/08/2017 12:01 PM, Steve Kargl wrote:
> On Sun, Oct 08, 2017 at 11:33:24AM -0400, Stephen P. Molnar wrote:
>> Question 1.  How do I join the gfortran users mailing list?
>
> https://gcc.gnu.org/lists.html#subscribe
>
> Select Fortran from the list and follow instructions.
>
>
>> Naturally, there were run errors:
>>
>> comp@AbNormal:~/Apps/gFortran$ ./mt3dm1 B1.prn
>> At line 18 of file MT3DM1.FOR (unit = 1)
>> Fortran runtime error: Cannot open file '': No such file or directory
>
> Need to see source code, but it looks like you tried
> to open unit with an empty file, i.e.,
>
>     open(unit=1,file='')
>
> 1. Unit 1 is normally standard input, so you're closing stdin.
>     Folklore suggests starting unit numbering at 10 and go up.
> 2. gfortran can't find a file in the current working directory
>     named ''.  So, gfortran issues a runtime error.
>
>> Error termination. Backtrace:
>> #0  0x7f3b14086d4a
>> #1  0x7f3b14087825
>> #2  0x7f3b14087f79
>> #3  0x7f3b141478fa
>> #4  0x7f3b14147b3d
>> #5  0x4023e3
>> #6  0x40300c
>> #7  0x7f3b1358b2b0
>> #8  0x400a19
>> #9  0xffffffffffffffff
>
> Your system does not have libunwind or gfortran cannot find libunwind,
> so the stack trace is simply addresses.  If you do not have libunwind,
> you can prevent the noise by adding -fno-backtrace to your command line.
>
>>
>> So I tried winking with the -static switch. Again (not surprisingly) errors:
>>
>> comp@AbNormal:~/Apps/gFortran$ gfortran -static -fno-align-commons
>> MT3DM1.FOR -o MT3DM1s
>> /home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(main.o):
>> In function `_gfortrani_find_addr2line':
>> (.text._gfortrani_find_addr2line+0xe): undefined reference to
>> `__secure_getenv'
>> /home/comp/Apps/psi4/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../libgfortran.a(unix.o):
>> In function `_gfortrani_open_external':
>> (.text._gfortrani_open_external+0x86): undefined reference to
>> `__secure_getenv'
>> collect2: error: ld returned 1 exit status
>>
>
> Cannot help you here as I do not use Linux (or Windows).
>


-- 
Stephen P. Molnar, Ph.D.		Life is a fuzzy set
www.molecular-modeling.net		Stochastic and multivariate
(614)312-7528 (c)
Skype: smolnar1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Several Questions.
  2017-10-08 16:46   ` Stephen P. Molnar
@ 2017-10-08 18:54     ` Jerry DeLisle
  0 siblings, 0 replies; 6+ messages in thread
From: Jerry DeLisle @ 2017-10-08 18:54 UTC (permalink / raw)
  To: Stephen P. Molnar, fortran

On 10/08/2017 09:46 AM, Stephen P. Molnar wrote:
> Thanks for the answers.
> 
--- snip ---
>>
>>> Error termination. Backtrace:
>>> #0  0x7f3b14086d4a
>>> #1  0x7f3b14087825
>>> #2  0x7f3b14087f79
>>> #3  0x7f3b141478fa
>>> #4  0x7f3b14147b3d
>>> #5  0x4023e3
>>> #6  0x40300c
>>> #7  0x7f3b1358b2b0
>>> #8  0x400a19
>>> #9  0xffffffffffffffff
>>
>> Your system does not have libunwind or gfortran cannot find libunwind,
>> so the stack trace is simply addresses.  If you do not have libunwind,
>> you can prevent the noise by adding -fno-backtrace to your command line.
>>

You can also set the environment variable

export GFORTRAN_ERROR_BACKTRACE=N

If you find the backtrace bothersome.

Cheers,

Jerry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Several Questions.
@ 2017-10-08 15:57 Dominique d'Humières
  0 siblings, 0 replies; 6+ messages in thread
From: Dominique d'Humières @ 2017-10-08 15:57 UTC (permalink / raw)
  To: s.molnar; +Cc: gfortran

> Question 1.  How do I join the gfortran users mailing list?

If you want to subscribe to the list, go to https://gcc.gnu.org/lists.html#subscribe and select fortran.

> comp@AbNormal:~/Apps/gFortran$ ./mt3dm1 B1.prn
> At line 18 of file MT3DM1.FOR (unit = 1)
> Fortran runtime error: Cannot open file '': No such file or directory

As usual, you need to post the code in order to get some help.

Welcome on board!

Dominique

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-08 18:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-08 15:33 Several Questions Stephen P. Molnar
2017-10-08 15:53 ` Paul Richard Thomas
2017-10-08 16:01 ` Steve Kargl
2017-10-08 16:46   ` Stephen P. Molnar
2017-10-08 18:54     ` Jerry DeLisle
2017-10-08 15:57 Dominique d'Humières

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).