- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey, I ran across some code with the extension .fcpp. I have tried using the preprocessor by invoking the -fpp flag and other preprocessing flags but to didn't succeed.
Does anyone know how to compile with this type of file?your text here
Does anyone know how to compile with this type of file?your text here
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If this is a file which expects to be run through a C pre-processor, followed by running the Fortran compiler, the usual linux convention is a file suffix .F I don't think anyone could predict which C pre-processor functions it would require. The Intel compilers incorporate some of the usual linux/Unix functionality in this area, for files named .F, .F90, etc. possibly with the use of the -fpp options.
If you want the full pre-processing capability expected of g77, you may need to use g77 or gcc to pre-process the file, and pass the result to the Intel compiler. This might be done with a command such as
gcc -traditional -E -x c file.fcpp> temp.f
'g77 -E' is the same as gcc -E -traditional
Translation: use the old style cpp (don't process // as comment), and treat the file.fcpp as C source for that purpose. Put the pre-processed result in temp.f.
There are many pre-processors for Fortran, and they function alike only in the simplest cases, if at all. Considering that your source didn't use one of the most common conventions, it's impossible to guess all the details.
If you want the full pre-processing capability expected of g77, you may need to use g77 or gcc to pre-process the file, and pass the result to the Intel compiler. This might be done with a command such as
gcc -traditional -E -x c file.fcpp> temp.f
'g77 -E' is the same as gcc -E -traditional
Translation: use the old style cpp (don't process // as comment), and treat the file.fcpp as C source for that purpose. Put the pre-processed result in temp.f.
There are many pre-processors for Fortran, and they function alike only in the simplest cases, if at all. Considering that your source didn't use one of the most common conventions, it's impossible to guess all the details.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page