intel-fortran

Sublime Text 2 Build (Ctrl +B) Intel Fortran Compiler

99封情书 提交于 2019-12-08 05:17:39
问题 I am using ifort 11.1 on Linux 64-bits with Sublime Text2 as editor. I want to know, how can I create a custom build command to compile the code? Also I need to know how to produce the output with the same name as the source file. For example I want to reproduce the following command into a custom Build System: ifort mycode.f90 -o mycode So far I tried: { "cmd": ["ifort","$file"], "selector": ["iFort"], "path":["/usr/local/Compiler/11.1/080/bin/intel64/ifort intel64"] } Without success. Ideas

Fortran final routine calls itself before variable goes out of scope

白昼怎懂夜的黑 提交于 2019-12-07 22:53:57
问题 I have a problem with Fortran destructors/final routines. Having the code below: module my_type_module implicit none type my_type contains final :: destructor end type my_type interface my_type ! Constructor declaration module procedure my_type_constructor end interface my_type contains function my_type_constructor() type(my_type) :: my_type_constructor print *, 'In constructor address is: ', & loc(my_type_constructor) end function my_type_constructor subroutine destructor(this) type(my_type)

Mixed C++ and Fortran Linking Issue

送分小仙女□ 提交于 2019-12-07 06:53:52
问题 I have done some searching online but I cannot find out how to compile a simple C++ and Fortran code from linux. I need to get complex with it, but I just need to know how to start with a simple example. My C++ code is this: #include <iostream> using namespace std; extern int Add( int *, int * ); extern int Multiply( int *, int * ); int main() { int a,b,c; cout << "Enter 2 values: "; cin >> a >> b; c = Add(&a,&b); cout << a << " + " << b << " = " << c << endl; c = Multiply(&a,&b); cout << a <

Why aren't my fortran functions exported when using the BIND(C, NAME=“name”) attribute

走远了吗. 提交于 2019-12-06 12:46:11
I am used to using the following syntax subroutine CalcA(A,N) !DEC$ ATTRIBUTES DLLEXPORT :: CALCA !DEC$ ATTRIBUTES ALIAS:'CalcA' :: CalcA IMPLICIT NONE ... end subroutine CalcA which produces an exported function in a .dll So now I am trying the new ISO_C_BINDING with the following code subroutine CalcA(A,N) BIND(C, NAME="CalcA") USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE ... end subroutine CalcA But the export function is not created So what am I missing here? How is the new iso_c_binding going to replace the deprecated !DEC$ ATTRIBUTE DLLEXPORT declarations? PS. I am on Intel Fortran XE

How to add new element to dynamical array in Fortran90

送分小仙女□ 提交于 2019-12-06 06:10:28
[SOLVED] by francescalus . Working code for double precision dynamical arrays is: module DynamicalArrays contains subroutine AddToList(list, element) IMPLICIT NONE integer :: i, isize double precision, intent(in) :: element double precision, dimension(:), allocatable, intent(inout) :: list double precision, dimension(:), allocatable :: clist if(allocated(list)) then isize = size(list) allocate(clist(isize+1)) do i=1,isize clist(i) = list(i) end do clist(isize+1) = element deallocate(list) call move_alloc(clist, list) else allocate(list(1)) list(1) = element end if end subroutine AddToList end

Using f2py with windows x64 and Intel Fortran

╄→гoц情女王★ 提交于 2019-12-05 19:55:47
I'm trying to achieve in using f2py on windows 8, x64, with Intel Fortran Compiler. I've tried two things : 1) install via windows 64x installer. http://www.lfd.uci.edu/~gohlke/pythonlibs/ NumPy is correctly installed, but no compiler found when executing f2py -c --help-fcompiler I got : Fortran compilers found: Compilers available for this platform, but not found: --fcompiler=absoft Absoft Corp Fortran Compiler --fcompiler=compaqv DIGITAL or Compaq Visual Fortran Compil --fcompiler=g95 G95 Fortran Compiler --fcompiler=gnu GNU Fortran 77 compiler --fcompiler=gnu95 GNU Fortran 95 compiler -

Mixed C++ and Fortran Linking Issue

久未见 提交于 2019-12-05 11:21:11
I have done some searching online but I cannot find out how to compile a simple C++ and Fortran code from linux. I need to get complex with it, but I just need to know how to start with a simple example. My C++ code is this: #include <iostream> using namespace std; extern int Add( int *, int * ); extern int Multiply( int *, int * ); int main() { int a,b,c; cout << "Enter 2 values: "; cin >> a >> b; c = Add(&a,&b); cout << a << " + " << b << " = " << c << endl; c = Multiply(&a,&b); cout << a << " * " << b << " = " << c << endl; return 0; } My Fortran Code is this: integer function Add(a,b)

why change “complex*16” to “complex(16)” cause the runtime increased unreasonably in fortran?

我的未来我决定 提交于 2019-12-04 17:08:55
This fortran code was originally written in Fortran 77 format(I will show it later). After I got it, I changed it into f90 free format via a converting tool. Using intel fortran compiler ifort , the compiation and running is just as fine as before. Then I want to do more, I want to transform nonstandard,obsolete data type declaration f77 style like: real*8 , complex*16 etc into f90 standard real(8) , complex(16) . But I found an unbelievable thing. I just changed one "complex*16" into "complex(16)", then the running time increased from 10 seconds to 2 minutes. How could it be!!?? Can someone

Test whether a directory exists or not

倖福魔咒の 提交于 2019-12-04 13:29:18
问题 I'm trying to verify that a directory exists using Fortan90. On various sites I found: logical :: dir_e inquire(file='./docs/.', exist=dir_e) if ( dir_e ) then write(*,*) "dir exists!" else ! workaround: it calls an extern program... call system('mkdir docs') end if However, inquire returns False whether or not the directory exists and if I execute this code twice, I get an error message cannot make dir, file already exists If I use: inquire(file='./docs/test', exist=dir_e) with an existing

Unresolved references using IFORT with nvcc and CUSP

拈花ヽ惹草 提交于 2019-12-04 06:38:18
问题 I have a program which I'm compiling like this: (...) Some ifort *.f -c nvcc -c src/bicgstab.cu -o bicgstab.o -I/home/ricardo/apps/cusp/cusplibrary (...) Some more *.for -c ifort *.o -L/usr/local/cuda-5.5/lib64 -lcudart -lcublas -lcusparse -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -openmp -o program Everything worked fine until i added the CUSP support where i have this wrapper (bicgstab.cu): #include <cusp/csr_matrix.h> #include <cusp/krylov/bicgstab.h> #if defined(__cplusplus) extern