- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am new to using Intel's ifx compiler. I am a scientist who does some programming (mostly C and Python these days). My fortran knowledge has been, until now, limited to F77. So, there is a lot for me to learn. I am doing a port of some Fortran 9x code written by some collaborators to run under Linux. The most recent versions of their program were developed under Windows.
The Fortran 9x code compiles well with ifx, but when it comes to linking, I get errors which look like this:
ChargeDen.f90:(.text+0x17): undefined reference to `basic_mod_mp_kphase_'
ld: ChargeDen.f90:(.text+0x24): undefined reference to `basic_mod_mp_nphase_'
ld: ChargeDen.f90:(.text+0xf3): undefined reference to `basic_mod_mp_kphase_'
There is a module called "Basic_mod" and in the Basic_mod.f90 source file, the corresponding variable declarations look like this:
integer :: NPhase=1,KPhase=1,KPhaseBasic=1,maxNDim,maxNDimI,MaxNComp
There seems to be a mismatch in what the ifx compiler produces and the what the GNU linker expects. My question is how do I get the compiler and linker to agree on name mangling (or lack thereof). In my ideal world, I am hoping I can use a compiler option (or linker option) to solve the problem. I haven't been able to find one on my own.
Thanks for any guidance. Apologies in advance if this question is an obvious RTFM or an uber-noobie question.
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not an uncommon question. When the source for module basic_mod is compiled, the compiler generates two files: a .mod, which is used by the compiler when you USE the module, and a .o that must be supplied to the linker. Make sure you add the name of the .o file (it will depend on the source file name) to your ld command.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not an uncommon question. When the source for module basic_mod is compiled, the compiler generates two files: a .mod, which is used by the compiler when you USE the module, and a .o that must be supplied to the linker. Make sure you add the name of the .o file (it will depend on the source file name) to your ld command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Steve. That seems to have done the trick. I just need to clean up a few more itinerant modules and their .o files.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page