- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compile a large multi-language simulation, a portion of which is Fortran. I am trying to optimizea subset of this Fortran code with the IPO but am getting multiply definedcommon blockissues. I am following the rules for common block initialization so I don't understand what's wrong.
Example:
file1.f has lines:
include 'tables.cmn'...x = A(3)*y...
fileA.f has lines to initialize the tables.cmn data
BLOCKDATAINIT_TBLinclude 'tables.cmn'! initialize tables.cmn dataDATA A /1,2,3,4/DATA B /1,2,3,4/
tables.cmn looks like:
integer A(4)integer B(4)common /tables/A,B
Compile command:
...
ifort -ipo_c file1.f file2.f file3.f file4.f -o temp.o
IPO: performing multi-file optimizations
IPO: generating object file temp.o
ifort: warning: multi-file optimation .o file produced; no link
...
ifort -c fileA.f -o fileA.o
ifort -c fileB.f -o fileB.o
icpc -c fileAA.cpp -o fileAA.o
...
icpc *.o -o simulator.exe
temp.o: (hex address) multiple definition of 'tables_'
fileA.o: first defined here
ld: Disabling relaxation: it will not work with multiple definitions
Itworks if I compile fileA.f with the command:
ifort -ipo_c -c fileA.f -o fileA.o
Unfortunately, I have about20 other files that have this same problem, and due to some post-compile object file manipulations, the solution cannot be worked in this manner.
Manual isn't clear on linking some .f with -ipo_c and some without. I am missing something?
Link Copied
0 Replies
![](/skins/images/7B0AB6865064EAE32B30EC9A4E94B48A/responsive_peak/images/icon_anonymous_message.png)
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