- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm working on a solution in Visual Studio 2003 with Intel Fortran 9.1 Compiler, which has C and Fortran projects. In our C projects, we provide an option to link to an optional external library through a header define, and an environmental variable. Specifically, the header looks something like:
#define USE_EXT_LIB 1
and in the Project settings, we have included the macro "$(PROJ_EXT_LIBNAME)" in the Linker input field. The users define PROJ_EXT_LIBNAME to something like extlib.lib
To disable the library, users simply comment the header definition, and don't define PROJ_EXT_LIBNAME in their environment. When Visual Studio encounters this undefined macro, it replaces it with an empty string, and skips it.
I'd like to do the same kind of thing with our Intel Fortran projects. For the most part, it does work similarly. However, when disabling the external library (and so the PROJ_EXT_LIBNAME macro isn't defined), Intel Fortran doesn't treat the undefined macro the same. Instead, it keeps the macro intact, and produces the error:
Fatal error: cannot open "$(PROJ_EXT_LIBNAME) "
Is there a way to revert to the way Visual Studio handles this by default? Is there a better syntax that I should be using instead? Or is this a bug in the Intel Fortran compiler?
#define USE_EXT_LIB 1
and in the Project settings, we have included the macro "$(PROJ_EXT_LIBNAME)" in the Linker input field. The users define PROJ_EXT_LIBNAME to something like extlib.lib
To disable the library, users simply comment the header definition, and don't define PROJ_EXT_LIBNAME in their environment. When Visual Studio encounters this undefined macro, it replaces it with an empty string, and skips it.
I'd like to do the same kind of thing with our Intel Fortran projects. For the most part, it does work similarly. However, when disabling the external library (and so the PROJ_EXT_LIBNAME macro isn't defined), Intel Fortran doesn't treat the undefined macro the same. Instead, it keeps the macro intact, and produces the error:
Fatal error: cannot open "$(PROJ_EXT_LIBNAME) "
Is there a way to revert to the way Visual Studio handles this by default? Is there a better syntax that I should be using instead? Or is this a bug in the Intel Fortran compiler?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just so I understand - the users define an environment varianle PROJ_EXT_LIBNAME to define the name of the library to link in? It sounds as if you've found a difference in the way the Fortran and C++ projects behave and I'd encourage you to report this to Intel Premier Support (please include a small constructed example demonstrating it.) The difference regards what happens with an undefined environment variable.
In Fortran, you could have the users type in an OBJCOMMENT directive in the include file, such as:
!DEC$ OBJCOMMENT:"LIB:extlibname.lib"
In Fortran, you could have the users type in an OBJCOMMENT directive in the include file, such as:
!DEC$ OBJCOMMENT:"LIB:extlibname.lib"

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page