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

Annoying warning #8753

$
0
0

Since I use the 2013 Fortran compiler I get an annoying warning:

warning #8753: A CHARACTER component of an interoperable derived type must have length 1.

It is caused by following type which is an equivalent to a simple C data structure of a DLL:

type, bind(C) :: MDSLConfigA
    character(MDSL_APPNAME_LEN, C_CHAR) :: szAppName   
    character(MDSL_MAXPATH_LEN, C_CHAR) :: szLocalPath 
    character(MDSL_MAXPATH_LEN, C_CHAR) :: szGlobalPath
    character(MDSL_MAXPATH_LEN, C_CHAR) :: szHelpFile  
    integer(C_INT)                      :: iLangID     
end type MDSLConfigA
typedef struct MDSLConfigA_ {
    char    szAppName[MDSL_APPNAME_LEN];
    char    szLocalPath[_MAX_PATH];    
    char    szGlobalPath[_MAX_PATH];   
    char    szHelpFile[_MAX_PATH];     
    int     iLangID;                   
} MDSLConfigA;                         

Is there a way to disable the warning or to avoid it?

Thanks in advance for all comments.

 


fatal error LNK1104: cannot open file 'ifconsol.lib

$
0
0

Hello:

I have installed the 30-day trial Intel Parallel Studio XE Composer.  I also installed Microsoft Visual 12. I am new to using a compiler.  I am new at troubleshooting issues concerning computers.  I am a new beginner at using Visual C++ or fortran.  I have read other forum entries to learn about similar situations.   I have had IT support for these types of projects at school or work.  Expect, I am trying to install on my home computer with the hopes of using a compiler.  I am trying to compile a ANSYS fortran user subroutine using these products.  I keep getting the following error: LINK: fatal error LNK1104: cannot open file 'ifconsol.lib'.  I have located the file at this location: C:\\Program Files (x86)\Intel\Composer XE 2015\ compile\lib\intel64

I would like to have some success with this product.  But, so far the trial product is very hard to get configured for use.

Can someone help me with this error.

Regards,

Julie D

IFLOGM dialog scroll bar position problem

$
0
0

I was making an update to my last remaining program that uses IFLOGM for dialogs rather than the Windows SDK. Consider the small routine below which gets the handle for a list box on a modeless dialog, gets the min / max range of the vertical scroll bar and then sets the current position to the max position such that you can see the info that has been put there.

This works fine in that the 'get' returns the correct values, and 'set' returns with the correct position before the update, however irrespective of where the slider thumb was or has been set to the dialog is always then displayed with the thumb moved to position zero. IE my set has no effect. 

Is my code wrong? Is it just a 'feature' of the IFLOGM implementation of dialogs? Is there a simple alternative method?

Any ideas would be appreciated. Best Regards, Andrew 

subroutine update_scroll_pos()
    use             :: ifwin, only: bool, LPINT, GetScrollRange, TRUE, SetScrollPos, &
                                    SB_VERT, SINT, GetDlgItem, handle, SB_CTL
    use             :: dku, only: gdlg, IDC_LIST_MESG
    use, intrinsic  :: iso_c_binding, only: c_loc
    implicit none
    integer(handle) :: Hwnd
    integer(bool)   :: bret
    integer         :: ipmin, ipmax
    integer(SINT)   :: ipos
    hwnd = GetDlgItem(gdlg%hwnd,IDC_LIST_MESG)
    bret = GetScrollRange( Hwnd, SB_VERT, &
                           transfer(C_loc(ipmin),hwnd),&
                           transfer(C_loc(ipmax),hwnd)     )
    if(bret /= 0) ipos = SetScrollPos( Hwnd, SB_VERT, int(ipmax, sint) , TRUE )
end subroutine update_scroll_pos 

 

Read hex byte into character(1)

$
0
0

I have a character variable of length 2, eg ch2 = '4f', which I want to read into a character variable of length 1, ch1, which must contain the ASCII representation of the 2-char string, ie. Z'4f' ie. ch1='O'.  Is there an elegant way to do this in a READ / FORMAT statement?  Something like read(ch2,'(z2)') ch1?

demo code specifically dll_shared_data

$
0
0

I recently downloaded composer edition XE 2015 update 2 for trial and I am trying to get 2 programs to share data, I have tried several things that I saw online to accomplish this, the 2 programs both will link but they do not share the data (i.e. the variable has one value in one program and a different value in the other)... I specifically have been trying a dll and the !DEC$ ATTRIBUTES DLLEXPORT (and DLLIMPORT) method 

I see there is a sample program called dll_shared_data taht is supposed to illustrate this functionality, but this solution does not appear to be included in what I downloaded... can anyone post this code snippet or tell me where it is available?

Thanks

15.0.2.179 and Multithread libraries problem

$
0
0

Hello,

Today I started to have a problem when trying to run my code.
The code must read an HDF5 file and at some point, return the biggest value on one specific dataset.

The dataset is set to 0.0 on all its values, but the value found was much bigger.

I try to run the code in DEBUG to find the error, as there was some changes in the code since the last time I compiled, but in DEBUG, the error goes away.
I thought that could be a problem with OpenMP, so I disabled the OpenMP on Release mode. But the error was still there.
After many tests, I could determine that the error only happens when I use the Multithread option in the Compiler Runtime Libraries. Even in Release Mode, if I change it to Debug Multithread, the program seems to works as supposed, like when in Debug mode.

Could you give me some advice on how to look to this problem?
I'll try to compile the code without changes and than add the different pieces of code until I find the culprit, but I would like to know if a broken code could cause a problem when using the Runtime Multithread libraries without cause the same problems when using the Debug Multithread runtime libraries.
 

Thanks for your time :)
Eduardo

error #8055

$
0
0

Error 8055 occurred in my code.

program main
    integer,allocatable::a(:)
    integer n
    n=4
    allocate(a(n))
    call func(a,n)
    endprogram

    subroutine func(a,n)
    integer n
    integer,target::a(n)
    a(1)=1
    endsubroutine

Error    1     error #8055: The procedure has a dummy argument that has the ALLOCATABLE, ASYNCHRONOUS, OPTIONAL, POINTER, TARGET, VALUE or VOLATILE attribute. Required explicit interface is missing from original source.   [A]   

The above is just demonstration I wrote for my original code.

 

Equivalent function NCONF/NLQPL

$
0
0

hello folks!

I am looking for an equivalent function to NCONF/DNCONF which has been defined in the IMSL library. Here is the description of this function:

Solve a general nonlinear programming problem using the successive quadratic programming algorithm and a finite difference gradient.

Call NCONF (FCN, M, ME, N, XGUESS, IBTYPE, XLB, XUB, XSCALE, IPRINT, MAXITN, X, FVALUE)

In nutshell, I have to minimize a multi-variable function knowing that one (or more) condition have to be accomplished.

Thank you in advance.

 


What is the effect of indirect recursion on ELEMENTAL procedures, especially finalizers?

$
0
0

The following simple code involving a linked list compiles with no errors or warnings with compiler 2015, update 2.  It seems to execute without any run-time exceptions as well.

However, you will notice the code in module m invokes a finalizer for the derived type for linked list (node_t) that has indirect recursion via clear_node_t; this is to work around the restriction in the standard that both RECURSIVE and ELEMENTAL attributes cannot be applied with subroutines.

What are the risks associated with such a workaround?

Colud the compiler do a static allocation (non-automatic) for allocatable array foo in program p and could the indirect recursion then possibly lead to a failure of some sort under some circumstances?  Note, however, I have not noticed any such issues - no memory leaks are detected nor any other run-time exceptions; I tried /heaparrays0 also.

module m

   implicit none

   private

   type, public :: node_t

      private

      type(node_t), pointer         :: m_child => null()
      character(len=:), allocatable :: m_key

   contains

      private

      procedure, pass(this) :: clear => clear_node_t
      final :: clean_node_t

      procedure, pass(this), public :: put => put_node_t

   end type node_t

contains

   recursive pure subroutine put_node_t(this, key)

      class(node_t), intent(inout) :: this
      character(len=*), intent(in) :: key

      if (allocated(this%m_key)) then
         if (this%m_key /= key) then
            if (.not. associated(this%m_child)) then
               allocate(this%m_Child)
            end if
            call put_node_t(this%m_Child, key)
         end if
      else
         this%m_key = key
      end if

      return

   end subroutine put_node_t

   pure recursive subroutine clear_node_t(this)

      class(node_t), intent(inout) :: this

      if (allocated(this%m_key)) then
         deallocate(this%m_key)
      end if

      if (associated(this%m_child)) then
         deallocate(this%m_child)
         this%m_child => null()
      end if

      return

   end subroutine clear_node_t

   pure elemental subroutine clean_node_t(this)

      type(node_t), intent(inout) :: this

      call clear_node_t(this)

   end subroutine clean_node_t

end module m
program p

   use m, only : node_t

   implicit none

   type(node_t), allocatable :: foo(:)
   integer :: istat

   allocate( node_t :: foo(2), stat=istat)
   if (istat /= 0) then
      print *, " istat = ", istat
      stop
   end if

   call foo(1)%put("red")
   call foo(1)%put("green")

   call foo(2)%put("circle")
   call foo(2)%put("triangle")

   deallocate(foo, stat=istat)
   print *, " deallocate(foo): istat = ", istat

   stop

end program p

 

I understand Fortran 2015 lifts the restriction on RECURSIVE and ELEMENTAL but that is for the long-term.  With the current standard, is such an indirect recursion a concern?  If yes, is there any way to make the coder aware of it?

Thanks,

     

Help system in VS2012 screwed up?

$
0
0

I have Intel Fortran Composer 2015.2.179 installed in VS2012 pro.

I an not a regular user and have not used it for a while and on opening it and hoping to do a Help search for help on some Windows API functions,
I find I can only select Intel Compiler and Libraries help and its search is restricted to Fortran stuff. If I type in 'SendMessage' or any other Windows API function name or Windows resource name I get a null return.

I recall in the past having access to a much wider search ability, so I am wondering if my help system has been screwed up since I installed the latest composer version.

I recall in the past being able to choose the help system before, but that option appears to be missing from the Help menu in VS2012 now.

Please can you update me on how I might be able to merge the Intel Fortran help with the wider API help that typically was available in the old Visual Studio Compaq Visual Fortran Help.

AttachmentSize
DownloadVS2012HELP.bmp5.49 MB

Command prompt and Visual Studio 2010

$
0
0

I downloaded Intel Parallel Studio XE 2015 composer edition for Fortran, evaluation 30 days.

My OS is Windows 8.1.

I cannot find the path to the command prompt with intel compiler (both IA-32 and Intel 64) along with Microsoft Visual Studio 2010 Shell.

Any help would be highly appreciated, thanks!

 

XE 2015 Installer has no options

$
0
0

The latest installer no longer gives us options for which version of Visual Studio to install on. In fact it presents no options at all.

VS version was a useful feature because it allowed me to maintain old and incompatible compiler versions on older VS versions, keeping separation without needing multiple workstations.

When will we get better support for older compiler versions, such as being able to set compiler version as a solution property rather than a Visual Studio property ?

How to convert an O file to fortran source file

$
0
0

Hi all,

I have received from somebody else a Fortran object file (created under Linux). Can I convert it back to the source file? (I have Windows 7)

OpenMP: Loops are not parallelized

$
0
0

Hi 

I'm writing a Fortran-Program with Open-MP. 

!$OMP PARALLEL
!$OMP DO PRIVATE(j)
       DO I=1,10
          j = aIndex(I)
          ...
          VALUES(j) = ...
       END DO
!$OMP END DO
!$OMP END PARALLEL

The compiler refuses to parallelize this:

OpenMP Construct at file.for(2255,7)
   remark #16201: OpenMP DEFINED REGION WAS PARALLELIZED
...

LOOP BEGIN at file.for(2258,7)
   remark #17104: loop was not parallelized: existence of parallel dependence
   remark #15300: LOOP WAS VECTORIZED
LOOP END

Actually I *do* know, that aIndex contains only different indexes. Therefore the loop *can* be parallelized.

Is there any way to overrule the compiler? In OpenACC for example I could write

!$acc loop independent private(j)

Thanks

Benedikt

Downgrade Rights?

$
0
0

Dear All,

Firstly, apologies for my naivety - I'm not familar with Fortran products. I've been placed in charge of finding out some information regarding software we need to use on a current project.

We currently have a license for Intel Visual FORTRAN Studio XE (v2013) - we need to use an older version of this software for the project, namely version: Intel Visual FORTRAN Standard Edition (v10.1).

Is this possible with the license we have?

Any help is greatly appreciated.

Thanks in advance,

Jake Bloomfield


Go To Definition and type-bound procedures

$
0
0

Steve,

By the way, you may have noticed "Go To Definition" doesn't fully work with type-bound procedures: for example, if one right-clicks on bar in line 6 in the snippet below, it will be really great if the cursor jumped to the definition of bound procedure (possibly a rename or a generic) of bar in type t in module m!  Right now, it doesn't seem to do anything.

   ..
   use m, only : t
   ..
   type(t) :: foo
   ..
   call foo%bar(..)
   ..

Possibly a difficult feature to implement, but it will be cool if available!

Pointer association and red-black trees

$
0
0

I'm trying to implement a red-black tree in Fortran. Rather than starting from scratch I'm translating some c-code I found on the internet. Both the original code and my Fortran versions are attached together with a Makefile; the c version works as I expect.

The problem I'm having is that line 373

            newn%parent => oldn%parent

seems to corrupt the contents of oldn but not on the first invocation. Tested with 14.0.1.139.

Is this a compiler bug, a typo in my code or something else. I've been thinking about this all afternoon and just can't see what the problem is. Any help greatly appreciated.

Simon

AttachmentSize
Downloadrbtree.tgz7.01 KB

Error# 6634 and 8284 and 7710

$
0
0

I will start with I am new to Fortran and to this forum so if there are any suggestions. Thanks in advance.  

My issue I that I keep coming across is error 6634 and 8284 when trying to use subroutines that operate on element operations.  I have created a simple routine to hopefully illustrate my problem as my code is too large to include. 

I have also included my workaround for Error 7710 related to passing a section of an array and wanted to know if there is a better workaround or best practice?

 

    program Test_Scale_Array

    implicit none

    ! Variables
    REAL(KIND=8), Dimension(:), Allocatable :: var3
    REAL(KIND=8), Dimension(1:10)           :: var2,exponent
    REAL(KIND=8)                            :: var4
    integer,      Dimension(5)              :: x
    integer                                 :: i

    ! Body of Test_Scale_Array
    var2     = 4.0D0
    var4     = 4.0D0
    exponent = 2.0D0
    !have routine that is meant mostly for this
    call simplesquare(var2,exponent)

    !Gives Error 8284 & 6634
    call simplesquare(var4)

    !Gives Error 6634
    call simplesquare(var2(2),exponent(2))


    !Selection and calculation on a portion of array
    x = (/(2*i,i=1,5)/)

    !Gives error #7710
    call simplesquare(var2(x))

    !Is there a faster/better way for the workaround?
    Allocate( var3(1:5) )
    var3 = var2(x)
    call simplesquare(var3)
    var2(x) = var3
    deallocate( var3 )

    contains

    subroutine simplesquare(x,y)
    ! Variables
    REAL(Kind=8), Dimension(:), INTENT(inout) :: x
    REAL(Kind=8), Dimension(:), OPTIONAL      :: y

    ! Body of simplesquare
    if (present(Y)) then
    x = x**y
    else
    x = x**2
    endif

    end subroutine simplesquare

    end program Test_Scale_Array
    

Thanks

Jim

Unhelpful error message array section assignment

$
0
0

I am attempting to assign an array section, e.g.

X(1:N) = Y(1:N)

In the situation that Y has not been declared, the compiler only seems to look at the RHS of the statement, and so assumes that Y is intended to be of CHARACTER type, failing to recognize that the notation also could be an array section.  Since the destination is an array section, then error message 6514 is misleading.

Error 1  error #6404: This name does not have a type, and must have an explicit type.   [UNDECLAREDVAR] C:\Open\kwc54dw\Dev\Winyldmd\trunk\ymd_commands\Show_Stage.f90 107 
Error 2  error #6514: A substring must be of type CHARACTER.   [UNDECLAREDVAR] C:\Open\kwc54dw\Dev\Winyldmd\trunk\ymd_commands\Show_Stage.f90 107 
Error 3  error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands.   [UNDECLAREDVAR] C:\Open\kwc54dw\Dev\Winyldmd\trunk\ymd_commands\Show_Stage.f90 107 
 

Pass vector by value?

$
0
0

Dear Intel FORTRAN Support,

I am using Intel Visual FORTRAN Composer XE 2011 on Windows 64-bit.  I would like, if possible, to be able to pass a vector into a subroutine by value as opposed to reference.   I would like to know if there is a way of doing this like in C, i.e., being able to control passing by reference or by value.  From what I have read, it appears that for scalars, I can use the VALUE attribute but this is not valid for arrays.  Is there a way of using the C bindings as a work around to this?

Now, that said, if one can pass by value, is the compiler creating a work array in memory to store a copy of what is being passed?  Would I "save any memory" passing by value as opposed to making a work array copy and passing that as opposed to my actual array?

Thank you very much for your help.

Sincerely,

David

 

 

Viewing all 5691 articles
Browse latest View live


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