Quantcast
Channel: Fortran
Viewing all 3108 articles
Browse latest View live

Linking error with Modflow build in VisualStudio 2013

$
0
0

Hi All,

I need your help. I'm compiling Modflow2005 in visual studio with intel fortran project in debug mode, but when the link process is reached out the follow error:

Error    12     error LNK2005: _MAIN__ already defined in hydfmt.obj    mnw1to2.obj    

Error    13     error LNK2005: _IFRL already defined in mnw1to2.obj    gwf2mnw17.obj    

Error    14     error LNK2005: _NCREAD already defined in mnw1to2.obj    gwf2mnw17.obj    

Error    15     error LNK2005: _QREAD already defined in mnw1to2.obj    gwf2mnw17.obj    

Error    16     error LNK2005: _MAIN__ already defined in hydfmt.obj    mf2005.obj    

Error    17     fatal error LNK1169: one or more multiply defined symbols found    Debug\modflow.exe    

My compiler is Intel Parallel Studio XE 15.0 + Visual Studio 2013 Pro, upload the source code Downloadsrc.zip

Tanks,

Ulises

Fichier attachéTaille
Téléchargersrc.zip545.94 Ko

type variable + allocatable

$
0
0

Dear all,

I have a question. I have a type variable and I would like if it is possible to allocate it.

I mean, this is the variable:

type LPARTint
      integer                       :: value
      real,allocatable,dimension(:) :: QQ
      real,allocatable,dimension(:) :: RP
      type(LPARTint), pointer :: next => null()
      type(LPARTint), pointer :: prev => null()
end type LPARTint

I would like to know if this variable is correct.

The second things, How I can allocate QQ and RR?

I sort of allocate(LPARTint%QQ(nVar)), because nVar is constant in all the program.

Thanks again

Thanks  a lot

bug: error #8259 TBP def must contain 1 binding

$
0
0

I’m a bit confused as to why the compiler is flagging this as an error, because I thought it was one of the F2008 features now supported by ifort:

module mymod
  implicit none

  type mt
     real :: foo
   contains
     procedure :: one ,two
  end type
contains
  function one(this)
    class(mt) ,intent(in) :: this
    real :: one
    one = this%foo + 1.0
  end function
  function two(this)
    class(mt) ,intent(in) :: this
    real :: two
    two = this%foo + 2.0
  end function
end module
13:37 IBB-MBP-2:intel-bugs $ /usr/bin/ifort multi_tbp_one_procedure_stmt.f90
multi_tbp_one_procedure_stmt.f90(7): error #8259: The type bound procedure definition statement must contains only one binding name.   [TWO]
     procedure :: one ,two
-----------------------^
compilation aborted for multi_tbp_one_procedure_stmt.f90 (code 1)
13:38 IBB-MBP-2:intel-bugs $ /usr/bin/ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.077 Build 20140716
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

sometimes this seems to go away (with other codes) when I remove the `-stand f08` flag… not sure why.

Feature request: Block comment

$
0
0

I know this has come up before but not for some time so I'll suggest it again.

I comment my code heavily, and often with multi-line and even paragraph-long comment blocks. Unfortunately the comment tool provided by Fortran is a real impediment to doing this, because (1) I must put a hard new line at the end of each line, and the VS editor does not usually return the cursor to the previous "!"; and (2) worse yet, editing an existing comment to increase the length of a line is so difficult that I am tempted to forget it, or reword and abbreviate awkwardly to avoid extending past my favorite length limit (I don't like to go past line 80).

Why can't the standards committee introduce a block comment syntax? I would suggest something like ![ to begin, and ]! to end, or !{ and }! (for C die-hards). This would make comments much easier to enter and more readable as well.

In addition, the VS editor should be able to handle line wrap to a user-defined right margin. Or even in the absence of an official Fortran syntax, the VS editor should be able to reformat block comments, using line wrapping to a pre-defined right margin while maintaining the leading ! on each new line.

Is there any reason why this shouldn't be done? Seems like a no-brainer to me.

Run time checks at the project level vs at the visual studio tools -> options level

$
0
0

Run time checks e.g.

/check:uninit /check:pointer /check:bounds

can be specified at the project level for each FORTRAN project, or in Visual Studio 2012 in the TOOLS -> Options -> Intel Composer XE -> Visual Fortran -> Compilers -> Default options.

We thought the settings at the project level would overwrite the "Default options" at the TOOLS -> Options level, but after some testing this doesn't seem to be the case, which doesn't seem to make much sense.

Could anyone please confirm that if these run time checks are set in TOOLS -> Options -> Intel Composer XE -> Visual Fortran -> Compilers -> Default options:

/check:uninit /check:pointer /check:bounds

then even if the equivalent settings at the project level are set to

/check:nouninit /check:nopointer /check:nobounds

for every Fortran project in the solution

these run time checks are still performed during running?

Thanks!

Intel® VTune™ Amplifier XE 2015 and Intel® VTune™ Amplifier 2015 for Systems

$
0
0

Intel® Parallel Studio XE 2015 Professional Edition for Linux* OS, OS X*

Intel® Parallel Studio XE 2015 Cluster Edition for Linux* OS, OS X*

Intel® System Studio 2015 for Linux* OS, OS X*

Intel VTune Amplifier is a performance analysis tool targeted for users developing serial and multithreaded applications. The tool is delivered as VTune Amplifier XE Performance Profiler and VTune Amplifier for Systems Performance Profiler and Intel Energy Profiler and supports local (host-based) and remote (target-based) analysis on the following platforms:

Platform

Host/Target

VTune Amplifier XE

VTune Amplifier for Systems

Windows*

Host

yes

yes

Target

no

Intel Energy Profiler only

Linux*

Host

yes

yes

Target

yes (regular systems only)

yes (regular and embedded systems)

OS X*

Host

no

no

Target

no

no

Android*

Host

no

no

Target

no

yes

Note

Though you cannot analyze applications running on the OS X systems, you still can install the VTune Amplifier on OS X and run remote analysis on Linux or Android targets.

Start here:

 

Anglais

Source Outlining in Visual Studio.

$
0
0

I find the Outlining feature in Visual Studio very useful, with all the sections collapsed it is very fast to page/scroll up and down file and just have a small number of routines that are of current interested expanded.

Sometimes I find inserting lines causes all the sections to expand or sometimes all section above the current point to expand. It this normal behaviour and is there anything way of avoiding this?

Secondly, I often have modules with quite a large declarations/comments section and then a lot of contained procedures. It would be helpful if the zone from after the module statements up to the contains statement where defined as an outline block. I guess that would be a change to the VS integrations for Fortran? Alternatively (I have made a search and failed to find an answer) is there a way of adding outlining start/end ‘tokens’ to the source. If there is how? If not perhaps a global solution might be a comment that is interpreted by outlining. For example the source comments  ! <outlining-block-start>   and ! <outlining-block-end> could define a region as matched pairs, that would give a lot of possibilities.

Best Regards
Andrew

Intel® VTune™ Amplifier XE 2015 and Intel® VTune™ Amplifier 2015 for Systems

$
0
0

Intel® Parallel Studio XE 2015 Professional Edition for Windows* OS

Intel® Parallel Studio XE 2015 Cluster Edition for Windows* OS

Intel® System Studio 2015 for Windows* OS

Intel VTune Amplifier is a performance analysis tool targeted for users developing serial and multithreaded applications. The tool is delivered as VTune Amplifier XE Performance Profiler and VTune Amplifier for Systems Performance Profiler and Intel Energy Profiler and supports local (host-based) and remote (target-based) analysis on the following platforms:

Platform

Host/Target

VTune Amplifier XE

VTune Amplifier for Systems

Windows*

Host

yes

yes

Target

no

Intel Energy Profiler only

Linux*

Host

yes

yes

Target

yes (regular systems only)

yes (regular and embedded systems)

OS X*

Host

no

no

Target

no

no

Android*

Host

no

no

Target

no

yes

Note

Though you cannot analyze applications running on the OS X systems, you still can install the VTune Amplifier on OS X and run remote analysis on Linux or Android targets.

Start here:

 

Anglais

Linking Mathgl Library to Intel Fortran solution in Visual Studio

$
0
0

Hello,

Mathgl is a C++ open source library that can be used to plot results directly in calculation (see http://mathgl.sourceforge.net/doc_en/Main.html).

There are examples (https://groups.google.com/forum/#!topic/mathgl/hMH3_U3XAHI) for coupling Fortran/Mathgl and GTK. The projects are as Code::Blocks form and use gfortran to compile. All is fine with these tools.

When I want to implement a similar solution in Visual Studio, I don't know how to link the dll in my project. I have an error LNK2019: unresolved external symbol.

I'm a newbie in coupling Fortran and C++ dll. Gfortran seems to do the job with the -lmgl option.

Can anyone tell me the proper way to do the same in Visual Studio?

Thank you

Pierre

Trapping on uninitialized variable use

$
0
0

 

Using the compiler option to initialize variables to Nan and trap on Nan (uninitialized variable), should this trap on assigning an uninitialzed variable to another variable, or just using it in an arithmetic expression?

When  y is NaN and uninitialized, I don't seem to get an exception with

 

x = y

 

but I do for

x = y + 1.0

 

thanks,

Scott

 

What is the maximum array rank?

$
0
0

Hi,

I ran the program on intel visual fortran compiler,using Fortran 2003, and got this error message:

error #6204: There are too many dimensions; the maximum rank is 7.

I remembered that in the user manual the inter visual fortran compiler can handle up to the maximum rank of 15.

Could anyone please suggest this? I appreciate all answers.  Thank you very much.

Compilation error on Mac :Undefined symbols for architecture x86_64

$
0
0

Hi 
I'm using Intel Fortran version 14.0.2 20140121 on Mac OS X and Xcode 6.1.1.

After Installing and sourcing files like

source /opt/intel/bin/compilervars.sh intel64
source /opt/intel/mkl/bin/intel64/mklvars_intel64.sh

 

tried to compile a test file (Hello world) and got the following error:

**********************

Undefined symbols for architecture x86_64:

  "__Unwind_Backtrace", referenced from:

      _tbk_trace_stack in libirc.a(tbk_backtrace.o)

  "__Unwind_ForcedUnwind", referenced from:

      _tbk_trace_stack in libirc.a(tbk_backtrace.o)

  "__Unwind_GetIP", referenced from:

      _tbk_stop_unwind_callback in libirc.a(tbk_backtrace.o)

      _backtrace_callback in libirc.a(tbk_backtrace.o)

  "__Unwind_GetRegionStart", referenced from:

      _tbk_stop_unwind_callback in libirc.a(tbk_backtrace.o)

ld: symbol(s) not found for architecture x86_64

**********************

I've read that this combination of OS and Xcode is not supported by the version 14, 
but as I saw a similar error when I compiled the same file with gfortran,

I think this might not be due to the combination problem. 

 

I'm glad if someone could find how to fix this error.
 

 

 

 

 

Differences between !$OMP SIMD and !DIR$ SIMD

$
0
0

Hi Folks, 

Can anyone explain the difference(s) between !DIR$ SIMD and !$OMP SIMD please or point me towards where I can find this out? I should add, I've already read through the thread at https://software.intel.com/en-us/forums/topic/509157 but this didn't fully explain the differences. 

As I understand !DIR$ SIMD is an Intel specific directive but !$OMP SIMD is part of the OpenMP 4.0 standard, however, many of the clauses that can be added and the use cases appear to be identical for both directives. 

Thanks in advance. 

Fiona

 

catastrophic error: **Internal compiler error: segmentation violation signal raised**

$
0
0

With
FFLAGS="-C -openmp"

# THIS DOES NOT MAKE COMPILATION ERROR.

  ifort -c $FFLAGS sub1.f90 sub2.f90

# THIS ALSO DOES NOT MAKE COMPILATION ERROR.

  cat   sub1.f90   sub2.f90   >   combined.f90
  ifort -c $FFLAGS   combined.f90

# THIS "DOES" MAKE COMPILATION ERROR.

  cat   sub2.f90   sub1.f90   >   combined-r.f90
  ifort -c $FFLAGS   combined-r.f90

The error message is:
combined-r.f90: catastrophic error: **Internal compiler error:
segmentation violation signal raised**
Please report this error along with the circumstances
in which it occurred in a Software Problem Report.  
Note: File and line given may not be explicit cause of this error.
compilation aborted for combined-r.f90 (code 1)

% ifort -v
ifort version 15.0.0

The Operating system, Linux (Cent-OS 7.0, or Fedora16 etc.)

You can do the above experiment by using my script "compile.sh".

 

__LINE__ directive in a string variable?

$
0
0

Is there a way to have the preprocessor write __LINE__ inside a string variable directly, as shown below:

S = 'This is line __LINE__'

My tests indicate this does not work; and I have to resort to assigning __LINE__ to an integer variable, then perform an internal write of that variable into a string that I can later concatenate with the rest of my text. I would be curious if there is a workaround.


License issue

$
0
0

Hi,

I am trying to install Intel Cluster Studio 2013 on a new computer (Windows 7) which is replacing an older machine which is not working anymore and on which I had Intel Cluster Studio 2013 installed and running. I tried to install using my serial number but got the message that this serial number is not valid anymore. I decided to choose the 31 days trial option to complete the installation and to worry about activation later. Later has now arrived and I came across a previous post (https://software.intel.com/en-us/forums/topic/286475) where it is suggested to copy the license file from the old computer to the new computer. I then uninstalled Cluster Studio and re-installed by specifying the copied license file. Everything seemingly went fine, except that now when I look into Intel Software Manager under licenses, Cluster Studio is still listed as being under evaluation status with the option to activate. If I try to click on activate, I am asked for the serial number and if I try to enter my serial number, I receive the message that it is invalid.

Is there something that I'm supposed to do to activate using the license file, beyond linking to it during installation?

Thank you,

Simon

 

Automatic allocation of arrays in fortran is not working

$
0
0

Hello,

    I am using ifort 15.0.1. I know that the automatic allocation works in fortran 2008. I got it working with gfortran. But it seems ifort is not able to compile such programs appropriately. Below is a simple program :

program testing
  implicit none
  real,allocatable,dimension (:):: a,b
  allocate(a(10))
  a = 1.0
  b = a
  print*,size(b)
end program

   The array "b" should get the allocation of array "a" along with its values. When I compile with gfortran, the program prints 10, but for ifort it prints 0. Is this feature of F2008 supported yet in ifort ?

Regards,

Dhiraj

 

 

 

  

 

 

 

Uniary operator following arithmetic operator

$
0
0

! (ifort version 15.0.0 or earier)
!  I think it is a bad idea to extend the grammer of the arithmetic expression
! in Fortran langurage as the followings.
! Such functionality might look convenient at first, however it would enhance

!possibilities to make the compiler to silently ignore  possible human-errors

! such as mis-types especially in lengthy expressions.

 

ifort accepts the source code below without errors nor warnings.

---------------------------

program to_be_avoided
implicit none
real a, b, c, d, e, f, g, x, y, z, w
   a = --3.0
   b = ++3.0
   c = -+3.0
   d = +-3.0
   e = 2.0 +-3.0
   f = 2.0 *- 3.0
   g = 2.0 *+ 3.0
   x = 2.0 *- 3.0
   y = 2.0 /- 3.0
   z = 2.0 +-+ 3.0
   w = 2.0 +-+----- 3.0
   !----
   a =  2.0 ++ a / x
   b = --y
   c = +-w
   d = y *- x
   e = z /+-a
   f = -- y ++ a /- x
   g = -- y ++ a / -----x
   x = -a **-x
   y = -+a **--x
   z = --a **+ x ** y
   w = sin(++2.0) -- sin(x--y)
! integer expressions as well (omitted).
end program to_be_avoided
---------

You can also compare with GNU's gfortran or other compilers.

Fichier attachéTaille
Téléchargerto_be_avoided.f90916 octets

strange behaviour from 64-bit integer

$
0
0

I'm seeing a strange behaviour from int64 integer. Following code: 

    use iso_fortran_env
    implicit none

    integer (int64) :: i

    i=2**32-2

write (*,*) "i, btest (i,0)" , i, btest (i,0)
    write (*,*) "i, btest (i,31)" , i, btest (i,31)
    write (*,*) "i, btest (i,32)" , i, btest (i,32)
    write (*,*) "i, btest (i,33)" , i, btest (i,33)
    write (*,*) "huge (i)" , huge (i)

returns: 

 i, btest (i,0)                    -2 F
 i, btest (i,31)                    -2 T
 i, btest (i,32)                    -2 T
 i, btest (i,33)                    -2 T
 huge (i)   9223372036854775807

which shows that it calculates 2^32-2 as -2. Whereas limit on int64 is  9223372036854775807 that is way bigger than 2^32!

Wonder if I'm doing something wrong!

Thanks

 

Warning : platform 'Itanium' not present

$
0
0

When I start a large mixed language solution I always receive a warning "platform 'Itanium' not present" from the two C/C++ projects in the solution. I was not able to find any reference to the Itanium processor in the project properties, nor a possiblity to get rid of the warning message. The warning seems not to have any further impact, but I would like to know more about the reason for the message.

Environment: Windows 7 64 bit, VS 2012, Composer 2015 

Viewing all 3108 articles
Browse latest View live


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