Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29233 Discussions

Compatibility on compiler directives

teclis77
Beginner
990 Views
Hallo,
we are trying to compile some parts of the Cernlib libraries using Intel Fortran Compiler 9.0 for Win32 XP.

The point is that the compiler directives found in the library are Unix-style- as an example :

#include "gen/pilot.h"
#if defined(CERNLIB_DOUBLE)
SUBROUTINE DMULLZ(A,N,MAXITR,Z0)
#endif
#if !defined(CERNLIB_DOUBLE)
SUBROUTINE RMULLZ(A,N,MAXITR,Z0)
#endif
......

is there any way to automatically recognize such kind of compiler directives structures?

Regards...
0 Kudos
8 Replies
TimP
Honored Contributor III
990 Views
For the Windows compiler to begin to deal with Unix cpp-style pre-processing, you must set the appropriate fpp flag, e.g. -Qfpp2. One of the reasons for this is that a .F or .F90 suffix can't be used as a pre-processing trigger.
For further compatibility with gcc, one of the Windows ports of gcc is often used. The following are equivalent:
gcc -E -traditional -x c *.f
g77 -E *.f
gfortran -E *.f
followed by running ifort on the pre-processed source. This introduction of gcc is more appropriate to a Makefile build than to Visual Studio.
0 Kudos
Steven_L_Intel1
Employee
990 Views
The proper switch to use is -fpp or /fpp.
0 Kudos
teclis77
Beginner
990 Views
Thank You for your answers, but till now I didn't find the solution.
The Cern Libraries are very complicated and all the instructions are valid for Unix. (see for example http://cernlib.web.cern.ch/cernlib/install/install.html)
As you can see, they utilaze "Imake, makedepend, gmake and cpp" Unix packages; in particluar, in each directory they put an "Imakefile", which defines the directories and/or files to make the next level.

Till now I have not find any kind of licterature that is able to "convert" Unix to Windows procedure.

Regards
0 Kudos
TimP
Honored Contributor III
990 Views
Thus, it may not be easy to "convert" in the sense of avoiding all posix emulation and open software tools. Gnu make and tradcpp work much the same on Windows 32-bit mode as under linux, so there is no reason to avoid them, unless you have a local policy against it. I have submitted an issue on ifort requesting full implementation of -assume:underscore, which would remove another of the obstacles. This would be a fairly major undertaking, even if you don't set the requirement to "convert" the entire build procedure to something supported by Microsoft.
0 Kudos
teclis77
Beginner
990 Views
Recently I had to pass from a Fortran Compaq Compiler to the Inetl Fortran Compiler. As Steve said in a previous post (I don't remeber which it is), i have to recompile all the libreries obtained with other compilers.
All the Windows Cern Lib are obtained with Digital first and Compaq Fortran, so I have to recompile them; the Cern web site supplys all the sorce files (*.f, *.h, and so on) but they show, to make the libreries, only for Unix Fortran.

If it is more simpler, I can provide to you the source (a tar.gz file)

Regards
0 Kudos
teclis77
Beginner
990 Views
Hallo everybody,
I would like to thanks Tom18 and Steve_Lionel, because I was found the solution.

Thank you everybody

Teclis77
0 Kudos
Intel_C_Intel
Employee
990 Views
Hello,
I have the same problem than you with CERNLIB. How did you solved it? Do you have now CERNLIB recompiled with Intel Fortran?
0 Kudos
TimP
Honored Contributor III
990 Views
One of the /Qfpp options discussed earlier in the thread should take care of these examples. By "Unix-style" I guess you mean gnu tradcpp style, but you might mean one of the fpp pre-processors, possibly a specific one. Those which are available in source code generally work on Windows. It's just inconvenient to use them with Visual Studio, which to some people is implied when they say Windows.
0 Kudos
Reply