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

how to include the INCLUDE files

PASeeger
Beginner
2,556 Views
Here is the front end of a legacy package I am trying to port from Compaq/6 to Intel/18.  This program is a GUI to enter beam-line elements for
Monte Carlo simulation of neutron scattering instruments. As each element is "Built" into a file which will be used in the simulation, it
may also be rendered as a VRML <shape> block, allowing the user to see the complete instrument from any angle.
 
My current level of (lack of) understanding is how to include the INCLUDE files, such that they can be seen Globally.  I have found
     NISP_Win Property Pages
and under Resources > General, I specified
      Additional Include Directories C:\NISP\INCLUDES
but the result was not good - the include files were not found:
1>C:\NISP\NISP_Win\NISP_Win.f(67): error #5102: Cannot open include file 'mc_geom.inc'
etc. for the other files.
 
Command-line mode with "/Ic:\nisp\includes" did much better -- up to finding variables defined in module MouseFlags. What do I need to know
about using Modules with TYPEs and labeled COMMON blocks?
 
      PROGRAM NISP_WIN
!
!  Create or edit an instrument and write a geometry file for MC_Run,
!    using the Windows environment.  Adding or changing element types is
!    done in module ElementTypes.  All element definitions and geometry
!    file information are in a static library, ElmntDef.lib.  Layouts of
!    dialog boxes for each type are found in resource file Script1.rc.
!
      USE       IFQWIN
      USE       IFLOGM
      USE       IFPORT
      USE       ElmentTypes
      USE       MouseFlags
!
      IMPLICIT  NONE
      CHARACTER VERSION*(*)
      PARAMETER (VERSION='Version 3.1, 08 Sep 2018')
      INCLUDE   'RESOURCE.FD'
      INCLUDE   'mc_geom.inc'    !TYPE SURFACE, REGION, MC_GEOM, PARTICLE
      INCLUDE   'mc_elmnt.inc'   !TYPE MC_ELEMENT
      INCLUDE   'constant.inc'   !physical constants
      INCLUDE   'BuildData.inc'  !COMMON /Build_Data/, /VRML_Data/
!
      INTERFACE
         LOGICAL(4) FUNCTION INITIALSETTINGS
         END FUNCTION
      END INTERFACE
!
 
0 Kudos
7 Replies
Steve_Lionel
Honored Contributor III
2,556 Views

You want Fortran > General, not Resources > General.

0 Kudos
PASeeger
Beginner
2,556 Views

Thank you, Steve.  When I had found the property pages for each Project and for each Configuration, the main program compiled with no errors (just one "remark"!).  There must be a better way to make the includes Global .. entering the path in multiple places opens the possibility of accidentally using different versions of the files. 

Along the way, I removed one of my Projects, a static library. Now when I try to restore or replace it, I don't have access because the name is already attached to the Solution. Could you point out to me to how to add a Project, or how to remove traces of one?

 

0 Kudos
gib
New Contributor II
2,556 Views

You certainly shouldn't be entering the path in multiple places.  You specify the locations of include files in:

Configuration Properties > Fortran > General > Additional Include Directories

then wherever a file is to be included you just provide the file name.  Perhaps I misunderstood you?

 

0 Kudos
PASeeger
Beginner
2,556 Views

It looks like every Project has its own properties pages, and I think I had to do each configuration as well. This code hasn't been touched since 2009.  Having decommissioned by last PC running WinXP - which was the last OS that would run my program - I am trying to catch up enough to update the code. Next step will be to get the Dialog Boxes running, and also the callback routines.  Any advice on documentation?

Thanks for your help!

Phil Seeger

0 Kudos
gib
New Contributor II
2,556 Views

I did misunderstand - you are talking about multiple Projects within a Solution.  I typically have just one Project, but as far as I know there's no way to avoid setting up the Configuration for each Project.  Re. documentation, I can only suggest searching online.

0 Kudos
Greg_T_
Valued Contributor I
2,556 Views

In the Intel Developer Zone, the on-line Fortran language reference has been helpful documentation for me.  Its URL is:

https://software.intel.com/en-us/fortran-compiler-18.0-developer-guide-and-reference-language-reference

Regards, Greg

0 Kudos
PASeeger
Beginner
2,556 Views

Hi Greg -

That document is surely the "sine qua non."  So long as I can figure out what I need in the 46-page Table of Contents (which I have printed out), I am well begun.  But  sometimes I miss details of the Visual Studio, for instance going through menus to find where I need to go to set additional include files.  My next adventure will be compiling (editing?) the Resource file for 47 dialog boxes (with between 4 and 29 input variables each). I also need details of callback routines for the mouse (and touchscreen?). That is where the old code (which worked in WinXP) fails in Win10. 

So sometimes a little pointing out of "obvious" details will be very helpful!

Thanks,  Phil Seeger

0 Kudos
Reply