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

Entry point not located

Jose_M_
Beginner
1,233 Views

Hi all,

I am trying to run a program to create netcdf file that I wrote some time ago but now I am getting some errors. The difference now is that I am using Visual Studio 2013 and Intel parallel studio XE 16. Before I was using Visual Studio 2008 and Intel Composer XE 2013. I have tried both combinations and I am getting the same message with both:

"The procedure entry point nc_inq_varids could not be located in the dynamic link library netcdf.dll."

I must add that just few days ago I did a test using VS2008/Intel Composer XE 2013 and I could make it run successfully. So I don't know if I got any update in Windows that changed the settings. I've been checking similar threads in this forum but I didn't see any specific to fix it. As far as I remember, I didn't change any setting and the libraries are linked in the project.

Please find attached the BuildLog if it's of any help. I am far away of being a software developer, so maybe there is something really basic that I am missing.

I am using a dll library that was created by another user in this forum, that helped me out (see https://software.intel.com/en-us/comment/1816799#). As I said, I used this library successfully some time ago, so it shouldn't be the cause of the problem.

Any help would be more than welcome.

Cheers.

 

0 Kudos
1 Solution
mecej4
Honored Contributor III
1,233 Views

On my computer, the program (I changed the path of the data file to match) runs fine and returns ncid = 65536. I don't understand why you chose to do READ ncid instead of PRINT ncid after the NetCDF call.

I suspect that you have a corrupt PATH environment variable. The Windows error 0xC000007B is usually attributable to attempting to use a 64-bit DLL from a 32-bit program or vice versa.

View solution in original post

0 Kudos
13 Replies
mecej4
Honored Contributor III
1,233 Views

It has been a long time since I did anything with Netcdf, but I suspect that the missing external is to be found in the Netcdf C library, netcdf.lib, rather than in the Fortran library, netcdff.lib. As is typical of many libraries written for calling mainly from C, with an added interface/wrapper library between Fortran and C, it is not sufficient to include just the Fortran library in the link command.

0 Kudos
Xiaoping_D_Intel
Employee
1,233 Views

If you are using the DLL from the user forum post it depends on another DLL "netcdf.dll" at runtime. The error shows this these two dll's are not compatible with each other. The "readme" file in the forum post zip says it was build from NetCDF 4.4. According to https://www.unidata.ucar.edu/software/netcdf/docs/dgroup_8c.html function "nc_inq_varids" is one of the functions for netCDF-4 features so the "netcdf.dll" in your runtime environment must be older than version 4.

If you made it run some days ago on other system please make sure you are using the same copy of "netcdf.dll" now. Another better solution is to use the dlls and libs from the same NetCDF build.

 

Thanks,

Xiaoping Duan

Intel Customer Support

 

0 Kudos
Jose_M_
Beginner
1,233 Views

Thank you for your comments.

Yes, I think the problem is the netcdf.dll file. I tried with several versions, and now I am getting a different error:

"The application was unable to star correctly (0xc000007b)".

Apparently this is related to 32bit apps trying to execute on a 64bit system. How can I fix it? As I said, I'm not a software developer, so sorry for any silly question.

Cheers.

0 Kudos
mecej4
Honored Contributor III
1,233 Views

I tried the six Fortran 90 examples at http://www.unidata.ucar.edu/software/netcdf/examples/programs/ , and was able to build and run all of them successfully using Intel Fortran 15 and the prebuilt binaries/libraries/headers of NetCDF 4.3.3.1 of Feb 27 2015.

I tried to do the same with the F77 versions of the examples, but saw errors caused by "IMPLICIT NONE" and missing type declarations in netcdf.inc for various NetCDF Fortran functions starting with "n". I suppose this could be resolved by rebuilding all of NetCDF using the current release, but I do not feel inclined to do so at this time. That I no longer have CMAKE installed on my current system is another roadblock.

There may be compatibility problems if NetCDF libraries of different release dates are used in combination. If you can post example source code that causes a build to fail, perhaps I can help.

0 Kudos
mecej4
Honored Contributor III
1,233 Views

Jose M. wrote:

Yes, I think the problem is the netcdf.dll file. I tried with several versions, and now I am getting a different error:

"The application was unable to star correctly (0xc000007b)".

Apparently this is related to 32bit apps trying to execute on a 64bit system. How can I fix it? As I said, I'm not a software developer, so sorry for any silly question.

Cheers.

You need 32-bit versions of libraries and DLLs if your application is 32-bit. You cannot mix 32-bit EXEs with 64-bit DLLs, nor can you mix 64-bit EXEs with 32-bit DLLs (there are exceptions, but those are not relevant to user programs).

On a 32-bit system, you cannot run 64-bit EXEs and DLLs.

0 Kudos
Jose_M_
Beginner
1,233 Views

mecej4 wrote:

 was able to build and run all of them successfully using Intel Fortran 15 and the prebuilt binaries/libraries/headers of NetCDF 4.3.3.1 of Feb 27 2015.

There may be compatibility problems if NetCDF libraries of different release dates are used in combination. If you can post example source code that causes a build to fail, perhaps I can help.

I am using, I think, the same library NetCDF 4.3.3.1 of Feb 27 2015, and the Netcdff library that you built some time ago (thanks again). But I keep having the same error. I am afraid that I don't know how to use CMAKE, so I don't think I would be able to build my own library. As I said, I'm not an expert in the field.

I wrote a new program from scratch and I am still having the same error. I copy the code below and attach the build log if it's of any help.

I am working with VS2013 and Intel Visual Fortran Compiler 16.0, so I guess it shouldn't be a problem working on a 64 bit Windows system, right?

Regards,

Jose

Program Test

use netcdf

character(len=100) :: f

integer :: ncid, ferror

f = "C:\GWAVANetCDF\LWdown_daily_WFDEI_197901.nc"

ferror=nf90_open(f,nf90_nowrite,ncid)

if(ferror/=nf90_noerr) Print *,"Reading ",f

Read*,ncid

End

0 Kudos
mecej4
Honored Contributor III
1,233 Views

There should be no problems with building a 32-bit EXE on a 64-bit system.

The build-log that you attached in #7 shows a successful build. What gives ?

I put the lines of code in #7 into file tst.f90, and built the program with the command

ifort /Od tst.f90 netcdff.lib netcdf.lib

on my Windows 10 Pro-X64 system, using the Intel 15 32-bit compiler. The EXE was produced with no error messages, but I could not run the program because I do not have the file that it wants to open and read.

0 Kudos
Jose_M_
Beginner
1,233 Views

mecej4 wrote:

The build-log that you attached in #7 shows a successful build. What gives ?

Yes, the build is successful, but I get the error when I try to run the program. I attached the error message and a small netcdf file as a sample. I tried to run the code on #7 to read this file and I got that same error.

Any help will be appreciated.

Regards,

Jose

 

 

 

0 Kudos
Jose_M_
Beginner
1,233 Views

mecej4 wrote:

I suspect that you have a corrupt PATH environment variable. The Windows error 0xC000007B is usually attributable to attempting to use a 64-bit DLL from a 32-bit program or vice versa.

Thanks again for your answer! That makes a lot of sense to me, but I don't know which is the correct path. I checked the PATH environment variable, and this is what is set right now:

%INTEL_DEV_REDIST%redist\intel64_win\mpirt;%INTEL_DEV_REDIST%redist\ia32_win\mpirt;%INTEL_DEV_REDIST%redist\intel64_win\compiler;%INTEL_DEV_REDIST%redist\ia32_win\compiler;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Novell\ZENworks\bin;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Skype\Phone\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Anaconda2;C:\Anaconda2\Scripts;C:\Anaconda2\Library\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\

Anything wrong here?

Cheers.

 

 

0 Kudos
IanH
Honored Contributor II
1,233 Views

Is that the path as seen at a command prompt, or did you copy that out of the System Properties applet?  If the latter, what does echo %PATH% show at a command prompt?  If you see unexpanded environment variables in the path as viewed from within the command prompt, then your system path is too long.

If you do need to make the path shorter there are some directory entries that are duplicated.

0 Kudos
Jose_M_
Beginner
1,233 Views

ianh wrote:

Is that the path as seen at a command prompt, or did you copy that out of the System Properties applet?  If the latter, what does echo %PATH% show at a command prompt?  If you see unexpanded environment variables in the path as viewed from within the command prompt, then your system path is too long.

If you do need to make the path shorter there are some directory entries that are duplicated.

Yes! That was it! I removed some paths and now it's working! Thanks to both mecej4 and IanH for pointing to the path environment variable!

I hope I don't get any more errors :)

Regards.

0 Kudos
mecej4
Honored Contributor III
1,233 Views

The %path% that you displayed in #11 does not contain any strict duplicates, but does include eight parts that pertain to various versions of SQL Server. Unless you are doing something special or database-specific, you require at most one of these; if you do not do database work, you may need none of these.

0 Kudos
mecej4
Honored Contributor III
1,234 Views

On my computer, the program (I changed the path of the data file to match) runs fine and returns ncid = 65536. I don't understand why you chose to do READ ncid instead of PRINT ncid after the NetCDF call.

I suspect that you have a corrupt PATH environment variable. The Windows error 0xC000007B is usually attributable to attempting to use a 64-bit DLL from a 32-bit program or vice versa.

0 Kudos
Reply