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

VS 2015

JohnNichols
Valued Contributor III
685 Views

Steve:

I am a bit lost. I pulled off all of the INTEL Compilers, and then installed VS2015 - Community Edition - with what I thought was everything turned on. I then added the NEW BETA and tried out a program with DISLIN library from Germany.

Exactly the same project runs perfectly on VS2013, but I get C++ errors on compile, cannot find scanf etc on VS2015.  Clearly I goofed but where

Every program that does not have DISLIN runs perfectly the same on both Studios.

Thanks

John

0 Kudos
20 Replies
Steven_L_Intel1
Employee
671 Views

Rerun the VS2015 install, select a custom install and check the box for C++.

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Rerun the VS2015 install, select a custom install and check the box for C++.

Steve:

Uninstalled IVF BETA and VS 2015. Cleaned out everything, reinstalled VS 2015 every switch selected 31 GB - made sure C++ selected then put on the last IVF 16? and still get the scanf error on compile.

Another program has this error see picture  -- it get upset at a return from a FFT subroutine - when I turn on cpu_time routine

 

    !  Wulf.f90
    !
    !  FUNCTIONS:
    !  Wulf - Entry point of console application.
    !

    !****************************************************************************
    !
    !  PROGRAM: Wulf
    !
    !  PURPOSE:  Entry point for the console application.
    !
    !****************************************************************************

    program Wulf
    use BASE
    use FastFourierTransform
    use S
    use Scotia

    implicit none
    integer i,ISTAT,count, dummy, NG
    REAL (KIND=dp) time
    complex(kind=dp), ALLOCATABLE :: X(:)
    REAL (KIND=dp), ALLOCATABLE :: aXYZ(:,:)



    call Files(1,NG)
    read(sRA,*)count

    ALLOCATE (aXYZ(count1,count),X(NFA),STAT=istat)
    IF (istat.NE.0) THEN
        WRITE (*, *) '*** Could not allocate some arrays in WULF'
        STOP
    END IF

    time = 0.1d0


    do i =1,NFA
        if(i .eq. 1) then
            x(i) = (0.70154d0,0.0d0)
        elseif(i .eq. 2) then
            x(i) =(-2.5018d0,0.0d0)
        elseif(i .eq. 3) then
            x(i) = (-0.35385d0,0.0d0)
        elseif(i .eq. 4) then
            x(i) = (-0.82359d0,0.0d0)
        elseif(i .eq. 5) then
            x(i) = (-1.5771d0,0.0d0)
        elseif(i .eq. 6) then
            x(i) = (0.50797d0,0.0d0)
        elseif(i .eq. 7) then
            x(i) = (0.28198d0,0.0d0)
        elseif(i .eq. 8) then
            x(i) = (0.03348d0, 0.0d0)
        end if
    end do

    call pardiso_unsym(aXYZ,count,1)
    call FFT(sm, SOUT, NFA, time, X)
    
    
    end program Wulf


    

 

Capture_0.PNG

0 Kudos
JohnNichols
Valued Contributor III
671 Views
Module FastFourierTransform
    
    contains
    
    Subroutine FFT(File1, FileOut, N, time, X)
    ! Fortran example.
    ! 1D complex to complex, and real to conjugate-even
    Use MKL_DFTI
    
    implicit none
    integer n
    integer FileOut
    Double Complex :: X(n), XC(N)
    Double precision :: Y(n), U,  SUM, DF, W, SUMW
    Double precision :: YStart, time, FFTRatio
    integer i,j, File1
    type(DFTI_DESCRIPTOR), POINTER :: My_Desc1_Handle, My_Desc2_Handle
    Integer :: Status
    
    
    !...put input data into X(1),...,X(32); Y(1),...,Y(32)
    ! Perform a complex to complex transform
    j = 1
    YStart = 0.0d0
    FFTRatio = time
    DF = 1.0d0/(time*dfloat(n))
    sum = 0.0d0
    sumw = 0.0d0
    
    do i =1,N
        y(i) = real(x(i))
        write(*,*)i,x(i)
    end do
    Status = DftiCreateDescriptor( My_Desc1_Handle, DFTI_DOUBLE,DFTI_COMPLEX, 1, N )
    Status = DftiCommitDescriptor( My_Desc1_Handle )
    Status = DftiComputeForward( My_Desc1_Handle, X )
    Status = DftiFreeDescriptor(My_Desc1_Handle)
    
    do i =1,N
        x(i) = FFTRatio*x(i)
        XC(i) = CONJG(x(i))
        U = x(i)*xc(I)
        sum = sum+U*df
        sumw = sumw+(y(i)*y(i))*time
         write(FileOUT,10)i,(real(x(i))),aimag(x(i)),y(i),sum,sumw
10       format(i5,",",F14.8,",",F14.8,",",F14.8,",",F14.8,",",F14.8)
    end do
    ! result is given by {X(1),X(2),...,X(32)}
    ! Perform a real to complex conjugate-even transform
    Status = DftiCreateDescriptor(My_Desc2_Handle, DFTI_DOUBLE, DFTI_REAL, 1, N)
    Status = DftiCommitDescriptor(My_Desc2_Handle)
    Status = DftiComputeForward(My_Desc2_Handle, Y)
    Status = DftiFreeDescriptor(My_Desc2_Handle)
    ! result is given in CCS format.
    return
    end subroutine FFT
    END module

 

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Routine that does not return.

0 Kudos
Steven_L_Intel1
Employee
671 Views

You've described at least two different issues. One is a linking (not compile) error looking for a C library routine scanf. Please upload a ZIP of the buildlog.htm of a complete project rebuild showing these errors.

The stack corruption error indicates a bug in your program. .T31_ is a compiler-generated temporary, so that complicates diagnosis a bit, but it would help if you could identify the line of code where this error occurred. 

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Build is VS 2015

Build(2) is VS 2013

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Steve Lionel (Intel) wrote:

You've described at least two different issues.

Two issues -- I am a bit wary of typing a note and it disappears into your system as just occurred with the build - new forum topic I created.

0 Kudos
JohnNichols
Valued Contributor III
671 Views

WULF

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Steve:

WULF is the program with the strange return.

The call to FFT from the main program never returns. If you look you can see the write(*,*)'Here"

in that routine. If I take out the return it halts normally.

I can debug on the return and it stops and says I am here. But nothing after that in the main routine every works

John

0 Kudos
Steven_L_Intel1
Employee
671 Views

For your link errors -  the errors are caused by inconsistent run-time library settings between your Fortran code and the dislin.lib library, which is apparently written in C. Change the Fortran project property Fortran > Libraries > Use Runtime Library to "Multithread DLL (/MD)" and relink.

My guess is that your MKL program corrupts the stack somewhere. I will see if I can reproduce the problem.

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Steve:

It was VS2015 - I got rid of it and reverted to VS2013 and all is fine

Ah.............. cannot seem to escape the 13

John

0 Kudos
Steven_L_Intel1
Employee
671 Views

John, what do I enter as input to the program?

0 Kudos
Steven_L_Intel1
Employee
671 Views

I think your problem with VS2015 is a change Microsoft made in the C library for that version. It isn't a Fortran issue.  See https://msdn.microsoft.com/en-us/library/bb531344.aspx#BK_CRT

0 Kudos
JohnNichols
Valued Contributor III
671 Views

The input file is at.inp

You merely type AT at the file input and it looks after it from there. 

I will tell the DISLIN guy he has a problem - VS 2015 I cannot use.

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Just type

AT

at the input line and it will find the AT.inp file

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Sorry for the two - thought I lost it

There is a reason to hate C++

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Evgueni Petrov aka espetrov (Intel)

0 Kudos
Andreas_Z_
New Contributor I
671 Views

Hi John,

You may have run into an issue with linking to the DISLIN library from VS 2015. I used to have similar issues when I switched to VS 2015 community edition a year ago. This is not a Fortran problem. Most of the DISLIN library files were updated recently to work fine with the VS 2015 - perhaps you need to update your version of DISLIN. Otherwise, see related issues reported on the DISLIN user group forum (https://groups.google.com/forum/#!forum/dislin-users ), where you should get the support to get your program to link correctly.

Andi

0 Kudos
JohnNichols
Valued Contributor III
671 Views

Andi:

I updated the DISLIN version and reinstalled everything to try and get around the error.

Simplest just to remove VS2015 and use 2013 - not enough changes in VS to warrant the change.

Thanks for the web site.

I also run the latest Windows 10 Fast ring build, it could be something in there and I was using the Intel Review - life is to short to worry about this

Ta

John

 

0 Kudos
Steven_L_Intel1
Employee
588 Views

The issue with the MKL calls and stack corruption is continued in https://software.intel.com/en-us/node/635264

0 Kudos
Reply