Does nacl gfortran work ok ?

69 views
Skip to first unread message

KnoooW

unread,
Jan 20, 2016, 12:25:30 AM1/20/16
to Native-Client-Discuss
I compiled simple helloworld:

test_fortran.f90

program hello
    print *,"Hello World , Fortran !!!"
end program hello


in host, I can compile it with gfortran and run it successfully.
I tried to compile it with nacl gfortran, and i compile ok, nexe got out.
But when i run it in sel_ldr, it did not print anything, and also no error messages printed out.
it just run and exit.

how's that going?

I run nacl loader just as run other nexes with irt with runnable-ld.so and so on...

KnoooW

unread,
Jan 20, 2016, 12:38:26 AM1/20/16
to Native-Client-Discuss
I need gfortran because I would like to use numpy. and numpy need some fortran packages such as lapack ... 

在 2016年1月20日星期三 UTC+8下午1:25:30,KnoooW写道:

KnoooW

unread,
Jan 21, 2016, 8:41:34 PM1/21/16
to Native-Client-Discuss
anyone know some about nacl-gfortran ?



在 2016年1月20日星期三 UTC+8下午1:25:30,KnoooW写道:
I compiled simple helloworld:

Derek Schuff

unread,
Jan 22, 2016, 12:27:18 PM1/22/16
to Native-Client-Discuss
The nacl toolchains do not include gfortran, and as far as I know, nobody has attempted to port it to nacl. (Upstream gfortran won't work with nacl).

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

KnoooW

unread,
Jan 24, 2016, 8:26:57 PM1/24/16
to Native-Client-Discuss
I notice gfrotran have successfully compiled nexe out, what's the other parts which need ports ?



在 2016年1月23日星期六 UTC+8上午1:27:18,Derek Schuff写道:
The nacl toolchains do not include gfortran, and as far as I know, nobody has attempted to port it to nacl. (Upstream gfortran won't work with nacl).

On Thu, Jan 21, 2016 at 5:41 PM KnoooW <3n4...@gmail.com> wrote:
anyone know some about nacl-gfortran ?



在 2016年1月20日星期三 UTC+8下午1:25:30,KnoooW写道:
I compiled simple helloworld:

test_fortran.f90

program hello
    print *,"Hello World , Fortran !!!"
end program hello


in host, I can compile it with gfortran and run it successfully.
I tried to compile it with nacl gfortran, and i compile ok, nexe got out.
But when i run it in sel_ldr, it did not print anything, and also no error messages printed out.
it just run and exit.

how's that going?

I run nacl loader just as run other nexes with irt with runnable-ld.so and so on...

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

Bennet Yee (余仕斌)

unread,
Jan 24, 2016, 9:39:56 PM1/24/16
to Native Client Discuss
compilers typically generate code that assumes the existence of a runtime library/environment.  that runtime library is often written in some other language, such as assembly or C.

On Sun, Jan 24, 2016 at 5:26 PM, KnoooW <3n4...@gmail.com> wrote:
I notice gfrotran have successfully compiled nexe out, what's the other parts which need ports ?


在 2016年1月23日星期六 UTC+8上午1:27:18,Derek Schuff写道:
The nacl toolchains do not include gfortran, and as far as I know, nobody has attempted to port it to nacl. (Upstream gfortran won't work with nacl).

On Thu, Jan 21, 2016 at 5:41 PM KnoooW <3n4...@gmail.com> wrote:
anyone know some about nacl-gfortran ?



在 2016年1月20日星期三 UTC+8下午1:25:30,KnoooW写道:
I compiled simple helloworld:

test_fortran.f90

program hello
    print *,"Hello World , Fortran !!!"
end program hello


in host, I can compile it with gfortran and run it successfully.
I tried to compile it with nacl gfortran, and i compile ok, nexe got out.
But when i run it in sel_ldr, it did not print anything, and also no error messages printed out.
it just run and exit.

how's that going?

I run nacl loader just as run other nexes with irt with runnable-ld.so and so on...

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.

To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.



--
bennet s yee
i usually don't capitalize due to mild tendonitis

Victor Khimenko

unread,
Jan 25, 2016, 7:54:44 AM1/25/16
to Native Client Discuss
If you are using glibc toolchain then fortran should be more-or-less working except for a nasty buffering bug: last 4K of standard output stream are lost. Something with destructors/finalizers not working.

AFAIK nobody ever tried to trace this bug because it's not important for the use in browser...

Add 1000 line of print's and you'll see some output, just not all :-)

I know that fortrain is more-or-less functional because there was R port (sadly it was never brought to good enough shape to be added to webports) and R is pretty large and complex fortran program.


KnoooW

unread,
Feb 1, 2016, 4:38:22 AM2/1/16
to Native-Client-Discuss
Which source code part should I look if would like to trace this bug khim ?
in glibc toolchain.


在 2016年1月25日星期一 UTC+8下午8:54:44,khim写道:

Victor Khimenko

unread,
Feb 1, 2016, 7:45:40 PM2/1/16
to Native Client Discuss
On Mon, Feb 1, 2016 at 10:38 AM, KnoooW <3n4...@gmail.com> wrote:
Which source code part should I look if would like to trace this bug khim ?
in glibc toolchain.

Who knows? There are parts of code which are supposed to execute finalizers (in the "elf" subdirectory of GLibC if I remember correctly). Something is wrong with them.

It could be many things: finalizers themselves could be put in wrong sections (there are linker scripts which are doing that), glibc may try to find them in wrong place, gcc and glibc may disagree on the structure of said finalizers.

Honestly I don't think anyone ever tried to find out what goes on there because it's not really important for in-browser use: PPAPI module is not supposed to ever exit, compilation of NaCl program is usually done as cross-compilation which means that execute tests are not performed by autoconf which means that this whole thing is just an annoyance and not a real problem).

If you want to fix that then you are welcome, of course, but the situation is simple: nobody knows what goes on there because that bug does not really blocks anyone and when you have project with headcount equal to zero... 

KnoooW

unread,
Feb 1, 2016, 8:31:47 PM2/1/16
to Native-Client-Discuss
hi khim, the reason for needing fix this bug is that I would like to run tests in lapack package.
I successfully compile lapack.so with nacl gfortran. But, how can I know whether it works right?
I need test. But the default test cases all have WRITE operation, that's it need write computing result to file.
while, because of this bug, the result file contains nothing!
I cannot do test, then I can use it..

在 2016年2月2日星期二 UTC+8上午8:45:40,khim写道:

To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

Victor Khimenko

unread,
Feb 5, 2016, 3:56:29 PM2/5/16
to Native Client Discuss
On Tue, Feb 2, 2016 at 2:31 AM, KnoooW <3n4...@gmail.com> wrote:
hi khim, the reason for needing fix this bug is that I would like to run tests in lapack package.
I successfully compile lapack.so with nacl gfortran. But, how can I know whether it works right?
I need test. But the default test cases all have WRITE operation, that's it need write computing result to file.
while, because of this bug, the result file contains nothing!
I cannot do test, then I can use it..

Why can't you test it? All programs on Fortran work EXCEPT for programs which rely on the fact that you could rely on the implicit flush. Sure, "Hello world!" program belongs to that category, but that does not mean that you couldn't write other tests!

If program works with files... then it works:
$ cat test1.f90
program test1
  open(unit=1,file='output.txt')
  write (1,*) "Greetings, denizens of planet Earth!"
  close(unit=1)
end program test1
$ pepper_canary/toolchain/linux_x86_glibc/bin/i686-nacl-gfortran test1.f90 -o test1
$ pepper_canary/tools/sel_ldr.py ./test1
$ cat output.txt
 Greetings, denizens of planet Earth!

If program flushes the stdout... then it works, too:

$ cat test2.f90 
program test2
  use, intrinsic :: iso_fortran_env, only : &
    stdin=>input_unit, stdout=>output_unit, stderr=>error_unit
  write(*,*) "Greetings, denizens of planet Earth!"
  flush(stdout)
end program test2
$ pepper_canary/toolchain/linux_x86_glibc/bin/i686-nacl-gfortran test2.f90 -o test2
$ pepper_canary/tools/sel_ldr.py ./test2
 Greetings, denizens of planet Earth!

Only programs which rely on the fact that typical Fortran system flushes out the stdout when it ends does not work! Note: before Fortran2003 stdin, stdout, and stderr had predefined numbers: 5 (stdin), 6 (stdout, and 0 (stderr). These work with gfortran, too!

To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.

KnoooW

unread,
Feb 14, 2016, 8:28:18 PM2/14/16
to Native-Client-Discuss
thanks khim,
sorry for my dumb mind!:)
because I haven't use fortran much, I did not do the experiment on write to file or use flush ofter write, but
I did consider this these days, just before coding that, I see your post above, that's great ! 
I believe it works

在 2016年2月6日星期六 UTC+8上午4:56:29,khim写道:

To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages