Hi! Was this ever implemented? I'm getting "missing function: _gfortran_set_args" etc... can you guys point me in the right direction if there was a fix? Best regards // Matt
Den torsdagen den 28:e juni 2012 kl. 02:53:49 UTC+2 skrev azakai: > > The fix is not in master, just in the incoming branch. > > git checkout incoming > git pull > > will get that. But beware that incoming is where code lives until we > fully test it (then it gets to master) so generally you should use > master. > > - azakai > > > On Wed, Jun 27, 2012 at 4:00 PM, Joseph Winston > <[email protected] <javascript:>> wrote: > > I've updated emscripten to d21efe08b3baad41ae1ffa3a313e6ce30c6df182, but > I'm > > seeing different results from you. git log -n 1 says: > > > > commit d21efe08b3baad41ae1ffa3a313e6ce30c6df182 > > Author: Alon Zakai <[email protected] <javascript:>> > > Date: Fri Jun 22 21:29:59 2012 -0700 > > > > fix test_fcntl > > > > If the changes were pushed, the warnings and errors look like they did > > before. > > > > Here are the warnings when compiling six.c: > > > > $ emcc -I. six.c libf2c.a -o six.js > > clang: warning: argument unused during compilation: '-nostdinc++' > > /opt/local/libexec/llvm-3.1/bin/llvm-nm: > > > /var/folders/Ku/KuD7jFMxGZCtXd1E2jQuZE+++TI/-Tmp-/emscripten_temp_CnX0ay/ar_output_94963/signal1.h: > > > > unrecognizable file type > > /opt/local/libexec/llvm-3.1/bin/llvm-nm: > > > /var/folders/Ku/KuD7jFMxGZCtXd1E2jQuZE+++TI/-Tmp-/emscripten_temp_CnX0ay/ar_output_94963/sysdep1.h: > > > > unrecognizable file type > > > > /opt/local/libexec/llvm-3.1/bin/llvm-dis: Invalid bitcode signature > > /opt/local/libexec/llvm-3.1/bin/llvm-dis: Invalid bitcode signature > > > > Running it produces the following: > > > > $ node six.js > > HOUR = 0 SECONDS = 0 > > HOUR = 1 SECONDS = 3600 > > HOUR = 2 SECONDS = 7200 > > HOUR = 3 SECONDS = 10800 > > HOUR = 4 SECONDS = 14400 > > HOUR = 5 SECONDS = 18000 > > HOUR = 6 SECONDS = 21600 > > HOUR = 7 SECONDS = 25200 > > HOUR = 8 SECONDS = 28800 > > HOUR = 9 SECONDS = 32400 > > HOUR = 10 SECONDS = 36000 > > HOUR = 11 SECONDS = 39600 > > HOUR = 12 SECONDS = 43200 > > HOUR = 13 SECONDS = 46800 > > HOUR = 14 SECONDS = 50400 > > HOUR = 15 SECONDS = 54000 > > HOUR = 16 SECONDS = 57600 > > HOUR = 17 SECONDS = 61200 > > HOUR = 18 SECONDS = 64800 > > HOUR = 19 SECONDS = 68400 > > HOUR = 20 SECONDS = 72000 > > HOUR = 21 SECONDS = 75600 > > HOUR = 22 SECONDS = 79200 > > HOUR = 23 SECONDS = 82800 > > HOUR = 24 SECONDS = 86400 > > > > > /Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:11697 > > > > > > position += stream.object.contents.length; > > ^ > > TypeError: Cannot read property 'length' of undefined > > at _lseek > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:11697:45) > > > > at _fseek > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:11714:17) > > > > at _t_runc > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:1239:18) > > > > at _f_clos > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:1074:17) > > > > at _f_exit > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:1163:17) > > > > at callRuntimeCallbacks > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:726:5) > > > > at exitRuntime > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:741:3) > > > > at __exit > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:12632:7) > > > > at _exit > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:12637:7) > > > > at _s_stop > > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/six.js:4026:7) > > > > > > The versions of the other software are: > > > > $ python > > Python 2.6.1 (r261:67515, Aug 2 2010, 20:10:18) > > [GCC 4.2.1 (Apple Inc. build 5646)] on darwin > > Type "help", "copyright", "credits" or "license" for more information. > >>>> ^D > > > > $ clang --version > > clang version 3.1 (branches/release_31) > > Target: x86_64-apple-darwin10.8.0 > > Thread model: posix > > > > $ llvm-nm --version > > LLVM (http://llvm.org/): > > LLVM version 3.1 > > Optimized build with assertions. > > Built Jun 1 2012 (08:42:03). > > Default target: x86_64-apple-darwin10.8.0 > > Host CPU: corei7-avx > > > > $ node --version > > v0.8.0 > > > > $ java -version > > java version "1.6.0_33" > > Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-10M3720) > > Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode) > > > > All this is running on an up to date MacBook Pro (OS: 10.6.8, Processor: > 2.2 > > GHz Intel Core i7) > > > > I've updated my repository > > http://github.com/josephwinston/emscripten-f2c.git with the newly > compiled > > files to see if this helps track down the problems. > > > > > > > > > > On Tuesday, June 26, 2012 2:57:10 PM UTC-5, azakai wrote: > >> > >> Thanks, I was able to build and debug this now. It looks like all was > well > >> except for a filesystem operation during exit(), we had a bug in > lseek's > >> handling of stderr. That should be fixed on emscripten's incoming > >> branch now. With that, the output of six is > >> > >> HOUR = 0 SECONDS = 0 > >> HOUR = 1 SECONDS = 3600 > >> HOUR = 2 SECONDS = 7200 > >> HOUR = 3 SECONDS = 10800 > >> HOUR = 4 SECONDS = 14400 > >> HOUR = 5 SECONDS = 18000 > >> HOUR = 6 SECONDS = 21600 > >> HOUR = 7 SECONDS = 25200 > >> HOUR = 8 SECONDS = 28800 > >> HOUR = 9 SECONDS = 32400 > >> HOUR = 10 SECONDS = 36000 > >> HOUR = 11 SECONDS = 39600 > >> HOUR = 12 SECONDS = 43200 > >> HOUR = 13 SECONDS = 46800 > >> HOUR = 14 SECONDS = 50400 > >> HOUR = 15 SECONDS = 54000 > >> HOUR = 16 SECONDS = 57600 > >> HOUR = 17 SECONDS = 61200 > >> HOUR = 18 SECONDS = 64800 > >> HOUR = 19 SECONDS = 68400 > >> HOUR = 20 SECONDS = 72000 > >> HOUR = 21 SECONDS = 75600 > >> HOUR = 22 SECONDS = 79200 > >> HOUR = 23 SECONDS = 82800 > >> HOUR = 24 SECONDS = 86400 > >> > >> node.js:201 > >> throw e; // process.nextTick error, or 'error' event on first > tick > >> ^ > >> exit(0) called > >> > >> Is that the right output? > >> > >> - azakai > >> > >> > >> On Thu, Jun 21, 2012 at 8:30 AM, Joseph Winston > >> <[email protected] <javascript:>> wrote: > >> > The entire git repository of f2c with the compiled code is here: > >> > https://github.com/josephwinston/emscripten-f2c > >> > > >> > The two directories of interest are: > >> > https://github.com/josephwinston/emscripten-f2c/tree/master/libf2c, > >> > which > >> > includes all the source for the f2c runtime, the emcc complied .c > code > >> > in > >> > .o, and the resulting library. These files were built using emmake > make > >> > in > >> > this directory. > >> > > >> > The other location that you might want to use is > >> > https://github.com/josephwinston/emscripten-f2c/tree/master/examples. > > >> > This > >> > directory has some simple FORTRAN files and the .js results using > emcc. > >> > > >> > > >> > On Wednesday, June 20, 2012 6:40:22 PM UTC-5, azakai wrote: > >> >> > >> >> Can you perhaps put up the .bc of f2c's runtime? Or even better > >> >> of it linked to that program. I basically want the bitcode file that > >> >> when compiled to js, fails as shown above, then I'll debug that. > >> >> > >> >> - azakai > >> >> > >> >> > >> >> On Tue, Jun 19, 2012 at 7:20 AM, Joseph Winston > >> >> <[email protected] <javascript:>> wrote: > >> >> > The sample FORTRAN code is here: https://gist.github.com/2954433 > >> >> > > >> >> > The resulting C code obtained by f2c: > https://gist.github.com/2954438 > >> >> > > >> >> > The JavaScript version: https://gist.github.com/2954455 > >> >> > > >> >> > If you want to recreate the final step you will need f2c.h along > with > >> >> > libf2c.a that was produced by running emcc over f2c's runtime > >> >> > library. > >> >> > > >> >> > > >> >> > On Monday, June 18, 2012 3:55:07 PM UTC-5, azakai wrote: > >> >> >> > >> >> >> This seems like a good approach. If there is a fortran to C > >> >> >> compiler, that should make this much eaiser. > >> >> >> > >> >> >> Can you attach the generated C and JS code, so we can > >> >> >> figure out what went wrong at the last step? > >> >> >> > >> >> >> - azakai > >> >> >> > >> >> >> > >> >> >> On Thu, Jun 14, 2012 at 6:25 PM, Joseph Winston > >> >> >> <[email protected] <javascript:>> wrote: > >> >> >> > It is a hack. It isn't pretty. But using f2c almost works > >> >> >> > completely. > >> >> >> > > >> >> >> > Here is what I did. > >> >> >> > > >> >> >> > Grab http://www.netlib.org/f2c/libf2c.zip > >> >> >> > Extract > >> >> >> > Copy makefile.u to Makefile > >> >> >> > Replace CC with emcc, ar with emar, and change the .c.o target > to > >> >> >> > just > >> >> >> > compile > >> >> >> > emmake make all > >> >> >> > See if you have an version of f2c on your system. If not: > >> >> >> > > >> >> >> > curl > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > http://netlib.sandia.gov/cgi-bin/netlib/netlibfiles.tar?filename=netlib/f2c > >> >> >> > -o "f2c.tar" > >> >> >> > cd to the src directory > >> >> >> > cp makefile.u to Makefile > >> >> >> > Edit as needed > >> >> >> > compile with the C compiler > >> >> >> > > >> >> >> > run f2c on your code (eg f2c three.f) It will give you a > >> >> >> > translated > >> >> >> > version > >> >> >> > of this file (for this example three.c) > >> >> >> > run emcc on this file add the correct path to f2c.h along with > the > >> >> >> > library > >> >> >> > you made in step 5 > >> >> >> > > >> >> >> > Here is what isn't quite right. > >> >> >> > > >> >> >> > When I take the program: > >> >> >> > > >> >> >> > PROGRAM MAIN > >> >> >> > INTEGER I, INTPI, INTE > >> >> >> > REAL X, REALPI, REALE > >> >> >> > I = 1 > >> >> >> > X = 1 > >> >> >> > PRINT *, 'THE VALUE OF 1 AS A REAL IS', X > >> >> >> > PRINT *, 'THE VALUE OF 1 AS AN INTEGER IS', I > >> >> >> > REALPI = 3.1416 > >> >> >> > INTPI = REALPI > >> >> >> > PRINT *, 'THE VALUE OF PI AS A REAL IS', REALPI > >> >> >> > PRINT *, 'THE VALUE OF PI AS AN INTEGER IS', INTPI > >> >> >> > REALE = 2.71828 > >> >> >> > INTE = REALE > >> >> >> > PRINT *, 'THE VALUE OF E AS A REAL IS', REALE > >> >> >> > PRINT *, 'THE VALUE OF E AS AN INTEGER IS', INTE > >> >> >> > STOP > >> >> >> > END > >> >> >> > > >> >> >> > emcc produces the following messages: > >> >> >> > > >> >> >> > $ emcc -I. three.c libf2c.a -o three.js > >> >> >> > clang: warning: argument unused during compilation: > '-nostdinc++' > >> >> >> > /opt/local/libexec/llvm-3.1/bin/llvm-nm: > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > /var/folders/Ku/KuD7jFMxGZCtXd1E2jQuZE+++TI/-Tmp-/emscripten_temp_3Raw5k/ar_output_52996/signal1.h: > > > >> >> >> > unrecognizable file type > >> >> >> > /opt/local/libexec/llvm-3.1/bin/llvm-nm: > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > /var/folders/Ku/KuD7jFMxGZCtXd1E2jQuZE+++TI/-Tmp-/emscripten_temp_3Raw5k/ar_output_52996/sysdep1.h: > > > >> >> >> > unrecognizable file type > >> >> >> > /opt/local/libexec/llvm-3.1/bin/llvm-dis: Invalid bitcode > >> >> >> > signature > >> >> >> > /opt/local/libexec/llvm-3.1/bin/llvm-dis: Invalid bitcode > >> >> >> > signature > >> >> >> > > >> >> >> > Running almost works: > >> >> >> > > >> >> >> > $node three.js > >> >> >> > THE VALUE OF 1 AS A REAL IS 1. > >> >> >> > THE VALUE OF 1 AS AN INTEGER IS 1 > >> >> >> > THE VALUE OF PI AS A REAL IS 3.14159989 > >> >> >> > THE VALUE OF PI AS AN INTEGER IS 3 > >> >> >> > THE VALUE OF E AS A REAL IS 2.71828008 > >> >> >> > THE VALUE OF E AS AN INTEGER IS 2 > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > /Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:11695 > > > >> >> >> > position += stream.object.contents.length; > >> >> >> > ^ > >> >> >> > TypeError: Cannot read property 'length' of undefined > >> >> >> > at _lseek > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:11695:45) > > > >> >> >> > at _fseek > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:11712:17) > > > >> >> >> > at _t_runc > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:1239:18) > > > >> >> >> > at _f_clos > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:1074:17) > > > >> >> >> > at _f_exit > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:1163:17) > > > >> >> >> > at callRuntimeCallbacks > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:721:5) > > > >> >> >> > at exitRuntime > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:736:3) > > > >> >> >> > at __exit > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:12630:7) > > > >> >> >> > at _exit > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:12635:7) > > > >> >> >> > at _s_stop > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > (/Users/hb55683/src/Remote/GIT/emscripten/f2c/src/tmp/f2c/examples/three.js:4026:7) > > > >> >> >> > > >> >> >> > On Wednesday, June 13, 2012 4:27:01 PM UTC-5, azakai wrote: > >> >> >> >> > >> >> >> >> The gcc version should not matter much, since all we need is > the > >> >> >> >> runtime glue code. Basically C implementations of those > >> >> >> >> gfortran_* > >> >> >> >> functions. > >> >> >> >> > >> >> >> >> If you can separate out the gfortran C files into a separate > >> >> >> >> download, > >> >> >> >> I can try to build that and integrate with emscripten > >> >> >> >> (downloading > >> >> >> >> all of gcc makes my wifi sad in my current location). > >> >> >> >> > >> >> >> >> - azakai > >> >> >> >> > >> >> >> >> > >> >> >> >> On Tue, Jun 12, 2012 at 5:57 PM, Marc Coram > >> >> >> >> <[email protected] <javascript:>> > >> >> >> >> wrote: > >> >> >> >> > It occurs to me that I can offer some funds to support this > >> >> >> >> > effort > >> >> >> >> > financially. I.e. to pay a consultant. Or maybe there's a > >> >> >> >> > better > >> >> >> >> > way > >> >> >> >> > to > >> >> >> >> > help? > >> >> >> >> > > >> >> >> >> > For general responses, I'd be happy to see them here. > >> >> >> >> > > >> >> >> >> > For anyone volunteering to consult on this issue, contact me > by > >> >> >> >> > email > >> >> >> >> > (it's > >> >> >> >> > not hard to find). However, people without a serious track > >> >> >> >> > record > >> >> >> >> > of > >> >> >> >> > contributing to open source need not apply. > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > On Sun, Jun 10, 2012 at 5:40 PM, Marc Coram > >> >> >> >> > <[email protected] <javascript:>> > >> >> >> >> > wrote: > >> >> >> >> >> > >> >> >> >> >> Good question. I should have linked the GFortan page, I > guess. > >> >> >> >> >> Took > >> >> >> >> >> me > >> >> >> >> >> some more hunting from there. Seems that it's buried in the > >> >> >> >> >> gcc > >> >> >> >> >> tarball > >> >> >> >> >> at > >> >> >> >> >> the libfortran path. E.g.: > >> >> >> >> >> wget > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > ftp://gcc.gnu.org/pub/gcc/snapshots/4.7-20120609/gcc-4.7-20120609.tar.bz2 > >> >> >> >> >> tar -xzvf gcc-4.7-20120609.tar.bz2 > >> >> >> >> >> gcc-4.7-20120609/libgfortran > >> >> >> >> >> I don't know what version of gcc is appropriate here (I'm > out > >> >> >> >> >> of > >> >> >> >> >> my > >> >> >> >> >> depth) > >> >> >> >> >> so change that part as needed, of course. > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> On Sat, Jun 9, 2012 at 4:43 PM, Alon Zakai > >> >> >> >> >> <[email protected] <javascript:>> > >> >> >> >> >> wrote: > >> >> >> >> >>> > >> >> >> >> >>> Looks like that is relevant, yeah. Are there instructions > >> >> >> >> >>> anywhere for downloading it? All I see there is a web > >> >> >> >> >>> source browser... > >> >> >> >> >>> > >> >> >> >> >>> - azakai > >> >> >> >> >>> > >> >> >> >> >>> > >> >> >> >> >>> On Fri, Jun 8, 2012 at 5:25 PM, Marc Coram > >> >> >> >> >>> <[email protected] <javascript:>> > >> >> >> >> >>> wrote: > >> >> >> >> >>> > Does this help? I think this is the C source to the gnu > >> >> >> >> >>> > fortran > >> >> >> >> >>> > runtime: > >> >> >> >> >>> > > >> >> >> >> >>> > > http://opensource.apple.com/source/gcc/gcc-5341/libgfortran/ > >> >> >> >> >>> > BTW, it's using cpp heavily to add prefixes to the > symbol > >> >> >> >> >>> > names, > >> >> >> >> >>> > e.g. > >> >> >> >> >>> > #define PREFIX(x) _gfortran_ ## x > >> >> >> >> >>> > > >> >> >> >> >>> > [I'd love to see this come together!] > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> > > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
