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

IFPORT.LIB in IVF9.0 combined with MS-Visual Studio .NET 2003 IDE?

z_wang
Beginner
1,107 Views

Dear Moderator,

When I try to transform the codes developed in CVF platform into IVF9.0 with Visual studio .NET 2003 IDE. I was puzzled by some problems.

When I try to compile result = RAND() (with USE IFPORT ahead), the comipler tells it cannot match this function. So I look up the manual and it gives cues that a extra /fpscomp:nolibs option is to be added in the linker. But I can't find where to put this option in the project properties. Can anyone tell me how to set this option or solve this problem?

Curious enough, when I build a project with sample file and just simply add result = RAND()(with no /fpscomp:nolibs added), the building process is succeed.

So I wonder anyone could give some tips on how to set the project or how to havethe problemresovled.

Best regards,

James

0 Kudos
7 Replies
Steven_L_Intel1
Employee
1,107 Views

What is the exact error you're getting? If it is a compiler error (points to a source line), then libraries are not the issue. Rather, you're calling RAND with an argument that is not an INTEGER*4 and the compiler is complaining about the mismatch.

It is not necessary to specify any option to get the portability library linked in - that is the default.

0 Kudos
z_wang
Beginner
1,107 Views

Dear Steve,

My code is like this way.

MODULE **
USE IFPORT

...

REAL :: U

...

U = RAND()

-----------

Error: The same named entity from different modules and/or program units cannot be referenced. [RAND]

...Error: There is no matching specific function for this generic function reference. [RAND]

-----------

It is the way I used in CVF 6.0 and no problem shows up, while in CVF 6.0 the corresponding library is DFPORT.

Thank you very much for qucik response.

Best regards,

James

0 Kudos
z_wang
Beginner
1,107 Views

hi, Steve

More information for the compilation.

------ Build started: Project: EA_SPSS, Configuration: Debug|Win32 ------

Compiling with Intel Fortran 9.0...
ifort /nologo /Zi /Od /module:"Debug/" /object:"Debug/" /traceback /check:bounds /libs:static /dbglibs /c /fpscomp:nolibs E:ProgramStudioPSSIntel-PSSEA_SPSSGA.F90
Error: The same named entity from different modules and/or program units cannot be referenced. [RAND]

E:ProgramStudioPSSIntel-PSSEA_SPSSGA.F90(113) : Error: There is no matching specific function for this generic function reference. [RAND]
U = RAND(0)
--------------------^
compilation aborted for E:ProgramStudioPSSIntel-PSSEA_SPSSGA.F90 (code 1)


EA_SPSS build failed.

Thank you for your consideration.

James

0 Kudos
Steven_L_Intel1
Employee
1,107 Views

We have fixed many bugs in the compiler since CVF 6.0, including those where the compiler did not detect errors. There is not enough information here for me to tell you exactly what the problem is, but in general it is that there is some other module you are using which names a symbol RAND, and it is not correct Fortran to have two symbols of the same name come from two different modules (with some exceptions.)

Usually, the solution for this is to use a renaming clause on the USE for the other module so that the conflicting symbol is named something else, for example:

USE OTHERMOD, DUMMY => RAND

Or you can use an ONLY clause to bring in only those symbols you want.

Another possibility is that you have declared RAND in your source as EXTERNAL or REAL (or both). If that is the case, remove those declarations.

0 Kudos
z_wang
Beginner
1,107 Views

Hi, Steve

I hope you won't mind if I want to say more on this topic. ^_^

Up to now, I can bypass this problem by replacing the U=RAND(0) with RANDOM_NUMBER(U). I have checked the program, there is no other defined RAND, neither is external/real RAND(0).

I use it very directly, since it is a function version of RANDOM_NUMBER(U).

Another interesting happened on me is when I replace U=RAND(0) with U=RANDOM(0), it also works. So the problem is about RAND(). Anyway, RANDOM_NUMBER(U) has been the first choice, though it is not function-like.

Another issue is why the IVF compiling process runs much slower than that in CVF, is it caused by the .NET? I have to wait much longer for the result. How can I speed up the building process?

Thank you so much.

James

0 Kudos
TimP
Honored Contributor III
1,107 Views
Generally speaking, if you want fast compilation but don't care as much about execution speed, you would use ifort with options which don't involve vectorization, such as
-O1 -Qvec- -QxW
It's really hard to compare CVF and ifort, particularly without more specifics about what you are doing. If you don't want to generate code for current production CPUs, or happen to concentrate on areas where CVF was strong and ifort is still weak, ifort is over-kill, at least with usual options.
0 Kudos
Steven_L_Intel1
Employee
1,107 Views

James,

You may not have another RAND but you may be using some module which also defines RAND. However, of the modules that Intel Fortran provides, IFPORT is the only one with RAND, so I'd need to see a complete test case to understand the problem.

As for compilation speed, my experience is that reasonably current versions of Intel Fortran are close in speed to CVF, except for very small programs where you might see tenths of seconds differences.If you have a test case that shows a significant difference for a sizeable program (compiles for at least 30 seconds), and you're careful to use comparable optimization options, please send us an example to Intel Premier Support so that we can investigate.

0 Kudos
Reply