Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all 5691 articles
Browse latest View live

error LNK2019: unresolved external symbol using module

$
0
0

Hi!

I face a problem which I did not succeed to solve despite several trials based on clues found here and elsewhere on the internet…

I gathered several functions and procedures in a module ‘mymod.f90'. Some of these procedures are calling other functions or procedures within the same module. I also have a program ‘myprog’ using the module. These files are in attachment.

I compiled the module without error with ifort –c  mymod.f90 and get files ‘mymod.obj’ and ‘mymod.mod’ created

Then, when I try to compile with ifort mymod.obj myprog.f I have the following errors:

c:\Users>ifort mymod.obj myprog.f

Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.3.202 Build 20140422

Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

 

Microsoft (R) Incremental Linker Version 10.00.40219.01

Copyright (C) Microsoft Corporation.  All rights reserved.

 

-out:mymod.exe

-subsystem:console

mymod.obj

myprog.obj

mymod.obj : error LNK2019: unresolved external symbol I1MACH referenced in function MYMOD_mp_INTEXJX

mymod.obj : error LNK2019: unresolved external symbol ZABS referenced in function MYMOD_mp_INTEXJX

myprog.obj : error LNK2019: unresolved external symbol DQAG referenced in function MAIN__

mymod.exe : fatal error LNK1120: 3 unresolved externals

 

I could solve such errors by removing declarations of variables corresponding to call of functions defined within the module (e.g., variable D1MACH in lines 51,361, 1664,… and variable DGAMLN in lines 3261, 4459 and 4162 of module mymod), as recommended somewhere on this forum. Yet, this did not work for I1MACH and ZABS, for which I get type definition errors. For instance, when removing declaration of variable I1MACH at line 1067 of mymod, I get the following:

 

c:\Users>ifort –c mymod.f90

Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.3.202 Build 20140422

Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

 

mymod.f90(1094): error #6404: This name does not have a type, and must have an explicit type.   [I1MACH]

      K1 = I1MACH(15)

-----------^

mymod.f90(1116): error #6362: The data types of the argument(s) are invalid.   [FLOAT]

      BB=DBLE(FLOAT(I1MACH(9)))*0.5D0

--------------------^

compilation aborted for mymod.f90 (code 1)

 

Besides, I do not know how to solve the error for procedure DQAG called in myprog.

 

For further information, the code works when compiling it with functions and procedures in separate files. Yet, I decided to use a module as I got problem when attempting to parallelize the code with OpenMP (i.e. the ‘do loop’ at line 51 in myprog), apparently because of threads interacting on some variables (though these were declared as private and subroutines as recursive, according to recommendations found on the web in this regard). I read that working with module might solve it.

 

Hope someone can help. Thank you very much in advance!

Fred

 

 

AttachmentSize
Downloadmymod.f90289.44 KB
Downloadmyprog.f1.96 KB

Noncommercial offering

$
0
0

@Steve Lionel (Intel)

Sir

Last week I tried to download Intel Parallel studio for c++ (Linux) but I failed due to the fact that Intel was not giving student version of the software out side USA student. But today I am able to register and download the same. I want to get the facts clear. Has Intel reviewed the noncommercial C++ offering recently. If yes from when??  Can any one provide me the information. Thanks to Intel and you.

Fortran Console application using fortran Static Library

$
0
0

I am getting Runtime error (Severe<157> : Program Exception – access violation) in Fortran Console application using FORTRAN static library. I have tired commenting out Write statements but it gives error to next Write statement .

I have Parallel Studio XE2013 and Visual Studio 2010 installed on my laptop.

 

When I had all source files ( from which static library .lib file was created ) compiled within same project it runs fine without any issues.

 

Is there anything special I need to define/declare in console application file (console.f90)?

Anything special need to do in console file using static library?

 

Thank You

Passing allocateable array to a FORTRAN DLL

$
0
0

I hope you would not mind my ignorance. I am having a hard time trying to figure out how I can pass an allocatable array from a subroutine to a FORTRAN DLL, or if I am doing anything wrong. The source below does work and the values inside the allocateable array is passed to FORTRAN DLL, but it may seem that it may be overwriting something else? Below is the sample code which we are using currently:

      SUBROUTINE CL1(J1)
      REAL*4, ALLOCATABLE :: FFF(:,:)

! HERE I READ A LOGICAL FILE AFTER WHICH I KNOW THE SIZE OF MY ARRAY (ND AND NTSTEPS)
IF(.NOT.ALLOCATED(FFF)) THEN
  IATTEMPT1 = 1
  ALLOCATE (FFF(ND,NTSTEPS), STAT= IALLOC1)
END IF

! Here I will call the DLL file and pass on the allocatable array and the size as arguments

CALL NUKE(FFF,ND,NTSTEPS)

IF(ALLOCATED(FFF)) THEN
  DEALLOCATE(FFF, STAT= IDEALL1)
END IF

RETURN
END

SUBROUTINE NUKE(FFF,NX,NS)

!Expose subroutine NUKE to users of this DLL

!DEC$ ATTRIBUTES DLLEXPORT::NUKE

DIMENSION FFF(NX,NT)

! DO SOME MORE CALCULATION AND PASS THIS ARRAY TO OTHER SUBROUTINES

RETURN
END

 

Compiler generated interfaces stripping attributes

$
0
0

Windows IVF 15.0 update 4

In Debug build (with /warn:interfaces) I get:

error #7062: The characteristics of dummy argument 2 of the associated actual procedure differ from the characteristics of dummy argument 2 of the dummy procedure.
 

The subroutine is declared as:

SUBROUTINE intdeo2_rect(crames,f, a, omega, aw, i, ERR,i_point,sit,ans)
USE dyn_array_crames

IMPLICIT NONE

type(CRAMES_t)                            :: crames
! jd: Add EXTERNAL attribute, then add the interface
! REAL(i8), INTENT(IN)                      :: f
interface
    REAL(i8) FUNCTION  f(crames,xsi,sit,ans)
        USE dyn_array_crames
        USE ieee_arithmetic, ONLY: IEEE_IS_NORMAL
        IMPLICIT NONE
        type(CRAMES_t)                         :: crames
        REAL(i8), INTENT(IN)                   :: xsi,sit
        REAL(i8), INTENT(OUT)                  :: ans(9)
    end function f
end interface

REAL(i8), INTENT(IN)                      :: a
REAL(i8), INTENT(IN)                      :: omega
REAL(i8), INTENT(IN)                      :: aw(0 : crames%lenaw1-1)
REAL(i8), INTENT(OUT)                     :: i
REAL(i8), INTENT(OUT)                     :: ERR
INTEGER, INTENT (IN)                      :: i_point
REAL(i8), INTENT(IN)                      :: sit
REAL(i8), INTENT(OUT)                      :: ans(i_point)

Note the INTENT on the interface to the function argument f

In the auto-generated module I get:

       MODULE INTDEO2_RECT__genmod
          INTERFACE
            SUBROUTINE INTDEO2_RECT(CRAMES,F,A,OMEGA,AW,I,ERR,I_POINT,  &
     &SIT,ANS)
              USE DYN_ARRAY_CRAMES
              INTEGER(KIND=4), INTENT(IN) :: I_POINT
              TYPE (CRAMES_T) :: CRAMES
              INTERFACE
                FUNCTION F(CRAMES,ARG1,ARG2,ARG3)
                  USE DYN_ARRAY_CRAMES
                  TYPE (CRAMES_T) :: CRAMES
                  REAL(KIND=8) :: ARG1
                  REAL(KIND=8) :: ARG2
                  REAL(KIND=8) :: ARG3(*)
                  REAL(KIND=8) :: F
                END FUNCTION F
              END INTERFACE
              REAL(KIND=8), INTENT(IN) :: A
              REAL(KIND=8), INTENT(IN) :: OMEGA
              REAL(KIND=8), INTENT(IN) :: AW(0:CRAMES%LENAW1-1)
              REAL(KIND=8), INTENT(OUT) :: I
              REAL(KIND=8), INTENT(OUT) :: ERR
              REAL(KIND=8), INTENT(IN) :: SIT
              REAL(KIND=8), INTENT(OUT) :: ANS(I_POINT)
            END SUBROUTINE INTDEO2_RECT
          END INTERFACE
        END MODULE INTDEO2_RECT__genmod

Note the lack of INTENT on the args of the declaration of function F interface.

I cannot say if that contributes to the error message or not.

If I remove /warn:interfaces, the code runs properly (inspected with debugger, and results correct)

Jim Dempsey

 

 

Double click selection of variable name is broken in VS

$
0
0

In November 2013 I posted this but the post is locked so I can not bump it:

If you double click a variable name in the source that is a component of a derived type, VS selects past the percent sign on the left but not that on the right!  It would be better I think if it stopped for both sides. It seams to have got changed in XE2013 update 5. In update 3 select stopped on both sides.

It is not yet fixed in XE 2015 update 3 and I presume not in later ones. I know it probably seams minor but it does affect users productivity. Is there an issue number ?

DEC$ ATTRIBUTES DLLEXPORT attribute can not be assigned to an internal procedure

$
0
0

Hi,

I am trying to expose some Fortran subroutines in a DLL.
I didn't write the Fortran code, and I'm having some difficulties creating the DLL.

The Fortran code is something like this (simplified):

! ===========================================================================
 
 ! Some declarations, initialisations etc
 
 contains
 
   subroutine Initialisation

   !DEC$ ATTRIBUTES DLLEXPORT::Initialisation

   !Do some stuff here   
   
   end subroutine Initialisation
   
! ===========================================================================

I keep getting this error:

DEC$ ATTRIBUTES DLLEXPORT attribute can not be assigned to an internal procedure.

I understand that this is because the subroutine is define underneath the "contains" keyword.

I've tried removing this but then I get a load more errors, so i'd rather not go down that route.

Is there an easy was of getting round this problem? I have googled for the error message but can't find a solution

Thanks

Dom

Calling a function from a parallelized do concurrent loop

$
0
0

Trying to compile my program in the release mode with parallelization, I've encountered a problem with calling a function, defined in a module. Here is the sample program to reproduce the problem:

program test
use test_mod
implicit none

integer, parameter :: N = 10
integer :: i
real :: a(N)

do concurrent (i = 1:N)
	a(i) = func(real(i))
end do

print *, a

end program

and the module:

module test_mod
implicit none

contains

pure function func(x)
	real, intent(in) :: x
	real :: func

	func = 1/x
end function

end module

When I compile it in the debug mode, the output is:

  1.000000      0.5000000      0.3333333      0.2500000      0.2000000
 0.1666667      0.1428571      0.1250000      0.1111111      0.1000000

but when I switch to the release mode, the output is just random garbage like this:

       Infinity       Infinity  8.3329765E-29  8.3329765E-29  5.9022872E+37
       Infinity  1.0935606E-33  1.1641040E-10  8.3330276E-29  8.3329765E-29

The command lines for release compilation are:

Compiling with Intel(R) Visual Fortran Compiler XE 14.0.1.139 [IA-32]...
ifort /nologo /O2 /Qparallel /module:"Release\\" /object:"Release\\" /libs:dll /threads /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin""d:\Projects\ParTest\ParTest\mmod.f90"
ifort /nologo /O2 /Qparallel /module:"Release\\" /object:"Release\\" /libs:dll /threads /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin""d:\Projects\ParTest\ParTest\main.f90"

What am I doing wrong? Thank you.


SIMD prefix sum (cumulative sum)

$
0
0

Colleagues,

Does anyone have a good reference to an implementation (or at least an algorithm) for implementing a so-called prefix sum (a cumulative sum) in Fortran using SIMD?  I have found several good reference for implementations in C++ but they use SIMD functions peculiar to C++ that don't appear to be available in Fortran.

David

Problem passing array from C++ to Fortran DLL

$
0
0

Hi,

Apologies for posting my second topic today, but I have searched high and low for a solution to this particular problem and cannot break through it.

I am trying to call a Fortran subroutine (in a DLL) from C++ code, and the subroutine has some allocatable arrays as arguments.

When I step into the subroutine code, the array always shows up as "Undefined pointer/array", so my data is not getting passed in, even though it looks correct on C++ side

Other non dimensional arguments are working fine.

Here is my Fortran code:

subroutine Tick(initial_time,seconds_to_simulate,                                                       & 
                  agents_in_time, agents_in_door,)
  !DEC$ ATTRIBUTES DLLEXPORT::Tick
    
    real(kind=DP), intent(in)                               :: initial_time        !works fine
    real(kind=DP), intent(in)                               :: seconds_to_simulate    !works fine
    integer, dimension(:), allocatable, intent(in)          :: agents_in_door  !NOT WORKING
    real(kind=DP), dimension(:), allocatable, intent(in)    :: agents_in_time  !NOT WORKING
    
    !initial_time and seconds_to_simulate are passed in fine
    
    !agents_in_time and agents_in_door just show up as "Undefined pointer/array"

And here is my C++ code (example)

double starttime = 0;
double timeStep = 10;
double* agentsInTime;
int agents_in_door;
agents_in_time = new double[numNewAgents];
agents_in_door = new int[numNewAgents];
for(int i = 0; i<numNewAgents; ++i)
{
    agents_in_time[i] = currentTime;
    agents_in_door[i] = currentdoor;
}

//Call Tick...passing in the addresses of the 4 arguments, but agents_in_time and agents_in_door are not passed through
Tick(&startTime, &timeStep, &agents_in_time, &agents_in_door)

Anyone have any ideas?

Thanks

Problem installing Parallel Studio 2015 Update 4

$
0
0

I received the notice announcing Update 4 but I am having a problem during the installation:

I get a message saying

The following application should be closed before continuing the install:

   - FLEXnet Connect Software Manager

I checked task manager and closed a process that seems to match the description (some Intel License utility; running wth SYSTEM as user; sorry I did not note the name), but this did not help.

This has not happened with previous updates. AFAIK, nothing else has changed in this computer since the previous update.

I would appreciate any suggestion? What is the name of the executable I should terminate?

Thanks,

Gabriel

Windows 10 ante portas

$
0
0

MS Windows 10 is coming soon. I assume that the developers at Intel are busy getting the development environment and the compilers ready for the new OS version. Any news on the topic? Should we refrain from installing Windows 10 during the first months?

File missing on 2015 compiled XP target

$
0
0

A DLL I compiled with IVF 2015 (on a 64 bit Windows 7 system with Visual Studio 2013) is failing on some XP (SP3) systems. It was compiled with "/SUBSYSTEM:WINDOWS,"5.1"" on the linker line and targeted to 32 bit systems. The Visual Studio 2013 VC runtime installer is run as part of the DLL installation process.

The DLL, installed normally with dependent files and with the VS 2013 runtime, was tested on a completely virgin XP SP3 system and found to work as it should. It also works on a significant number of XP SP3 systems. However, there have been a couple (so far) failures with "file not found" errors indicating that some dependent file is missing or defective -- the DLL itself is definitely present. These have occurred only on particular XP SP3 systems and happen on those systems each time the DLL is called.  (The DLL is also used on other Windows systems but so far this problem has been reported only on XP SP3.) I've had affected users run Dependency Walker and the output is identical to what I see on my virgin XP SP3 test system. I've also had them re-run the VS 2013 runtime installer, since its absence produces the same symptom. None of these approaches has been productive.

Because all the requisite dependent files are present on a virgin system but apparently not on the problem systems, it seems that one or more must have been deleted or perhaps replaced by some incompatible version. Or is there some other possible cause for this symptom?

Can anyone possibly shed any light on this?

Thanks!

resurrecting an old open_gl program

$
0
0

I'm trying to bring an old program back to life.

I believe GLUT is now dead and I'm trying to get the fauxInitWindow routine to setup the graphics window. 

Upon linking, however I get unresolved external symbols in

Error 1  error LNK2019: unresolved external symbol _auxInitDisplayMode@4 referenced in function _JM_GRAPHIC_WIN_INIT_SIZE_2D jm_gl_junction_box.obj 
Error 2  error LNK2019: unresolved external symbol _auxInitPosition@16 referenced in function _JM_GRAPHIC_WIN_INIT_SIZE_2D jm_gl_junction_box.obj 
Error 3  error LNK2019: unresolved external symbol _auxInitWindowA@4 referenced in function _JM_GRAPHIC_WIN_INIT_SIZE_2D jm_gl_junction_box.obj 
 

Any ideas what's else is required

These come from the following routine:

subroutine jm_graphic_win_init_size_2d(title,npx,npy)

c

c routine to initialise graphics window to a specific pixel size

c

USE IFOPNGL

c use opengl_glut

use ifwin

character*(*) title

logical ferror

integer(4) iret

 

c

c call fglutinit

c call fglutinitdisplaymode(ior(k_GLUT_double,k_GLUT_RGB))

call fauxInitDisplayMode (IOR(AUX_SINGLE , AUX_RGB))

call fauxInitPosition (0, 0, 500, 500)

c iret=fglutCreateWindow(title)

iret=fauxInitWindow(title//char(0))

c call fglutReshapeWindow(npx, npy)

c

return

end

 

 

OpenMP performance

$
0
0

This is a rather general question about a situation that arises frequently.  An array is to be populated by computing the entries in a parallelised loop.  What is the best way to prevent slowdown caused by cache line contention?  What I have done in the past is to ensure that each process operates on a range of indices.  For example, if I am using 4 processors and the array is A(4N), then process k populates A(i), i=(k-1)*N+1,..,kN.  Is this the best method?

Thanks

Gib


Problem installing Compaq Fortran 6.6

$
0
0

Problem installing Compaq Fortran 6.6
I have a problem during installing CVF 6.6.
On 90% of installing tere is a error:
"Unexpected error while copying files. Please reboot your computer and retry the installation.
If the problem persists, contact Compaq Computer Corp".

Rebooting does not help.

 

Update 4 broke MSVS 2010 integration

$
0
0

Hi Steve,

Just ran Update 4, and now I have no Fortran integration in MSVS 2010 Pro.

do you have a remedy for this?

Thanks,

David

Hook not executed

$
0
0

I have a QWIN program that uses a DLL which sends status and progress events.
The events are registered using RegisterWindowsMessage.

In order to react to these messages I have set up a hook like this:

use ifwin, only: SetWindowsHookEx, GetCurrentThreadId, WH_GETMESSAGE
! ...
m_hHook = SetWindowsHookEx(WH_GETMESSAGE, %LOC(V3MessagesHook), 0, GetCurrentThreadId())

The signature of the V3MessagesHook function is like this:

integer(4) function V3MessagesHook(nCode, wparam, lparam)
  !DEC$ ATTRIBUTES STDCALL, DECORATE  ::  V3MessagesHook
  integer(4), intent(in)  ::  nCode, wParam, lParam
  !...
end function

Compiling and running the program is no problem, the results are ok, too. But the V3MessagesHook function gets never called.
Using Spy++ I can see that the events I'm trying to get are fired alright.

Where am I going wrong?

TIA Felix

Is OpenMP not supporting Fortran 2003 (PASS, Finalization, etc.)

$
0
0

Hi all,

My question is related to integration of OpenMP in Fortran with some features in standard 2003/2008

In the document of latest 4.0 release it is stated that some features are not supported. The problem is : such features are in my opinion very important for new Object-Oriented paradigm as introduced in new standards.

I made some simple code containing type extension and pass atribute. The OpenMP work and a get  speedup of 12x. ( on 12 cores !!!) 

But in other complex cases ( with multiple classes and procedures pointers) I got unexpected access violation in runtime.

Before I investigate more, is any one had similar errors with OepnMP in context of OOP paradigm of Fortran 2003/2008.

Thanks

P.S. Here is the part of text related to my post, see for details the link: http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf

!==========================================================================================

ISO/IEC 1539-1:2004, Information Technology - Programming Languages - Fortran.

This OpenMP API specification refers to ISO/IEC 1539-1:2004 as Fortran 2003. The following features are not supported: 

• IEEE Arithmetic issues covered in Fortran 2003 Section 14

• Allocatable enhancement • Parameterized derived types

• Finalization

• Procedures bound by name to a type

• The PASS attribute 

• Procedures bound to a type as operators

• Type extension

• Overriding a type-bound procedure

• Polymorphic entities

• SELECT TYPE construct

• Deferred bindings and abstract types

• Controlling IEEE underflow

• Another IEEE class value

Where this OpenMP API specification refers to C, C++ or Fortran, reference is made to the base language supported by the implementation

!============================================================================================================

Console app in debug : module built without symbols

$
0
0

Hi,

I am trying to built a console app in debug config. The exe is triggering a breakpoint and I get the message saying that the module libifcoremdd.dll was built without symbols

'ifort.exe' (Win32): Loaded '\\hqfs2\pengen\2013\UVS\Version\V1\ifort\Debug\ifort.exe'. Symbols loaded.

'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sysfer.dll'. Cannot find or open the PDB file.
'ifort.exe' (Win32): Loaded 'C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler\libifcoremdd.dll'. Module was built without symbols.
'ifort.exe' (Win32): Loaded 'C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler\libmmd.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imagehlp.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\compiler\libifportmd.dll'. Module was built without symbols.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
'ifort.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dbghelp.dll'. Symbols loaded.

 

I am stuck there. Note: When I build in release configuration I do not get the message. 

Is there any symbol file for libifcoremdd ?

How can I go pass that ?

Thank you

Viewing all 5691 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>