<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Linking NETCDF on Windows OS in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802562#M38469</link>
    <description>The compiler cannot find the module files. Your additional include directories are probably wrong. From your build log the path to the netcdf modules is specified as "\netcdf" - a subdirectory off the root of the current drive. Is this really where you extracted the files?</description>
    <pubDate>Sat, 29 Oct 2011 21:13:11 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2011-10-29T21:13:11Z</dc:date>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802560#M38467</link>
      <description>I have to use NETCDF under Windows Visual Studio project. I found prebuilt version ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-4.1.1-win32-bin.zipand I'm trying to link netcdf as a static library.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;in VS compiler and linker options I added the following lines :&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;[bash]Fortran - General - Additional Include Dir = "netcdf dll and exe directory"
Linker - General - Additional Library Dir = "netcdf lib directory"
Linker - Input - Additional Dependencies = netcdf.lib[/bash]&lt;/PRE&gt; &lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;here is my build log :&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE width="*" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="0" bgcolor="white"&gt;&lt;/TD&gt;&lt;TD width="*"&gt;&lt;PRE&gt;Compiling with Intel Visual Fortran Compiler XE 12.0.1.127 [IA-32]...
ifort /nologo /debug:full /Od /I"\\netcdf" /warn:interfaces /module:"Debug\\\\" /object:"Debug\\\\" /Fd"Debug\\vc100.pdb" /traceback /check:bounds /libs:static /threads /dbglibs /c /gen-interfaces /Qvc10 /Qlocation,link,"c:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\\\bin" "TestNetcdf.f90"
TestNetcdf.f90(3): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [TYPESIZES]
  use typeSizes
------^
TestNetcdf.f90(4): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [NETCDF]
  use netcdf
------^
TestNetcdf.f90(7): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQ_LIBVERS]
  print *, 'NetCDF version: ', nf90_inq_libvers()
-------------------------------^
compilation aborted for TestNetcdf.f90 (code 1)&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV&gt;the fortran code is very simple :&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;[bash]program testnetcdf

  use typeSizes
  use netcdf
  implicit none

  print *, 'NetCDF version: ', nf90_inq_libvers()
  print *, '*** SUCCESS!'  

end program testnetcdf[/bash]&lt;/PRE&gt; &lt;DIV&gt;&lt;/DIV&gt;Tell me, please, what I did wrong ?&lt;/DIV&gt;</description>
      <pubDate>Sat, 29 Oct 2011 19:51:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802560#M38467</guid>
      <dc:creator>coolweather</dc:creator>
      <dc:date>2011-10-29T19:51:56Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802561#M38468</link>
      <description>The compiler needs to be given the paths to the include and library directories. It was unable to find the module files, since all you told it was &lt;BR /&gt;&lt;BR /&gt;&lt;B&gt; IncludeDir="netcdfdllandexedirectory"&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt;Naturally, it looked for a directory called &lt;B&gt;\netcdf&lt;/B&gt; &lt;SPAN style="text-decoration: line-through;"&gt;under the working directory&lt;/SPAN&gt;, and failed to find it.</description>
      <pubDate>Sat, 29 Oct 2011 21:11:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802561#M38468</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-10-29T21:11:23Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802562#M38469</link>
      <description>The compiler cannot find the module files. Your additional include directories are probably wrong. From your build log the path to the netcdf modules is specified as "\netcdf" - a subdirectory off the root of the current drive. Is this really where you extracted the files?</description>
      <pubDate>Sat, 29 Oct 2011 21:13:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802562#M38469</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2011-10-29T21:13:11Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802563#M38470</link>
      <description>the problem that this compilation does not contains *.mod files, and it seems there is no other compilation of netcdf for windows (linux version compiles without problems).&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;is it possible to link to netcdf without .mod files ?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 30 Oct 2011 20:03:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802563#M38470</guid>
      <dc:creator>coolweather</dc:creator>
      <dc:date>2011-10-30T20:03:58Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802564#M38471</link>
      <description>If you have netcdf libraries with no Fortran objects or .mod files, your choices appear to be to rebuild the libraries yourself, or to omit the Fortran bindings (call only from C). I thought the instructions for building the entire thing from source were clearer than you've made your method to be.&lt;BR /&gt;You would have the option of following the f77 interface guide if you have something against .mod files, but you still need objects built for the calling compiler.&lt;BR /&gt;The official pre-built Windows version appears to be specific to MSVC++ 6 32-bit, so it seems unlikely you would attempt to use it on a current system.</description>
      <pubDate>Mon, 31 Oct 2011 00:37:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802564#M38471</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-10-31T00:37:36Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802565#M38472</link>
      <description>The necessary mod files for your test program appear to be in the zip linked to in the initial post.&lt;BR /&gt;&lt;BR /&gt;Before my previous response I had downloaded the zip file you linked and compiled and executed your program using the command line. I had to change the runtime library options from those present in your build-log in order to link successfully, but that was it. Note that I am not a netcdf user and I have not read any documentation, so other problems may befall you, but your sample program appears to work ok.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[plain]U:projects&amp;gt;dir netcdf*
 Volume in drive U is ian
 Volume Serial Number is 024E-9CF1

 Directory of U:projects

31/10/2011  12:26 PM    &lt;DIR&gt;          netcdf-test
31/10/2011  12:24 PM    &lt;DIR&gt;          netcdf-4.1.1-win32
               0 File(s)              0 bytes
               2 Dir(s)  69,738,610,688 bytes free

U:projects&amp;gt;cd netcdf-test

U:projectsnetcdf-test&amp;gt;type TestNetCDF.f90
program testnetcdf
  use typeSizes
  use netcdf
  implicit none
  print *, 'NetCDF version: ', nf90_inq_libvers()
  print *, '*** SUCCESS!'
end program testnetcdf

U:projectsnetcdf-test&amp;gt;ifort /I"..netcdf-4.1.1-win32" TestNetCDF.f90 ..netcdf-4.1.1-win32netcdf.lib ..netcdf-4.1.1-win32netcdf_f90.lib
Intel Visual Fortran Compiler XE for applications running on IA-32, Version 1
2.1.1.258 Build 20111011
Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.

Microsoft  Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:TestNetCDF.exe
-subsystem:console
TestNetCDF.obj
..netcdf-4.1.1-win32netcdf.lib
..netcdf-4.1.1-win32netcdf_f90.lib

U:projectsnetcdf-test&amp;gt;copy TestNetCDF.exe ..netcdf-4.1.1-win32
        1 file(s) copied.

U:projectsnetcdf-test&amp;gt;..netcdf-4.1.1-win32TestNetCDF.exe
 NetCDF version:
 4.0.1-beta3 of Jun  7 2010 14:35:31 $


 *** SUCCESS![/plain]&lt;/DIR&gt;&lt;/DIR&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Oct 2011 01:32:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802565#M38472</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2011-10-31T01:32:07Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802566#M38473</link>
      <description>Thank you ! I found mod files. now I can build the project.&lt;DIV&gt;But netcdf libraries are linked dynamically. I prefer to link them statically.&lt;/DIV&gt;&lt;DIV&gt;Is there some option to do it in windows ? (in Linux I used -static option for linker)&lt;/DIV&gt;&lt;DIV&gt;How to configure Visual Studio for static linking ?&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Nov 2011 07:38:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802566#M38473</guid>
      <dc:creator>coolweather</dc:creator>
      <dc:date>2011-11-03T07:38:00Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802567#M38474</link>
      <description>Static linking can work only if you have static libraries for NetCDF. If these libraries do, indeed, exist on your system, specify their names (and paths, as needed) in place of the DLL libraries that you used previously.&lt;BR /&gt;&lt;BR /&gt;In general, when you add a third party package dependency to your project, a number of steps are needed to make the integration complete. You have to configure your build system so that these pieces of information are available:&lt;BR /&gt;&lt;BR /&gt; 1. The locations of include and module files, needed by the compiler.&lt;BR /&gt;&lt;BR /&gt; 2. The locations of libraries, needed by the linker.&lt;BR /&gt;&lt;BR /&gt; 3. The locations of DLLs, needed by the newly built application, if any.&lt;BR /&gt;&lt;BR /&gt; 4. The locations of configuration files and data files needed by the package, if any.&lt;BR /&gt;&lt;BR /&gt;Providing the information can be by changing settings in VisualStudio, by specifying in build commands, and by environmental variables, or some combination of these three ways.</description>
      <pubDate>Thu, 03 Nov 2011 07:55:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802567#M38474</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-11-03T07:55:56Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802568#M38475</link>
      <description>my netcdf folder has the following files :&lt;DIV&gt;&lt;PRE&gt;[bash]hdf5dll.dll
hdf5_hldll.dll
ncdump.exe
ncgen.exe
netcdf.dll
netcdf.h
netcdf.inc
netcdf.lib
netcdf.mod
netcdf_f90.lib
szip.dll
typesizes.mod
zlib1.dll[/bash]&lt;/PRE&gt; &lt;/DIV&gt;&lt;DIV&gt;I indicated this folder for includes, modules, and library files&lt;/DIV&gt;&lt;DIV&gt;and in Visual Studio options I clearly indicated two lib files : netcdf.lib and netcdf_f90.lib&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I considered that these .lib files are static libraries for netcdf, is not it?&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Nov 2011 09:52:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802568#M38475</guid>
      <dc:creator>coolweather</dc:creator>
      <dc:date>2011-11-03T09:52:56Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802569#M38476</link>
      <description>No, the .lib files are most probably so-called import libraries. On Windows a DLL is typically accompanied&lt;BR /&gt;by such an import library, because the linker does not handle the DLLs directly.&lt;BR /&gt;&lt;BR /&gt;You will need a specific set of static netcdf libraries instead.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Thu, 03 Nov 2011 10:21:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802569#M38476</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-11-03T10:21:04Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802570#M38477</link>
      <description>&lt;I&gt;&amp;gt;I considered that these .lib files are static libraries for netcdf, is not it?&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;I do not know the specifics of the NetCDF package, but here are some guidelines. Look at the sizes of the DLL and the corresponding LIB file. If the DLL is much larger than the LIB, the latter is probably just an import library for the DLL. You may also run DUMPBIN /disasm on the .lib file. For an import library, you will see no assembly code at all, but information such as the following:&lt;BR /&gt;&lt;BR /&gt;COFF SYMBOL TABLE&lt;BR /&gt;000 009C766F ABS notype Static | @comp.id&lt;BR /&gt;001 00000000 SECT2 notype External | &amp;#127;MATH_NULL_THUNK_DATA&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Nov 2011 11:32:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802570#M38477</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-11-03T11:32:36Z</dc:date>
    </item>
    <item>
      <title>Linking NETCDF on Windows OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802571#M38478</link>
      <description>thank you for explanation! these are import libraries for the DLL; now I understand</description>
      <pubDate>Thu, 03 Nov 2011 13:09:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-NETCDF-on-Windows-OS/m-p/802571#M38478</guid>
      <dc:creator>coolweather</dc:creator>
      <dc:date>2011-11-03T13:09:03Z</dc:date>
    </item>
  </channel>
</rss>

