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

Specifying Libraries for different configurations

dannycat
New Contributor I
1,194 Views

I am trying to set up a project that can create both 32 & 64 bit versions ofan application. The application has tolinkseveral static libraries and in the 32 bit version these were explicitly added to the project. However if I want to switch to 64 bit configuration I would have to change the libaries to 64 bit versions. I thought that I could get round this by specifying the directories of the appropriate libraries in the Linker Additional Library Directories option in the IDE, and removing the .lib files from the project. This did not work however.Do I have to tell the linkerthe names of the libraries somewhere?

Any help would be appreciated.

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,194 Views
Yes, you must give the names of the libraries. You can do this across all configurations as "Additional dependencies" in the Linker > Input property page, and then give a platform-specific path for just the 32-bit and just the 64-bit configurations in the "additional library directories" property.
Another option is to use Tools > Intel Fortran > Compiler to add the paths to Library Files, being sure to select 32-bit or 64-bit first. You will still need to add the names of the libraries under Additional Dependencies.

View solution in original post

0 Kudos
7 Replies
Steven_L_Intel1
Employee
1,195 Views
Yes, you must give the names of the libraries. You can do this across all configurations as "Additional dependencies" in the Linker > Input property page, and then give a platform-specific path for just the 32-bit and just the 64-bit configurations in the "additional library directories" property.
Another option is to use Tools > Intel Fortran > Compiler to add the paths to Library Files, being sure to select 32-bit or 64-bit first. You will still need to add the names of the libraries under Additional Dependencies.
0 Kudos
dannycat
New Contributor I
1,194 Views
Yes, you must give the names of the libraries. You can do this across all configurations as "Additional dependencies" in the Linker > Input property page, and then give a platform-specific path for just the 32-bit and just the 64-bit configurations in the "additional library directories" property.
Another option is to use Tools > Intel Fortran > Compiler to add the paths to Library Files, being sure to select 32-bit or 64-bit first. You will still need to add the names of the libraries under Additional Dependencies.

Thanks Steve. That worked.

I have noticed that where I had mixed language libraries that were converted to two components, (one fortran and one C) the settings for the output for the C routines does not change to x64Debug when you change configuration and the 32 bit files are overwrittenin the Debug directory. I got round this by changing the settings by hand. Is this something that could be fixed in the conversion routine or is it because it is a Microsoft issue?

I now get lots of unresolved externals when trying to link the x64.Do I need to changethe calling conventions for strings for x64 configurations?

0 Kudos
Steven_L_Intel1
Employee
1,194 Views

What I have seen is that sometimes, and I can't explain why, when I create an x64 configuration for a multi-project solution, only some of the projects get their platform changed. I end up going into Configuration Manager and setting each project to the proper target.

There is only one calling convention for x64. If you have code that assumes STDCALL, or assumes a leading underscore, then that will need to be adjusted as x64 has neither of those. The DECORATE attribute in !DEC$ ATTRIBUTES handles this.

0 Kudos
dannycat
New Contributor I
1,194 Views

What I have seen is that sometimes, and I can't explain why, when I create an x64 configuration for a multi-project solution, only some of the projects get their platform changed. I end up going into Configuration Manager and setting each project to the proper target.

There is only one calling convention for x64. If you have code that assumes STDCALL, or assumes a leading underscore, then that will need to be adjusted as x64 has neither of those. The DECORATE attribute in !DEC$ ATTRIBUTES handles this.

Steve, regarding the second part of the above thread, I have the same settings as those in the 32-bit version. It looks as though all calls involving a string argument are being listed. These are fortran calling fortran. Do I need to change the settings for string arguments for 64-bit conventions?

0 Kudos
Steven_L_Intel1
Employee
1,194 Views

No - the string length passing is the same. Of course, 64-bit lengths are passed so if you are calling C routines that expect a length, they should be declared size_t or something like that rather than int.

What do you mean by "being listed"?

0 Kudos
dannycat
New Contributor I
1,194 Views

No - the string length passing is the same. Of course, 64-bit lengths are passed so if you are calling C routines that expect a length, they should be declared size_t or something like that rather than int.

What do you mean by "being listed"?

Steve, I meant that all references to subroutines with string arguments were listed as being unresloved externals. These are fortran files within the same solution although in different projects. The solution compiles and links fine in the 32 bit configuration. I use the same solution for both configuations.

0 Kudos
Steven_L_Intel1
Employee
1,194 Views

I can't think of why that should be, as there's no argument list length indicator on x64. Can you show an example of the error message with an unresolved symbol? My guess is that there's something else going on here. Of course, if you can provide a small but complete example that shows the problem, that would be best.

0 Kudos
Reply