Problem with static link to acml library with version 8.0-1

I have a program which I have been running under version 7… which now needs to be recompiled underversion 8.0-? I have always compiled with the -Bstatic option and used the ACML library libacml.lib. This no longer works as I get linking error messages about the library. On the other hand if I do the build with the -Bdynmaic option and the appropriate libacml_dll.lib the program compiles and runs fine. Has anyone else had this problem? I have tried tech support and as usual I have gotten NO response

Charles

Hi Charles,

Which version 7 are you using? Also can you please give a few more details as to the error that you’re seeing?

Since we didn’t add “-Bstatic” until 7.1, I’ll assume you’re using version 7.1 or 7.2. However, in both cases I get the same missing symbols error when trying to link “-Bstatic libacml.lib” as I do with 8.0-4. The errors occur because the static ACML library contains reference to the dynamic Microsoft C runtime library. If you link with “-Bdynamic libacml.lib”, the ACML library will be linked statically but will be linked with “mscvrt.dll” (dynamic MS C runtime) versus “libcmt.lib” (static MS C runtime).

I have tried tech support and as usual I have gotten NO response

I just looked through Customer Services emails but haven’t seen one from you since October 2008. How did you try to contact PGI Customer Service? Did you use the support email address trs@pgroup.com?

Hope this helps,
Mat

In response to Mat’s request for information about the error messages.

The following command line:
pgf95 testrng.f95 -lacml

produced the following errors:
libacml.lib(acmlgetenv.obj) : warning LNK4217: locally defined symbol free imported in function acmlgetenv_
libacml.lib(acmlgetenv.obj) : warning LNK4217: locally defined symbol getenv imported in function acmlgetenv_
libacml.lib(acmlgetenv.obj) : warning LNK4217: locally defined symbol strncpy imported in function acmlgetenv_
libacml.lib(acmlputenv.obj) : warning LNK4217: locally defined symbol strncpy imported in function acmlputenv_
libacml.lib(acmlgetenv.obj) : warning LNK4217: locally defined symbol malloc imported in function acmlgetenv_
libacml.lib(acmlputenv.obj) : warning LNK4217: locally defined symbol malloc imported in function acmlputenv_
libacml.lib(acmlcpuid.obj) : warning LNK4217: locally defined symbol strncmp imported in function acmlcpuid
libacml.lib(acmlputenv.obj) : error LNK2019: unresolved external symbol _imp_putenv referenced in function acmlputenv
oldnames.lib(putenv.obi) : error LNK2001: unresolved external symbol __imp_putenv
libacml.lib(acmlputenv.obj) : error LNK2019: unresolved external symbol _imp_strncat referenced in function acmlputenv
oldnames.lib(putenv.obi) : error LNK2001: unresolved external symbol __imp__putenv
testrng.exe : fatal error LNK1120: 3 unresolved externals

Charles

Hi Charles,

Yes, these are the same errors I see and are caused by libacml.lib’s dependency on MS dynamic C runtime library (msvcrt.dll). With the 7.0 compilers we did not support static linking to the the MS C runtime (libcmt.lib) and is why you did not encounter this problem earlier.

I’ll send a note to my contact’s at AMD to see if they can remove these dependencies in a future release.

  • Mat