Home > Archive > Fortran > August 2005 > fcomp ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Bart Vandewoestyne 2005-08-19, 4:18 pm |
| Today, I was clearing my homedirectory a bit, and I came across
the following binary named `fcomp' which is 1.6M in size:
bartv@vonneumann:~/bin/bin.linux$ file fcomp
fcomp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
I was wondering why I once placed this file into my bin
directory... i thought it was a compiler but somehow none of
these seem to work:
bartv@vonneumann:~/bin/bin.linux$ ./fcomp -V
Unknown option -V
bartv@vonneumann:~/bin/bin.linux$ ./fcomp --version
Unknown option --version
bartv@vonneumann:~/bin/bin.linux$ ./fcomp --Version
Unknown option --Version
bartv@vonneumann:~/bin/bin.linux$ ./fcomp -h
Unknown option -h
bartv@vonneumann:~/bin/bin.linux$ ./fcomp --h
Unknown option --h
It seems to accept the -v option, but without doing anything:
bartv@vonneumann:~/bin/bin.linux$ ./fcomp -v
bartv@vonneumann:~/bin/bin.linux$
However, if i run fcomp on an f90 file, it seems to output some
C-file:
bartv@vonneumann:~/fortran$ ls *.c
ls: *.c: No such file or directory
bartv@vonneumann:~/fortran$ fcomp example_hello_world.f95
bartv@vonneumann:~/fortran$ cat example_hello_world.c
# line 1 "example_hello_world.f95"
#include <f95.h>
# line 1 "example_hello_world.f95"
int main(argc,argv)
# line 1 "example_hello_world.f95"
int argc; char *argv[];
# line 1 "example_hello_world.f95"
{
# line 1 "example_hello_world.f95"
f90_init(argc,argv);
# line 5 "example_hello_world.f95"
__NAGf90_write(6,(char*)0,0,(char*)0,0,0
);
# line 5 "example_hello_world.f95"
__NAGf90_lwrite_ch("Hello World!",12);
# line 5 "example_hello_world.f95"
__NAGf90_endwrite();
# line 7 "example_hello_world.f95"
f90_finish(0);
# line 7 "example_hello_world.f95"
}
So it seems like it's doing some kind of Fortran->C conversion,
and it is somehow related to the NAGWare compiler...
Does anybody have any idea what tool this is, where I could
possibly obtained it and what would be the URL of this tool?
Regards,
Bart
--
"Share what you know. Learn what you don't."
| |
| David Frank 2005-08-19, 4:18 pm |
| I seem to recall that NAG uses a Fortran to C conversion and then compiles
the result using a C compiler to create the Fortran exe..
My guess?
fcomp was installed by some NAG Fortran installation and when user at a
later data un-installed it,
fcomp was left behind.
| |
| Bart Vandewoestyne 2005-08-19, 4:18 pm |
| On 2005-08-19, David Frank <dave_frank@hotmail.com> wrote:
> I seem to recall that NAG uses a Fortran to C conversion and then compiles
> the result using a C compiler to create the Fortran exe..
> My guess?
> fcomp was installed by some NAG Fortran installation and when user at a
> later data un-installed it,
> fcomp was left behind.
Yep, I guess this was a `left-behind' from my installation of the
F-compiler... apparently, after unpacking the tarball containing
the F-compiler, you have an fcomp binary in the lib directory:
bartv@asgard:/cw/fortran/F$ find F_031017/ -name fcomp
F_031017/lib/fcomp
Problem solved, and file removed :-)
Regards,
Bart
--
"Share what you know. Learn what you don't."
| |
| Richard E Maine 2005-08-19, 4:18 pm |
| In article <1124433441.474535@seven.kulnet.kuleuven.ac.be>,
Bart Vandewoestyne <MyFirstName.MyLastName@telenet.be> wrote:
> However, if i run fcomp on an f90 file, it seems to output some
> C-file:
....
> So it seems like it's doing some kind of Fortran->C conversion,
> and it is somehow related to the NAGWare compiler...
>
> Does anybody have any idea what tool this is, where I could
> possibly obtained it and what would be the URL of this tool?
You have already found out that this was indeed part of the NAG compiler
(or, in this case, the F compiler, derived from NAG).
Just to answer the other part of your question, you can't buy it as a
separate standalone product, but if you get the NAG compiler, you can
use it's -S switch to output this C code file. You could consider the
Fortran->C conversion to be a tool included in the compiler. But note
that the generated C code tends to heavily reference the compiler's
run-time support library. You *CAN* compile and use the resulting C
code, but you have to bring along the support "baggage," which makes it
less than ideal as a standalone language conversion tool.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| Pierre Asselin 2005-08-19, 4:18 pm |
| Bart Vandewoestyne <MyFirstName.MyLastName@telenet.be> wrote:
> bartv@vonneumann:~/bin/bin.linux$ ./fcomp -V
> Unknown option -V
> bartv@vonneumann:~/bin/bin.linux$ ./fcomp --version
> Unknown option --version
> bartv@vonneumann:~/bin/bin.linux$ ./fcomp --Version
> Unknown option --Version
> bartv@vonneumann:~/bin/bin.linux$ ./fcomp -h
> Unknown option -h
> bartv@vonneumann:~/bin/bin.linux$ ./fcomp --h
> Unknown option --h
Don't forget the ever-popular
strings fcomp | less
(I know you solved your problem, but just in case it happens again).
--
pa at panix dot com
| |
| Bart Vandewoestyne 2005-08-19, 4:18 pm |
| On 2005-08-19, Pierre Asselin <pa@see.signature.invalid> wrote:
>
> Don't forget the ever-popular
> strings fcomp | less
>
> (I know you solved your problem, but just in case it happens again).
Interesting! I didn't know that one. :-)
Thanks,
Bart
--
"Share what you know. Learn what you don't."
| |
| Dr Ivan D. Reid 2005-08-19, 4:18 pm |
| On Fri, 19 Aug 2005 16:11:50 +0000 (UTC),
Bart Vandewoestyne <MyFirstName.MyLastName@telenet.be>
wrote in <1124464310.961589@seven.kulnet.kuleuven.ac.be>:
> On 2005-08-19, Pierre Asselin <pa@see.signature.invalid> wrote:
[color=darkred]
[color=darkred]
> Interesting! I didn't know that one. :-)
> Thanks,
> Bart
strings can be most useful. Although my desktop is a Windows machine, I
run cygwin on it to log onto various Linux/Unix machines and read my mail
on a Sun with pine. Any dodgy attachments that got past the Uni's spam
catcher? Save to file and run strings to look for Windows library entry-
points. Suspicious URLs? Retrieve them using wget then do the same.
It's worth spending a couple of minutes reading the man pages to learn
how to tailor its behaviour.
--
Ivan Reid, Electronic & Computer Engineering, ___ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
|
|
|
|
|