Changing extension of compiled libs and obj files under win

Is there a way of telling the pgi compiler (c,C++) to edit and work with *.o files instead of *.obj, and with *.a files instead of *.lib files under Windows7. I use the command shell (cygwin) and have to compile a linux based programm package. All the make files refer to *.o and *.a files and I would have to change them by hand. Of course I do not know if a general change of the extensions would cause problems with the other PGI system files that have the extension *lib?

Hi a_bra,

Is there a way of telling the pgi compiler (c,C++) to edit and work with *.o files instead of *.obj, and with *.a files instead of *.lib files under Windows7.

Set the environment variable “PGI_OBJSUFFIX=o” to change the default object suffix.

The library extension is a bit more tricky since MS’s link is use to create the libraries and perform the final link step. If you are using the “-l” flag, this will get resolved to “libname.lib”. When using an “.a” suffix, you need to put the fully qualified path to the library on the link line. However, the better option here is to use a makefile variable for library extension names so either “.lib” or “.a” could be used. Hopefully this will only require a few changes in your makefile.

  • Mat