- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everybody,
I use intel visual fortran composer xe 2013 with VS2012.
I have 3 questions:
1-I have a problem debugging a simple fortran code that calls a C function. When i compile the fortran code on VS2012 i get the following message: Error 2 error LNK2019: unresolved external symbol _print_C referenced in function _MAIN__ Source1.obj. I attached the fortran and c files.
2-When i compile any fortran code on VS2012 i have no problem at all, but if i use a command prompt and type ifort example.f90 i receive the following message 'ifort' is not recognized as an internal or external command. I know i should do something to link ifort into compiling with a command prompt window but i don't know what it is. I read the documentation and i couldn't find what i need.
3-I bought the fortran composer xe like 2 years ago, now i was checking and there's something called parallel xe 2015, so is this the new version of composer xe or something different ?
Thanks in advance,
Li
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Your sources are fine. You probably haven't configured the Fortran and C projects to build together. Both projects should be in the same Visual Studio solution. Right click on the Fortran project, select Build Dependencies > Project Dependencies. Check the box for "Depends on" for your C static library project (you do need to make the C project a static library).
2. You need to run the environment script to establish all the environment variables. We provide shortcuts to do this under Start > All Programs > Intel Parallel Studio XE > Compiler and Performance Libraries > Command Prompt...
3. It's a name change.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Your sources are fine. You probably haven't configured the Fortran and C projects to build together. Both projects should be in the same Visual Studio solution. Right click on the Fortran project, select Build Dependencies > Project Dependencies. Check the box for "Depends on" for your C static library project (you do need to make the C project a static library).
2. You need to run the environment script to establish all the environment variables. We provide shortcuts to do this under Start > All Programs > Intel Parallel Studio XE > Compiler and Performance Libraries > Command Prompt...
3. It's a name change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you install ifort, there will be a shortcut (on the Start menu, for win7 and earlier) to open a cmd prompt with both the ifort and (if a qualifying Visual Studio was present during install) the CL paths set up.
Then a sequence such as
cl -c hello.c
ifort source1.f90 hello.obj
should build a working source1.exe.
The document about how to use ifort in Visual Studio should explain how to set up a C project as a dependency of a Fortran project.
Yes, the xe2015 releases are current; next week xe2016 is due for release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve, the fortran and C code is working now, thanks. However, regarding my second question ifort command in a command prompt still not working i still receive 'ifort' is not recognized as an internal or external command. When i open the folder Composer XE2013 Sp1/compiler i have two other folders include and lib there's no command prompt file that i can use here.
Tim thanks, I'm using windows 8.1 and intel visual composer xe 2013 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What I said was to use the shortcut in the Start menu under Intel Parallel Studio XE 2013 SP1 > Command Prompt (this may be under another level). Alternatively, from any command prompt, type"
call "%IFORT_COMPILER14%\bin\ifortvars,bat" intel64 vs2012
This will set up the environment for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much Steve !!

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