Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use ISO_FORTRAN_ENV with Intel Fortran?

702 views
Skip to first unread message

Beliavsky

unread,
May 30, 2017, 3:12:04 PM5/30/17
to
For the program

program main
use, intrinsic :: iso_fortran_env
implicit none
write (output_unit,*) "Hello, world."
end program main

compiling on Windows with ifort /stand:f08 xoutput_unit.f90 for

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0 Beta Build 20170320

gives error messages

xoutput_unit.f90(2): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [ISO_FORTRAN_ENV]
use, intrinsic :: iso_fortran_env
------------------^
xoutput_unit.f90(4): error #6404: This name does not have a type, and must have an explicit type. [OUTPUT_UNIT]
write (output_unit,*) "Hello, world."
-------^
compilation aborted for xoutput_unit.f90 (code 1)

The program compiles and runs fine with gfortran and g95. I am missing something basic but don't know what it is. Looking at https://software.intel.com/en-us/node/678626 I think iso_fortran_env was implemented in Intel Fortran 17.0.


Beliavsky

unread,
May 30, 2017, 3:24:47 PM5/30/17
to
On Tuesday, May 30, 2017 at 3:12:04 PM UTC-4, Beliavsky wrote:
> For the program
>
> program main
> use, intrinsic :: iso_fortran_env
> implicit none
> write (output_unit,*) "Hello, world."
> end program main
>
> compiling on Windows with ifort /stand:f08 xoutput_unit.f90 for
>
> Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0 Beta Build 20170320
>
> gives error messages

I see that copying the file iso_fortran_env.modintr from the Intel Fortran for Windows installation to the current directory or using the -module option to point to the directory containing that file solves the problem.

Ian Harvey

unread,
May 31, 2017, 6:03:29 AM5/31/17
to
That shouldn't be required. It is either an installation problem or a
beta bug (I can't test here).

ifort has supported iso_fortran_env for yonks.

mecej4

unread,
May 31, 2017, 7:47:18 AM5/31/17
to
Ian is correct. The 16.0.4 Ifort compiler on Windows compiles the code
without any need to work in a specific directory or to make a copy of
the module file.

>
> ifort has supported iso_fortran_env for yonks.
>

"Yonk"? I had to look that one up! It appears to be a little-used
Imperial measure of time, probably useful in reporting floods, as in

Little Green Creek: 1.25 acre-fathoms/yonk. :-)

-- mecej4

mecej...@nospam.invalid
(Replace four by 4, nospam by operamail, invalid by com,
and remove all underscores)

Arjen Markus

unread,
May 31, 2017, 8:09:08 AM5/31/17
to
As I work in an environment that deals with floods quite a lot, out of curiosity, how many fortnights is a yonk?

Regards,

Arjen

FortranFan

unread,
May 31, 2017, 8:52:10 AM5/31/17
to
On Wednesday, May 31, 2017 at 6:03:29 AM UTC-4, Ian Harvey wrote:

> ..
>
> That shouldn't be required. It is either an installation problem or a
> beta bug (I can't test here).
> ..


It could also be the settings specified by OP so that the command environment picked for the test in the original post did not 'know' about Intel Fortran environment variables and paths and so forth.

Intel Fortran installation includes batch files e.g., <C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.0.065\windows\bin\ipsxe-comp-vars.bat> which can setup the command environment for use with the compiler. Once such setup is completed, one should NOT have to copy the files around for instrinsic modules; in fact, such actions by users themselves can probably cause other issues later on e.g., inconsistencies MOD/OBJ versions, etc. and should be avoided.

Suggested course of action for Intel Fortran users will be to follow Intel's own instructions from their documentation (see here: https://software.intel.com/en-us/fortran-compiler-18.0-developer-guide-and-reference).

But at the bare minimum, users wanting to use the command environment can do best to use Intel's own shortcuts that are installed: look under Start -> Programs -> Intel Parallel Studio XE 2018 -> Compiler and Performance Libraries -> Command Prompt with Intel Compiler. Then pick the suitable one e.g., Intel-64 with Visual Studio 2017. If one or more of these shortcuts are used frequently, they can be copied to the Taskbar or Desktop, etc. for ready access.

Anyways, are not such posts better suited for Intel Fortran forum?
https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows.


Steve Lionel

unread,
May 31, 2017, 2:08:38 PM5/31/17
to
On 5/30/2017 3:24 PM, Beliavsky wrote:
> I see that copying the file iso_fortran_env.modintr from the Intel Fortran for Windows installation to the current directory or using the -module option to point to the directory containing that file solves the problem.

As others say, you should not have to do this. The compiler uses the
INCLUDE environment variable to find modules, including intrinsic
modules. The standard setup for the command line (ifortvars.bat or
ipsxe-comp-vars.bat) sets this for you. Check that the setup script ran
correctly, that INCLUDE is defined to include the compiler's
windows\compiler\include folder and that this folder's ia32 or intel64
folder contains the .modintr file.

--
Steve Lionel
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: http://intel.com/software/DrFortran

Clive Page

unread,
Jun 1, 2017, 5:48:06 AM6/1/17
to
On 31/05/2017 13:09, Arjen Markus wrote:
> As I work in an environment that deals with floods quite a lot, out of curiosity, how many fortnights is a yonk?

I don't know. Likewise only Scotsmen seem to know how many mickles make
a muckle. It could be the same number.


--
Clive Page

Arjen Markus

unread,
Jun 1, 2017, 5:57:01 AM6/1/17
to
A colleague of mine, well versed in the Systeme International of units, used to mock our American counterparts, by expressing diffusion coefficients in square furlongs per fortnight ... But honestly, in my country people used to use a wide variety of (long since disused) units as well. I once compiled a list of such units. It is now lost in the great bitbucket in the sky, but it was an impressive list :).

Regards,

Arjen

interested in fortran

unread,
Jun 1, 2017, 8:09:33 AM6/1/17
to
0 new messages