- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I could compile my code with ifort11.1 on Linux and created a library successfully. Now I can link my other programs with the library on Linux. i was trying to perform the same task on Leopard with the same version of ifort. I could compile the code and create libs on Leopard but can not link!!!
f90 flags to create the lib:
F90FLAGS =-i-static -assume nounderscore -g -c
ar r libmy.o *.o
ifort-i-static -assume nounderscore -g -c external.f90
ifort -o external external.o -L. -lmy
then i got:
Undefined symbols:
"_comp", referenced from:
_MAIN__ in external.o
ld: symbol(s) not found
note: comp is in the library called 'libmy.a' in the same folder.
As you can see above, nounderscore option is used and still getting this error. I could compile and link on Linux with ifort11.1 with no problem but not on Leopard!! Am i missing a compiler option or an additional system lib to link?
Any ideas?
croc
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Among the possibilities might be that you may have built one object with 32-bit compiler and another with 64-bit. Of course, it would be preferable if you could avoid nounderscore, which you would have to use consistently.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This isn't reproducible with a trivial test case.
As Tim suggested, double check that the source file containing the missing routine comp was compiled with -assume nounderscore if that's what you need/desire and verify the compilation of that source file actually succeeded.
Also verify the routine is present in the static archive.
A shot in the dark, maybe try running ranlib on your static archive after all .o files have been added.
Just FYI, -i-static is missed on the final link and that form isdeprecated. The new form is -static-intel which is the default anyway.

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