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

Questionnaire on the value of newer Fortran standards

$
0
0

Benefits of continuing Fortran standardisation

If you use Fortran, directly or indirectly, please will you complete
this survey

https://goo.gl/forms/JUFUReOoVUin2m8D2

It has been developed by the committee of the BCS Fortran Group
(http://www.fortran.bcs.org) to
quantify the value of modern Fortran standards to organisations and
individuals.  The results of the survey will help the Group justify
continuing involvement in Fortran standardisation efforts.

The results of the survey will be shared with the ISO Fortran
standardisation committee, so your responses will help shape the future
of the Fortran language.

The survey will run until 31 Dec. 2018.

The Fortran language has been steadily developing since its origins in
1957.  Many people have been working on revising the Fortran
specification, resulting in Fortran 77, 90, 95, 2003, 2008 and 2018
standards.  This survey is designed to find out exactly what benefits
newer Fortran standards bring to the community.

We would like to know how newer Fortran standards have increased the
quality of your code, cut development costs, increased portability or
performance of your code, or whether you can attach any monetary value
to the benefits enabled by modern Fortran standards.

This questionnaire contains 4 sections.
All questions are optional.
It will take no more than 10 minutes to complete.

Anton Shterenlikht, BCS Fortran Standards Officer


scope of implicit none in interface block?

$
0
0

Hi

Is an interface block in a module supposed to honor the implicit none declaration in the module? I find that the "contained" procedures do so (as expected) but not the declarations in the interface block. Is this as per the standard?

A test program is below. (---which has j vs k usage which is kind of obvious but I encountered it in something like iFrom vs iForm. I agree that typically the interface blocks like this are "copied" from other files and /or auto generated; so such errors won't be that common, nevertheless.)

Abhi

---

      Module OM
   
         Implicit None
         
         Interface
            Subroutine Method(i, j)
               !Implicit None ! without this statement there is no compile-time error for "j"
               Integer :: i, k
            End Subroutine Method            
         End Interface
         
      Contains
      
         Subroutine Tech(i, j)
            Integer :: i, k ! the error for j vs k is caught
            i = 1
         End Subroutine Tech
         
      End Module OM

Catastrophic error

$
0
0

The following code produces a "catastrophic error: **Internal compiler error: internal abort**" with the Intel Fortran compiler (2017 and 2018):

module test_module

use, intrinsic:: iso_c_binding

implicit none

procedure(func),public,pointer :: f => null()

abstract interface
    type(c_ptr) function func(p) bind(c)
    import :: c_ptr
    implicit none
    type(c_ptr),intent(in) :: p
    end function func
end interface

contains

logical function register( callback ) bind(c, name='register')
!DEC$ ATTRIBUTES DLLEXPORT :: register
procedure(func) :: callback
f => callback
register = .true.
end function register

end module test_module

 

VirtualProtect in kernel32.f90

$
0
0

Looking at the version of kernel32.f90 in C:\Program Files (x86)\Intel\Composer XE 2015\compiler\include

INTERFACE
FUNCTION VirtualProtect( &
        lpAddress, &
        dwSize, &
        flNewProtect, &
        lpflOldProtect)
import
  integer(BOOL) :: VirtualProtect ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'VirtualProtect' :: VirtualProtect
  integer(LPVOID) lpAddress ! LPVOID lpAddress
  integer(SIZE_T) dwSize ! SIZE_T dwSize
  integer(DWORD) flNewProtect ! DWORD flNewProtect
  integer(LPDWORD) lpflOldProtect ! PDWORD lpflOldProtect
 END FUNCTION
END INTERFACE

 

And then the version in C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.3.210\windows\compiler\include

INTERFACE
FUNCTION VirtualProtect( &
        lpAddress, &
        dwSize, &
        flNewProtect, &
        lpflOldProtect)
import
  integer(BOOL) :: VirtualProtect ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'VirtualProtect' :: VirtualProtect
  integer(LPVOID) lpAddress ! LPVOID lpAddress
  integer(SIZE_T) dwSize ! SIZE_T dwSize
  integer(DWORD) flNewProtect ! DWORD flNewProtect
  integer(DWORD) lpflOldProtect ! PDWORD lpflOldProtect
  !DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpflOldProtect
 END FUNCTION
END INTERFACE

 

Running a 64-bit executable, the call in the older ifort version succeeds.  The call in the newer version fails.  May I suggest, from:

 

https://msdn.microsoft.com/en-us/library/windows/desktop/aa366898(v=vs.85).aspx

 

That the correct declaration should be:

 

INTERFACE

FUNCTION VirtualProtect(

. lpAddress,

. dwSize,

. flNewProtect,

. pflOldProtect)

import

integer(BOOL) :: VirtualProtect ! BOOL

!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE :: VirtualProtect

!DEC$ ATTRIBUTES ALIAS:'VirtualProtect' :: VirtualProtect

integer(LPVOID) lpAddress ! LPVOID lpAddress

integer(SIZE_T) dwSize ! SIZE_T dwSize

integer(DWORD) flNewProtect ! DWORD flNewProtect

integer(PDWORD) pflOldProtect ! PDWORD lpflOldProtect

END FUNCTION

END INTERFACE

Intel Fortran Compilers

$
0
0

Could you tell me from where I can download a copy of Visual Studio 2008 with Intel Fortran Compiler 11.1.067, (w_cprof_p_11.1.067.exe) ?

LINK2019 LNK1120

$
0
0
good evening everyone ,
I program using intel visual fortran
(xe2018) with visual studio 2015 company, in my program I want to create a windows application and thus modify the menu bar according to my needs, and that by using (logical (4) initialsetting ()) As soon as I run my program, it shows me:
- fatal error lnk1120 : unresolved external

- error lnk 2019 : unresolved external symbol _main_refercened in function _main                libifcoremt.lib(for_main.obj) 

please help me to solve this problem 

AREZKI

 

error LNK2005 Fortran/C++

$
0
0

Hello,

I have a Visual Studio Solution which should create a DLL. It consists of a Fortran part and a part written in C++ in two seperate projects. The Fortran Source Code is calling C++ functions. When I try to build it, I get the following message:

error LNK2005: _powf already defined in libmmt.lib(powf_iface_c99.obj)

From my understanding this means that the powf is defined more than one time, therefore it is not clear which function really should be called.

Some more information:

- When I build it on "Release" it works.

- I was reading that this error can be cause of different floating point models. So I made sure that those models are set to the same option in every project (Fortran and C++). https://software.intel.com/en-us/forums/intel-c-compiler/topic/622985

- In the C++-projects I included the librarys <cmath> or <math.h> but got the same error on both includes.

- Both are built with the same Runtime Library. Tried out a couple of possible combinations too.

 

I would be glad for any help

Keeping Console App Window Open After Program Termination

$
0
0

Hello,

I have built a console application using the Visual Fortran compiler with Visual Studio. When my application is terminated (either due to normal termination or due to a fatal error) the console window immediately closes. 

I would like to ask if there is a way to maintain the console window open after the program is terminated. This will be useful for situations where I have abnormal termination. Alternatively, is it possible to duplicate the "screen print" of the console window to a file?

Any help on this will be greatly appreciated.


LINK: fatal error LNK1104: cannot open file 'kernel32.lib'

$
0
0

Has anyone debugged this "kernel32.lib" issue with Intel Parallel Studio XE 2018 and Visual Studio 2017? This showed up in past posts for earlier software versions, but the suggestions do not seem to apply directly to the new versions. We just installed the Visual Studio extensions to get SDK's. Please let me know how to verify that we have installed enough through Visual Studio and how to get the Intel Fortran compiler to recognize these libraries from the command shell.

Has anyone configured Visual Studio Team Service for vfproj?

$
0
0

Hi,

I wonder if anyone has configured Visual Studio Team Service (VSTS) for Visual Fortran Peojects (vfproj)?  If so, on which version of Visual Studio?

I tried VS 2015 with no lock.  Any input would be appreciated.

Andrew

 

Can an integer member of a user-defined type be used as a do-loop index?

$
0
0

I have a user-defined variable that contains an integer component that I want to use as an index for a do-loop. However, this generates the error

Error error #5082: Syntax error, found '%' when expecting one of: =

 

The following is the code fragment:

 

  type :: myvar
     integer(kind = 4) :: i
  end type myvar

  type(myvar) :: a

  do a%i = 1,10
     ! body of loop
  end do
  read *

Does it mean that the use of a%i as an index is illegal or is the compiler not setup to recognize the %.

SubModule with Type-Bound Procedures

$
0
0

Hello Someone,

I wrote a module and its submodule, and defined a type with Bundling procedure in it, but I'll find a link error.

If I use the comment statements, I can run normally. Why is that?

 

The compiler is Intel(R) Visual Fortran Compiler 18.0.1.156[IA-32]

 

Module MyMod

  Implicit None

  Type , public :: T_My

  contains

    Procedure , nopass :: pubName => prvName

    !Procedure , nopass ::  prvName

    !Generic :: pubName => prvName

  End Type T_My

 

  interface

    Module Subroutine prvName()

    End Subroutine prvName

  end interface

End Module MyMod

 

SubModule(MyMod) MyModS

contains

  Module Procedure prvName

    write(*,*) "Hello"

  End Procedure prvName

End SubModule MyModS

 

Program Main

  use MyMod

  Implicit None

  type(T_My) :: my

  call my%pubName()

End Program Main

call a DLL from Fortran - second part

$
0
0

Hi Steve, hi all,

you helped me not long ago for usind the function os_min in a differernt dll. That worked when I added the lib-File of the dll to my project (right click on the project and add) and used

!DEC$ ATTRIBUTES STDCALL :: OS_MIN

(!DEC$ ATTRIBUTES STDCALL, REFERENCE :: OS_MIN, if there were real arguments. not double precision)

in my code

and set the path to the lib.

 

But now (for my next application) I don'thave the lib-file. I tried it directly with the dll-File. But it didn't work.

What I did wrong? Can you help me?

Greetings Olaf

ICE with 2017 U4, x64

$
0
0

The following program triggers an ICE with 2017 U4, Windows x64 configuration.

  1. Does this also occur with later versions of the compiler (we are considering an upgrade)
  2. Any suggestions to work around this?

Thanks!

MODULE M
IMPLICIT NONE
INTERFACE
    MODULE SUBROUTINE SUB(I)
        IMPLICIT NONE
        INTEGER :: I
    END SUBROUTINE SUB
    MODULE SUBROUTINE SET_SUB(USER_SUB)
        IMPLICIT NONE
        PROCEDURE(SUB) :: USER_SUB
    END SUBROUTINE SET_SUB
END INTERFACE
END MODULE M


SUBMODULE (M) SM
IMPLICIT NONE
PROCEDURE(SUB),POINTER :: INTERNAL_SUB  => NULL()
END SUBMODULE SM


SUBMODULE (M:SM) SET_SUB
IMPLICIT NONE
CONTAINS
    MODULE SUBROUTINE SET_SUB(USER_SUB)
        IMPLICIT NONE
        PROCEDURE(SUB) :: USER_SUB
        INTERNAL_SUB => USER_SUB
    END SUBROUTINE SET_SUB
END SUBMODULE SET_SUB


SUBMODULE (M:SM) SUB
IMPLICIT NONE
CONTAINS
    MODULE SUBROUTINE SUB(I)
        INTEGER :: I
        CALL INTERNAL_SUB(I)
    END SUBROUTINE SUB
END SUBMODULE SUB

 

Interface to C function

$
0
0

Greetings,

I have acquired a third-party C function that I would like to use, but I can't get the linker to find it presumably because my interface is wrong - and it obviously is wrong too.

The start of the C function and its dummy arguments are:

#define PATH_MAX 200
#include <stdio.h>
#include <windows.h>
#include <shlobj.h>
#ifdef __cplusplus
extern "C" {
#endif
   int OpenAFolder(HWND hWnd, char dir_sel[PATH_MAX + 1], char *dir_org)
   {

and my attempt at an interface is:

interface
    logical*4 function OpenAFolder(hDlg,browsedFolderpath,initdir)
    !DEC$ ATTRIBUTES C	::	OpenAFolder
	
    integer(4)        hDlg 
    character(200)		browsedFolderpath,initdir

    !DEC$ ATTRIBUTES REFERENCE	::	hDlg,browsedFolderpath,initdir
	
    end function OpenAFolder
end interface

 

Would much appreciate some help in getting that interface right. Many thanks in advance.

Mike


Most appropriate combination of Visual Studio and Intel Parallel Studio XE

$
0
0

I bought a new desktop running Windows 10 and have to set up  the proper Microsoft Visual Studio and Intel Parallel Studio XE versions. The Fortran modules also call subprograms from the graphics library Winteracter V12.

Intel Parallel studio files (with valid license):
parallel_studio_xe_2018_composer_edition_setup.exe, up to update 3
parallel_studio_xe_2017_composer_edition_setup.exe, up to update 6
parallel_studio_xe_2016_update5_composer_edition_setup.exe

Microsoft Visual Studio:
VS 2017: vs_community__712061580.1531306644.exe
VS 2015: vs_community.exe
VS 2013: vs_community.exe, VS2013.5.exe
VS2012: VS2012.5.exe

My first intention was to use the latest versions of VS (2017) and Parallel Studio XE (2018), but that was not succesful. I got peculiar messages I was not able to interpret. So I would appreciate advice from more experienced users auf Parallel Studio which combination of VS and IVF is most appropriate and, if possible, works smoothly without further fiddling around. Thanks in advance for your help.

 

Redirecting input when using WinApi

$
0
0

Hello,

this is somewhat of a continuation of an issue that I've had here, which was very helpfully solved.

now I've ran into an issue where I need to call an executable and redirect the input.

Previsouly it was done via:

CALL SYSTEM('C:\DATA\Executable.exe < Instruction.txt')

Calling an executable is not an issue, I've found some examples out there for CreateProcess winapi and it works fine. Below is a sample code that I've adopted.

  SUBROUTINE ExecuteProgram(CommanLine)

  USE KERNEL32

  IMPLICIT NONE

  CHARACTER(LEN=*), INTENT(IN)   :: CommanLine
  INTEGER                        :: rval

  TYPE(T_STARTUPINFO)            :: si
  TYPE(T_PROCESS_INFORMATION)    :: pi

  CALL ZeroMemory (LOC(pi), SIZEOF(pi))
  CALL ZeroMemory (LOC(si), SIZEOF(si))
  si%cb          = SIZEOF(si)
  si%dwFlags     = STARTF_USESHOWWINDOW
  si%wShowWindow = SW_SHOWNORMAL

  IF (CreateProcess (NULL,     &! process name
  CommanLine,                    & ! command line
  NULL_SECURITY_ATTRIBUTES,    & ! security attributes
  NULL_SECURITY_ATTRIBUTES,    & ! thread attributes
  FALSE,                       & ! handle inheritance
  0,                           & ! creation flags
  NULL,                        & ! environment block
  NULL,                        & ! initial working path
  si,                          & ! startup info
  pi) ) THEN                     ! process info
    rval = WaitForSingleObject (pi%hProcess, INFINITE)
    rval = CloseHandle (pi%hProcess)
    rval = CloseHandle (pi%hThread)
  END IF

  END SUBROUTINE ExecuteProgram

Now how on earth can I redirect input?

Thanks in advance!

Reading an unformatted file from Java

$
0
0

Hello folks,

for a compatibility matter I want to read a fortran unformatted file with another language (here java)

But I read a lot of documentation on this subject, and it seems that this file has very specific format that I quite don't get.

	REAL(8) :: test
	test = 23.1
	OPEN(234, FILE="unformatted1.txt", FORM='UNFORMATTED', STATUS='REPLACE') !ATTENTION, on remplace le fichier s'il est déjà ouvert par qqn d'autre !!!
	WRITE(234) test
	CLOSE (234)

When I read this output file with java, I get [4, 0, 0, 0, -51, -52, -72, 65, 4, 0, 0, 0]

In this piece of code, I just want to write a real*8. Question is, what's really written in the output file ? What should I try to read ? bytes ? Shall I find a header/footer ? How do I retrieve my value from this. If I can...

 

Thanks !

Problem with VS Release 15.8.0

$
0
0

Colleagues,

Is anyone (else) having problems with VS Release 15.8.0?  One of our team installed that update this morning and now any attempt to display elements in an array variable in debug mode (hover with the mouse, click on the expand arrow) crashes VS -- brings it down completely.

 

Iterative Sparse Solvers based on Reverse Communication Interface (RCI ISS)

$
0
0

Dear Sir/Madam,

I am grateful for the development of Intel Visual Fortran Compiler for Windows. It helps my work a lot.

I would like to ask about RCI ISS in the newest Intel MKL solver. I know that in Intel MKL, there is an RCI conjugate gradient solver.  

Hence, does it work well with EBE-PCG (element by element preconditioner conjugate gradient) method or can I build my code for EBE-PCG method using Intel MKL solver? 

Thank you very much!

Tien-Dat

Viewing all 5691 articles
Browse latest View live


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