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

Convert array of objects into array of properties

$
0
0

Say I have an array of class People called Employees,

ArrayOfEmployedAtAge  = Employees(:)%BirthDate - ArrayOfEmployedDate

The result is

error #6159: A component cannot be an array if the encompassing structure is an array.

 


Problem compiling using a batch file (to create user subroutine for modelling software)

$
0
0

Hi,

In a university project I need to compile fortran codes to create user subroutines which are then used by a modelling software, called Cycle-tempo. Cycle-tempo provides a compile.bat file which can be used for compiling fortran codes and create a UserSub.exe, but certain modifications have to be made in it to set up the actual user environment (see my version attached). Two other files, WinTempo.lib and WinTempo.res, are also provided to be used for the compiling.

I use Parallel Studio XE 2015 Update 6 with VS 2015 running on 64 bit Windows 10. I called the modified batch file from IA-32 command prompt, but then got the following error message:
"WinTempo.lib(WinTempo.obj) : error LNK2019: unresolved external symbol _M_LICENSE_mp_CHECKLICENSE referenced in function _WinMain@16"

I also tried to modify the batch file to use the intel64 compiler and then call it from the intel64 command prompt:
"WinTempo.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'"

I looked up these error messages but could not figure out a solution. I was also going over the Cycle-tempo compiling instructions again, searched similar topics here, but the problem is still not solved. I am not even sure whether ia32 or intel64 I should use.
Please note that I am quite new to VS and Parallel Studio, any help/suggestions are welcome!

Thanks in advance!
Csaba

Thread Topic: 

Help Me

Fortran 11 and probable 2003 compatibility issue

$
0
0

Hi

I'm using Intel Fortran 11 to create a Fortran-Call-C piece of code

I have problem when passing arguments by value from Fortran to C, and I was wondering if this may come from 2003 support issues in ifort 11

The fortran sends a single argument by value

ival=1 in CALL  p_f_i_AMETest(ival)  

but the C function get the adress instead of the value, and print

ival =1703488 in void AMETest(int ival) 

 

many thanks for any tips !!

Laurent

 

 

This is my code

TestDLL.cpp

extern "C" TESTDLL_API void AMETest(int ival) {

    printf("ival =%d\n",ival);

};

 

Main.f90

PROGRAM main
        !DEC$ REAL:8
        USE DLLinterface

        CHARACTER*200:: dllname = 'TestDLL.dll'

        Call Test(dllname)

END PROGRAM

 

DLLinterface.f90

MODULE DLLinterface

      USE kernel32

      USE, INTRINSIC:: iso_c_binding


      ABSTRACT INTERFACE
        SUBROUTINE f_i_AMETest(ival) BIND(C,name='AMETest')
            use iso_c_binding, only: c_int
            integer(c_int), VALUE :: ival
        END SUBROUTINE f_i_AMETest
      END INTERFACE


      INTEGER(HANDLE):: handleDLL
      PROCEDURE(f_i_AMETest), POINTER:: p_f_i_AMETest
      TYPE(C_FUNPTR):: p_c_function
      INTEGER(C_INTPTR_T):: addressCpointer
      INTEGER(C_INT):: returnedValue

      CONTAINS
        SUBROUTINE Test(DLLname)

            CHARACTER*200, INTENT(IN):: DLLname
            TYPE(C_FUNPTR):: p_c_function
            INTEGER(C_INTPTR_T):: addressCpointer
            INTEGER(C_INT):: returnedValue
            INTEGER(C_INT):: ival

            ival=1


            handleDLL = LoadLibrary(DLLname)

            IF (handleDLL == NULL) THEN
                WRITE(*,*) 'DLLinterface: could not import the DLL'
            ELSE
                WRITE(*,*) 'DLLinterface: DLL imported'
            END IF
            addressCpointer = GetProcAddress(handleDLL, &'AMETest')

            !cast address to a c fonction pointer, then fortran
            CALL C_F_PROCPOINTER( &
                           TRANSFER(addressCpointer,p_c_function), &
                           p_f_i_AMETest)

            CALL  p_f_i_AMETest(ival)


       END SUBROUTINE Test
END MODULE DLLinterface

 

 

IFORT.EXE not found when using USEENV flag

$
0
0

I am attempting to compile a .VFPROJ file inside of Visual Studio Ultimate 2013 Update 4. When I run VS2013 by typing DEVENV and then build the project, it builds without issue. However, when I run VS2013 by typing DEVENV /USEENV and then build the project, it errors out and says, "The Fortran compiler (ifort.exe) cannot be found." That doesn't make much sense. USEENV brings in the PATH, LIB, and INCLUDE environment variables to use in that session of VS2013. In Solution Explorer, I can click on the Property Manager tab, double-click "Release | x64" (which is the configuration I want), and then click VC++ Environment Variables to see those environment variables I pulled in using USEENV. They all show up as expected. And the second directory listed in my PATH (C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\bin\intel64) is the exact directory that holds the version of IFORT.EXE that I want. Nonetheless, the build fails every time and IFORT.EXE cannot be located. Because of the software that our vendor provides, we have to build using DEVENV /USEENV. Any help would be appreciated!

Intel Visual Fortran V8.1 Compiler for windows 8.0

$
0
0

Hi,

My name is D.SundarChand from Hyderabad,Telangana,India.Originally,I have developed in MS-DOS Fortran 5.0 in 1983.After that I am busy with my Jobs.Now,I am a retired person.That is why I want to update that softwares in to Windows/Visual Fortran environment.I am facing trouble at the time of linking,call color, the below main routine and subroutine color routine from MSFLIB.F90 in the visual Studio Environment of Intel Visual Fortran 8.1 & Microsoft Fortran PowerStation 4.0 the color routine not working and it displays unresolved external symbols _bkcolor,_textcolor. Object file not created due to these 2 errors. How can I solve this problem?I tried in so many ways.but not succeeded.Please help me in this matter at the earliest.I have already developed interface to MS-DOS 5.0 Assembly Language routines to Fortran.But in that also object file not created.Because they are in MS-DOS Assembler 5.0.Only these 2 problems are pending.In assembler it is indicating no errors.but object file not created on windows 8.0 version.

How to resolve these 2 troubles?

I.1.FORTRAN MAIN PROGRAM 

      CALL SETTEXTPOSITION (9,6,XY)

      CALL COLOR (#000000,#00ff00)

      CALL OUTTEXT('Year')

      CALL COLOR (#000000,#00ff00)

      CALL SETTEXTPOSITION (9,48,XY)

      CALL COLOR (#00ff00,#000000)

      CALL OUTTEXT('    ')

      READ (*,010)      YB

 010  FORMAT(I4)

          END

2.FORTRAN SUBROUTINE 

      SUBROUTINE COLOR (K,L)

      USE MSFLIB

      J=SETBKCOLOR(K)

      I=SETTEXTCOLOR(L)

      RETURN

      END

 

Kindly let me know the fault in the Main Program and Subroutine and their corrections.

 

II.1.CURSIZ.ASM
Data    Segment Public 'DATA'
Data    EndS
DGROUP  GROUP Data
Code    Segment 'CODE'
        Assume Cs:Code, Ds:DGROUP, Ss:DGROUP
PUBLIC  CURSIZ
CURSIZ  Proc   Far
        Push Bp
        Mov    Bp, Sp
        Mov Ah, 1
        Les     bx, DWord Ptr [Bp + 10]
        Mov ECH, Es:[Ebx]
        Les     bx, DWord Ptr [Bp + 06]
        Mov ECL, Es:[Ebx]
        Int
        Mov Sp, Bp
        Pop    Bp
        Ret 08
        CURSIZ  EndP
        Code   EndS
End

2.KEY.ASM 

DATA    SEGMENT PUBLIC 'DATA'
DATA    ENDS
DGROUP  GROUP DATA
CODE    SEGMENT 'CODE'
        ASSUME CS:CODE,DS:DGROUP,SS:DGROUP
PUBLIC  KEY 
KEY     PROC   FAR
        PUSH   BP
        MOV    BP,SP
        MOV    AH,0
        INT    
        LES    BX,DWORD PTR[BP+10]
        MOV    ES:[EBX],AH
        LES    BX,DWORD PTR[BP+06]
        MOV    ES:[EBX],AL
        MOV    SP,BP
        POP    BP
        RET    08
        KEY    ENDP
        CODE   ENDS
END

Kindly let me know the fault in the .ASM routines and their corrections.

 

Thanks,

 

with regards,

D.SundarChand

+091-8688568699

sunderchand1957@gmail.com

Zone: 

Thread Topic: 

Help Me

My FORTRAN License is "System Lock"

$
0
0

Hi, I have an Intel FORTRAN compiler licensed via the company I am working for. I installed it in one of my computer. Now, I uninstalled it and am trying to install it onto one of my another computer. However, the new installation can not proceed, as it says the activation right is not allowed. Could someone help me resolve this issue?

I tried to use the online portal https://supporttickets.intel.com/?lang=en-US. But, after clicking the "Request Support" and filling in my information, it always lead back to the same page for filling information. Can someone teach me how to use it?

Thank you so much.

Yili

Do DLL's created still require valid license?

$
0
0

Hi, sorry if this is a dumb question. I have a broken version of Python 2.7 with a horrible mix of VS libraries that I cant debug. I figure what the hey, I'll just rebuild everything from source, including SCIPY, etc, using Visual Studio FORTRAN, C++, MKL, etc. What could go wrong :-)

I have VS 2017 for C++, but and have now just downloaded an evaluation copy of FORTRAN compiler. My assumption is that any Fortran-related DLL's, etc, that get built will all survive the loss of the FORTRAN compiler license (after 30days) , but I wanted to check first.

Thoughts?

Zone: 

Thread Topic: 

Question

Confusion about file formats for Intel Fortran files

$
0
0

I am working on a project that was given to me by someone else. This project contains a ton of .FOR files written in seemingly free- format. Recently I have been studying fortran code formats in a little more detail and came accross this article (https://software.intel.com/en-us/articles/intel-fortran-compiler-effect-...) which states:

".f90 specifies Fortran free-form source and .f, .ftn, or .for specify fixed-form souce"

I don't understand why and how these .FOR files can compile OK if they are written in free form, and if ifort recognizes them as fixed form. Could anyone please fill me in on this? I'm confused...

 


Preprocessor directives not defined?

$
0
0

I am working on an Intel Visual Fortran solution provided to me by a third party. I am trying to gain a deeper understanding of how this solution is built. The .FOR files included within this solution, for several of them contain preprocessor directives such as #ifdef and #else. I understand vaguely what these preprocessors do (test for definition of a macro). I also understand that the tokens used must refer to a pre-existing macro generated using the directive #define. I cannot find this macro defined anywhere in my solution.

I also know that the definitions are somehow linked to the "Debug" and "Release" configuration set-up in Visual Studio, since the Macro names are such things as "Internal Debug" and "Internal Release". 

Where does visual fortran define its preprocessing macros? If it uses a provided construct within Microsoft Visual Studio, where is this construct and how can I manipulate it?

format width control not required in ifort?

$
0
0

I am trying to migrate a .FOR file (for practice purposes) to gfortran. This file compiles in my Intel Visual Fortran solution with no issues. However when I compile it in gfortran I get the following error message:

MyFile.FOR:4561:22:

   102     format(A, I)
                      1
Error: Nonnegative width required in format string at (1)

Does ifort simply not require there to be a format width or are there additional ifort options that enable relaxing this requirement? How come the file runs smoothly in ifort but not in gfortran?

SIZE used on unallocated array

$
0
0

I request a new debugging option to trap this. The current behaviour of Intel Fortran is returning 0 and raising no error. This is probably the worst choice since it often hides the problem.

Zone: 

You do not have permission to moderate...

$
0
0

Getting this for new topic posts

Test topic - please delete me

$
0
0

Just testing the moderation warning

Help! Debug will build and run, but Release won't build

$
0
0

I have a fortran console program which includes two sub projects in C.  The program will build and run in Debug mode, but will not build in Release mode.  Here are the error messages, and I've attached the build log.  I have no idea what the problem is, and I'm hoping someone can tell me what I'm doing wrong.  Thanks.

Warning 5  warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library LINK 
Error 6  fatal error LNK1169: one or more multiply defined symbols found Release/XLTRC2.exe 
Error 4  error LNK2005: _printf already defined in LIBCMT.lib(printf.obj) MSVCRT.lib(MSVCR100.dll) 
Error 3  error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj) MSVCRT.lib(MSVCR100.dll) 
 

AttachmentSize
Downloadtext/plainBuildLog.htm_.txt164.41 KB

SCIGRAPH help

$
0
0

Hi,

In a university project I need to write codes in Fortran to create user subroutines which are then used by a modelling software. One of my tasks is to plot XY graphs. I tried to use SCIGRAPH, but I don't know how to do the plotting, when data are read from file.

I’ve read the manual of it, in which is written, that I have to use the following structure, and I have to add how many points I want to plot:

REAL*4 array(2,7,1) !(seven means, that I want to plot seven x-y points)

DATA array / x1,y1, x2,y2, x3,y3, .....  x7,y7/

To count the number of data (usually it’s unknown) in the used file I wrote a simple program, that works, so I think it isn’t a problem, but I don't know how I should modify the given sample to do the plotting from file.

I would be grateful, if somebody could help me with this problem.

Please consider that I am a beginner programmer, so I’m quite new to VS and Parallel Studio, any help/suggestions are welcome!

Thanks in advance!

Roland

Thread Topic: 

How-To

Help with scigraph

$
0
0

Hi,

In a university project I need to write codes in Fortran to create user subroutines which are then used by a modelling software. One of my tasks is to plot XY graphs. I tried to use SCIGRAPH, but I don't know how to do the plotting, when data are read from file.

I’ve read the manual of it, in which is written, that I have to use the following structure, and I have to add how many points I want to plot:

REAL*4 array(2,7,1) !(seven means, that I want to plot seven x-y points)

DATA array / x1,y1, x2,y2, x3,y3, .....  x7,y7/

To count the number of data (usually it’s unknown) in the used file I wrote a simple program, that works, so I think it isn’t a problem, but I don't know how I should modify the given sample to do the plotting from file.

I would be grateful, if somebody could help me with this problem.

Please consider that I am a beginner programmer, so I’m quite new to VS and Parallel Studio, any help/suggestions are welcome!

Thanks in advance!

Roland

Thread Topic: 

How-To

Can't change property setting

$
0
0

I have Microsoft Visual Studio for Fortran. My operating system is Windows 10. I have a number of programs where I want to change a switch under fortran diagnostic. When I go to Project properties>Fortran>diagnostic, there are no longer switches there for me to check.

How do I fix this?

How to call a C function in a DLL

$
0
0
I have DLL from someone else that is compiled from C.  I'm trying to call a function that takes a single string argument and returns an integer value.

My test program below builds and runs, but generates an "access violation" when it calls the function in the C DLL.  Is there something simple I am missing?  I tried putting a C on the string argument i.e. 'XLTRC2.dat'C but that didn't help.
program Test
    implicit none
    interface
     Integer Function TA_PDetsFromPath(fname)
   character(*) fname
   !DEC$ ATTRIBUTES C, ALIAS:'_TA_PDetsFromPath' :: TA_PDetsFromPath
     END Function TA_PDetsFromPath
    END interface

 integer i
 i = TA_PDetsFromPath('XLTRC2.dat')
end program Test

 

variables values in internal subroutines

$
0
0

Using Visual Studio Professional 2015 and Compiling with Intel(R) Visual Fortran Compiler 16.0 [Intel(R) 64] variables defined in the main subroutine are not visible in an internal subroutine. Has this problem been fixed ? Attached is a screen shot . This is a severe debugging noise.
I had to zip the jpeg image since its upload was rejected.
Regards

 

 

AttachmentSize
Downloadapplication/zipCapture.zip220.16 KB

Thread Topic: 

Bug Report

unformatted read/writes

$
0
0

My application has recently stopped being able to read unformatted files that are greater than 2.1GB in size.  Specifically, the read command of the following subroutine fails (iostat=-1) if jj = 2900 (file size 2.15GB), but works (iostat=0) if jj=2800 (file size 2.08GB).

ii = 95000
jj = 4000
allocate ( store_huge(ii, jj), STAT = istat )
store_huge = 0.0

open( newunit = file_id, file = outputfilename, form = 'unformatted', action='write', iostat = istat )
write(file_id, IOSTAT=istat) store_huge
close(file_id)

store_huge = 1.0
open(newunit=file_id, FILE=outputfilename, form = 'unformatted', action='read', iostat = istat)
read(file_id, IOSTAT=istat) store_huge
close(file_id)

deallocate( store_huge )

This problem only appeared recently, and may be due to a recent Windows update (which we can no longer control, and which have been driving me crazy).  I have Windows 10 (including the most recent automated updates), am using VS2017 (which may be the problem, though I have been using this for a couple of months without issue), and Visual Fortran Compiler 17.0.4.210.

Zone: 

Thread Topic: 

Bug Report
Viewing all 5691 articles
Browse latest View live


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