Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
56 Views

Link NetCDF Fortran library to Visual Studio 2008 / Intel Composer XE 2013

Jump to solution

Dear all,

I am trying to create NetCDF files in Fortran using VS2008 and Intel Composer XE 2013 as compiler.

I tried with different pre-built libraries that I found on the web, and I managed to link the libraries to the program, so now I can compile the program without errors. The problem is that the program doesn't recognizes the commands of the library, so it doesn't work at all...

Any idea about how to fix it?

Thanks,

Jose

0 Kudos

Accepted Solutions
Highlighted
Black Belt
46 Views

I think that the build process for the Fortran library for NetCDF is rather delicate, and likely to fail if all the dependencies do not form a compatible set. I downloaded netcdf-fortran-4.4.0.tar.gz and tried to build the Fortran library. The only combination that worked was from using Intel 14.0.4.237 (not the current version)  and cmake -G "NMake Makefiles". Even that failed at the link step with unresolved _nc_create_par_fortran, _nc_open_par_fortran, _nc_var_par_access, _ncerr and  _ncopts. I built the DLL by supplying dummy C code for those routines, and could build some of the Fortran examples using the DLL and the import library. I could also build the example in #6 after I added a main program that simply called the subroutine.

For what it is worth, I have attached the DLL, LIB and MOD files. Before using the files, please run a virus check on them, for your protection.

 

View solution in original post

0 Kudos
22 Replies
Highlighted
Black Belt
46 Views

The problem is that the program doesn't recognizes the commands of the library, so it doesn't work at all.

I do not understand that at all. Libraries do not issue commands, they provide precompiled subprograms/functions that your application link to. Some of those subprograms in the library can very well interpret and execute commands. Please provide a specific example, making it clear what you mean by "doesn't recognize" and "doesn't work".

0 Kudos
Highlighted
Black Belt
46 Views

If you have found a dll which works correctly with Ifort you still need to add its folder to path.  Net cdf instructions and maybe Intel's own pages about netcdf Should cover this.

0 Kudos
Highlighted
Beginner
46 Views

mecej4 wrote:

Libraries do not issue commands, they provide precompiled subprograms/functions that your application link to. Some of those subprograms in the library can very well interpret and execute commands.

Maybe that's the part that I am missing. How can I link my program to these subprograms/functions provided by the libraries? Sorry but I am new in Fortran and maybe I am missing something basic and not using the proper terminology. I am used to Python, where you import a module and the you can use directly all the functions of that module. In this case, what I mean when I say that the program doesn't recognize the commands is that when I try to call a function (nf90_create()) of the netCDF interface as in the example they provide in the documentation,  it doesn't change the colour (so it doesn't recognize it as a function). And when I try to build the program, I get an error . You can find below the code (very simple) and the log that I get after trying to build the program.

subroutine create_netcdf


use netcdf

implicit none
integer :: ncid, status


test = nf90_create(path= "foo.nc",cmode = nf90_noclobber, ncid = ncid)
if (status/=nf90_noerr) call handle_err(status)


print * , "testing"

end subroutine create_netcdf

 

Here you can find my log when I try to build the program.

Compiling with Intel(R) Visual Fortran Compiler XE 14.0.3.202 [IA-32]...
ifort /nologo /debug:full /Od /fpp /warn:interfaces /assume:byterecl /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\create_netcdf.f90"
C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\create_netcdf.f90(10): error #6404: This name does not have a type, and must have an explicit type.   [TEST]
test = nf90_create(path= "foo.nc",cmode = nf90_noclobber, ncid = ncid)
^
compilation aborted for C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\create_netcdf.f90 (code 1)


Postpmres - 2 error(s), 0 warning(s)

 

Thanks for any help

 

0 Kudos
Highlighted
Black Belt
46 Views

it doesn't change the colour (so it doesn't recognize it as a function).
Fortran is colorblind. You could input the same program from cream-colored punch cards or spinach-green paper tape or an amber CRT terminal, and Fortran would not know the difference. If you are using an IDE or an editor that does syntax coloring, remember that its understanding of Fortran may not agree with that of the compiler, especially if that IDE is used for many other languages in addition to Fortran.

Fortran is a compiled language (similar to C, Pascal, etc.). All variables, functions and subprograms should be available in one form or another before you can compile and link the source code (not strictly true, but let's keep things simple at first).

In your subroutine, you have IMPLICIT NONE. As a consequence, you have to declare the type of every variable and function name before you can use that variable or function. You should probably write "status =" instead of "test =". 

It may be yet one more error that you are using the value of NCID in the call to NetCDF without having assigned a value to it. unless NCID has INTENT(OUT) or INTENT(IN OUT) in the interface of NF90_CREATE().

0 Kudos
Highlighted
Beginner
46 Views

 

Thanks for your response!

Now I've changed the code to correct the mistakes and make it even simpler:

subroutine create_netcdf


use netcdf
implicit none
integer :: ncid, status

ncid = 1
status = NF90_CREATE(path= "foo.nc",cmode = nf90_noclobber, ncid = ncid)
if (status /= nf90_noerr) print * , "error"

print * , "testing"

end subroutine create_netcdf

When I try to build the program, I get the following error:

Error 1  error LNK2019: unresolved external symbol _NETCDF_mp_NF90_CREATE referenced in function _CREATE_NETCDF create_netcdf.obj 
 

How can I fix this? What am I missing now? Is it possible that there is something wrong in the library?

Thanks!

0 Kudos
Highlighted
Black Belt
46 Views

You have to have a main program in the list of Fortran routines in your project. You have to specify the NetCDF library/libraries in your project as "additional libraries". You have to specify the directory containing those libraries, as well. The specific paths and file names will have to agree with the locations and names of the NetCDF files that you have installed.

0 Kudos
Highlighted
Beginner
46 Views

mecej4 wrote:

You have to have a main program in the list of Fortran routines in your project. You have to specify the NetCDF library/libraries in your project as "additional libraries". You have to specify the directory containing those libraries, as well. The specific paths and file names will have to agree with the locations and names of the NetCDF files that you have installed.

Thanks for your comments!

Those are the steps that I followed and still not working. I contacted the library provider and apparently they are old and may not work on Visual Studio, so I will have to figure out another way to do my job.

Thanks anyway!

Regards,

Jose

0 Kudos
Highlighted
Black Belt
46 Views

Please see if this older article helps:

     https://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-netcdf-with-the-intel-compilers

 

0 Kudos
Highlighted
Valued Contributor II
46 Views

Recent distributions of NetCDF use the CMake build configuration tool, which makes it easier (but not entirely trivial) to build the library on various OSes. The older article only describes what to do on Linux and OSX.

Note however that the build process for Intel Fortran as implemented in NetCDF 4.3.2, the current version, is not all that straightforward. I have been struggling with it myself and though I can build it, it requires some manual intervention. I have not sat down yet to document this intervention, but I can probably concoct a receipe within the next few days.

0 Kudos
Highlighted
Black Belt
47 Views

I think that the build process for the Fortran library for NetCDF is rather delicate, and likely to fail if all the dependencies do not form a compatible set. I downloaded netcdf-fortran-4.4.0.tar.gz and tried to build the Fortran library. The only combination that worked was from using Intel 14.0.4.237 (not the current version)  and cmake -G "NMake Makefiles". Even that failed at the link step with unresolved _nc_create_par_fortran, _nc_open_par_fortran, _nc_var_par_access, _ncerr and  _ncopts. I built the DLL by supplying dummy C code for those routines, and could build some of the Fortran examples using the DLL and the import library. I could also build the example in #6 after I added a main program that simply called the subroutine.

For what it is worth, I have attached the DLL, LIB and MOD files. Before using the files, please run a virus check on them, for your protection.

 

View solution in original post

0 Kudos
Highlighted
Valued Contributor II
46 Views

Yes, I know - I have reported these things to the NetCDF people. Part of the problem is that they do not have access to the Intel Fortran compiler it seems. Interesting approach to provide dummy routines for the missing bits. They come mostly from the option to use the NetCDF 4 interface and you end up in a cul-de-sac: if you want NetCDF 4, you need to have the HDF5 library with support for parallel I/O, but that is not supported on Windows (at least not with MS Visual C++, if I read the CMake files correctly)

0 Kudos
Highlighted
Beginner
46 Views

Thanks a lot for your help!!

Unfortunately, still not working, maybe because I have a different compiler? Anyway, I'm trying to do the job with Python now, but thanks anyway, I'm sure it will be helpful for someone else!

Regards

0 Kudos
Highlighted
Beginner
46 Views

Thanks a lot for your help!!

Unfortunately, still not working, maybe because I have a different compiler? Anyway, I'm trying to do the job with Python now, but thanks anyway, I'm sure it will be helpful for someone else!

Regards

0 Kudos
Highlighted
Black Belt
46 Views

ArjenMarkus wrote:
Interesting approach to provide dummy routines for the missing bits.
You don't have to do so if you use static libraries. Unless you write an application that calls one of those missing routines, you will not have a problem. However, I prefer to use DLL libraries, and the linker will not build a DLL if there are missing externals (have not tried the /FORCE:unresolved option). Even if routine A in the DLL calls routine B, and your code calls neither A nor B, both must be present.

Each of my dummy routines prints a note to StdErr and calls exit(), so the program will abort if a missing routine is actually called.

0 Kudos
Highlighted
Black Belt
46 Views

Jose M. wrote:
Unfortunately, still not working, maybe because I have a different compiler?
Which compiler did you use, and what was the problem? DLLs can usually be used by different versions of the compiler that built them, and often even with other vendor's compilers as long as the ABI-s match.

0 Kudos
Highlighted
Valued Contributor II
46 Views

Of course. I was focused on getting the build system to do the Right Thing (tm). Just providing dummies and making sure that they can never cause erroneous results makes a lot of sense. Thanks.

0 Kudos
Highlighted
Beginner
46 Views

mecej4 wrote:

Which compiler did you use, and what was the problem?

The errors that I get when I try to build my project (Postpmres) where I am trying to create my program (create_netcdf):

Error 9  error LNK2019: unresolved external symbol _SYSTEM@8 referenced in function _CHECKFILE_OVERWRITE filetools.obj

 Error 10  error LNK2019: unresolved external symbol _NETCDF_mp_NF90_CREATE@24 referenced in function _CREATE_NETCDF create_netcdf.obj

Error 11  fatal error LNK1120: 2 unresolved externals Debug\Postpmres.exe 

I think I am getting a mess... Here is the log file:

Compiling with Intel(R) Visual Fortran Compiler XE 14.0.3.202 [IA-32]...
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\ReadHeader.F90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\julian.for"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\postprocessor.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\GWAVAInterfaces.F90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\filetools.F90"
C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\filetools.F90(440): warning #8043: The extra characters in the format specification will be ignored   ['(a9, i2, a8, i1))']
    write(vformat, "(a9, i2, a8, i1))") "i2,'. ',a", ilenm, ",':  ',a", ilen
------------------------------------^
C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\filetools.F90(442): warning #8043: The extra characters in the format specification will be ignored   ['(a9, i2, a8, i2))']
    write(vformat, "(a9, i2, a8, i2))") "i2,'. ',a", ilenm, ",':  ',a", ilen
------------------------------------^
C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\filetools.F90(444): warning #8043: The extra characters in the format specification will be ignored   ['(a9, i2, a8, i3))']
    write(vformat, "(a9, i2, a8, i3))") "i2,'. ',a", ilenm, ",':  ',a", ilen
------------------------------------^
C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\filetools.F90(557): warning #8043: The extra characters in the format specification will be ignored   ['(a5,i1))']
    write(vformat, "(a5,i1))") "19x,a", ilen
---------------------------^
C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\filetools.F90(559): warning #8043: The extra characters in the format specification will be ignored   ['(a5,i2))']
    write(vformat, "(a5,i2))") "19x,a", ilen
---------------------------^
C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\filetools.F90(561): warning #8043: The extra characters in the format specification will be ignored   ['(a5,i3))']
    write(vformat, "(a5,i3))") "19x,a", ilen
---------------------------^

ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\maptools.f90"
C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\maptools.f90(777): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
    106 format(e12.6,1x)
----------------^
C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\maptools.f90(972): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
    101 format(e12.6)
----------------^

ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\GWAVA50\tools.F90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\EnvironmentalFlows\eflows_ProcessIndicators.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Process_Statistics.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\EnvironmentalFlows\eflows_daily.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\plot_meananualflows.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\create_netcdf.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Process_MonthlyFlows.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\EnvironmentalFlows\eflows_CompareDimensions.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\EnvironmentalFlows\PostProcess_eflows.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Process_DecadFlows.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Process_DailyFlows.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\EnvironmentalFlows\eflows_out.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\GetTimeseries.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\EnvironmentalFlows\eflows_monthly.f90"
ifort /nologo /debug:full /Od /fpp /I"C:\Users\josmoy\Downloads\netcdf3.6.1\include" /I"C:\Users\josmoy\Downloads\NetCDFF\include\ia32" /warn:interfaces /assume:byterecl /iface:cvf /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc90.pdb" /traceback /check:bounds /libs:static /threads /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin" "C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\plot_meanseasonalflows.f90"
Linking...
Creating temporary file "RSP1.rsp" with contents
[
 /OUT:"Debug\Postpmres.exe" /VERBOSE:LIB /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Users\josmoy\Downloads\netcdf3.6.1\lib" /LIBPATH:"C:\Program Files (x86)\netCDF 4.3.3.1\lib" /LIBPATH:"C:\Users\josmoy\Downloads\NetCDFF\lib" /MANIFEST /MANIFESTFILE:"C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Debug\Postpmres.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Debug\Postpmres.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Debug\Postpmres.lib" netcdf.lib netcdf_f90.lib hdf.lib hdf5.lib hdf5_hl.lib jpeg.lib libcurl_imp.lib mfhdf.lib netcdf.lib xdr.lib zlib.lib zlibstatic.lib netcdff.lib "Debug\ReadHeader.obj" "Debug\julian.obj" "Debug\postprocessor.obj" "Debug\GWAVAInterfaces.obj" "Debug\filetools.obj" "Debug\maptools.obj" "Debug\tools.obj" "Debug\eflows_ProcessIndicators.obj" "Debug\Process_Statistics.obj" "Debug\eflows_daily.obj" "Debug\plot_meananualflows.obj" "Debug\create_netcdf.obj" "Debug\Process_MonthlyFlows.obj" "Debug\eflows_CompareDimensions.obj" "Debug\PostProcess_eflows.obj" "Debug\Process_DecadFlows.obj" "Debug\Process_DailyFlows.obj" "Debug\eflows_out.obj" "Debug\GetTimeseries.obj" "Debug\eflows_monthly.obj" "Debug\plot_meanseasonalflows.obj"
]
Creating command line "Link @"C:\GWAVA4VS2008\GWAVA4Jose\Postpmres\Debug\RSP1.rsp""

Link: executing 'link'

Searching libraries
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf_f90.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5_hl.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\jpeg.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\libcurl_imp.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\mfhdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\xdr.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlib.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlibstatic.lib:
    Searching C:\Users\josmoy\Downloads\NetCDFF\lib\netcdff.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\ifconsol.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifcoremt.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifport.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libmmt.lib:
    Searching c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\LIBCMT.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libirc.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\svml_dispmt.lib:
    Searching c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\IFWIN.LIB:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\ImageHlp.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf_f90.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5_hl.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\jpeg.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\libcurl_imp.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\mfhdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\xdr.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlib.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlibstatic.lib:
    Searching C:\Users\josmoy\Downloads\NetCDFF\lib\netcdff.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\ifconsol.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifcoremt.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifport.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libmmt.lib:
    Searching c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\LIBCMT.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libirc.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\svml_dispmt.lib:
    Searching c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\IFWIN.LIB:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\ImageHlp.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf_f90.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5_hl.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\jpeg.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\libcurl_imp.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\mfhdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\xdr.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlib.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlibstatic.lib:
    Searching C:\Users\josmoy\Downloads\NetCDFF\lib\netcdff.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\ifconsol.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifcoremt.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifport.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libmmt.lib:
    Searching c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\LIBCMT.lib:

Finished searching libraries

Searching libraries
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf_f90.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5_hl.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\jpeg.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\libcurl_imp.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\mfhdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\xdr.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlib.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlibstatic.lib:
    Searching C:\Users\josmoy\Downloads\NetCDFF\lib\netcdff.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\ifconsol.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifcoremt.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifport.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libmmt.lib:
    Searching c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\LIBCMT.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libirc.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\svml_dispmt.lib:
    Searching c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\IFWIN.LIB:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\ImageHlp.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf.lib:
    Searching C:\Users\josmoy\Downloads\netcdf3.6.1\lib\netcdf_f90.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\hdf5_hl.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\jpeg.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\libcurl_imp.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\mfhdf.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\xdr.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlib.lib:
    Searching C:\Program Files (x86)\netCDF 4.3.3.1\lib\zlibstatic.lib:
    Searching C:\Users\josmoy\Downloads\NetCDFF\lib\netcdff.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\ifconsol.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifcoremt.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libifport.lib:
    Searching C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32\libmmt.lib:

Finished searching libraries
filetools.obj : error LNK2019: unresolved external symbol _SYSTEM@8 referenced in function _CHECKFILE_OVERWRITE
create_netcdf.obj : error LNK2019: unresolved external symbol _NETCDF_mp_NF90_CREATE@24 referenced in function _CREATE_NETCDF
Debug\Postpmres.exe : fatal error LNK1120: 2 unresolved externals


Postpmres - 3 error(s), 6 warning(s)


 

0 Kudos
Highlighted
Black Belt
46 Views

You have used /iface:cvf, which specifies using the Compaq/DEC Stdcall convention rather than the Intel calling convention. Was that done because the NETCDF or other library that you downloaded specified it? If not, is there a reason to use /iface:cvf? 

If you compile your code using /iface:cvf, you will not be able to link to the library or use the DLL that I provided.

0 Kudos
Highlighted
Beginner
46 Views

mecej4 wrote:

You have used /iface:cvf, which specifies using the Compaq/DEC Stdcall convention rather than the Intel calling convention.

Sorry for that!!! I tried so many things and did so many changes, some of them blindly, that I knew that would be part of the problem. So I started from zero again, linked your library and.. that was it!!! Now it works!!! Thanks a lot! You made my day, my week and my whole month!

0 Kudos