Question QG-008:

When I compile an ADINA user supplied subroutine on Linux, the problem stops with the following error in the *.msg file:

Initializing ... Stage 1
Allocating 16000000 bytes of Memory ...
Initializing ... Stage 2
Initial ADINA memory allocation  - 16.0 mb  (or 4.0 mw)
Starting Solution Process ...
Computation starts ...
Input phase...
/home/adina832/adina8.3/adina.exe: relocation error:
/home/adina832/adina8.3/libadusr.so: undefined symbol: for_open
 

What is the cause of this error?

Answer:

Some Fortran functions, including i/o functions, require linking additional Intel libraries to the ADINA user-coded dynamic library, libadusr.so. To find out which libraries are missing, go to the path where the Intel Fortran libraries are located and use the "grep" command with the name of the undefined symbol as follows:

[user@redhat4 ~]$cd /opt/intel_fc_80/lib

[user@redhat4 lib]$grep "for_open" *
Binary file libifcore.a matches
Binary file libifcoremt.a matches
Binary file libifcoremt_pic.a matches
Binary file libifcoremt.so.5 matches
Binary file libifcore_pic.a matches
Binary file libifcore.so.5 matches

The output above indicates that there are 2 intel dynamic libraries (*.so*) to be linked, libifcoremt.so.5 and libifcore.so.5. You have to modify the Makefile to include these libraries. For example:

  INTEL_LIB=/opt/intel_fc_80/lib
...

$(TARGET): $(OBJS) force_rebuild
        @ rm -f $@ 2 > /dev/null
        $(LD) -o $@ -Bdynamic /lib/ld-linux.so.2 \
        $(INTEL_LIB)/libifcoremt.so.5 $(INTEL_LIB)/libifcore.so.5 \
        -shared $(OBJS) -lm -lc
        @ chmod 555 $@

Please be aware that Makefiles are very sensitive to syntax rules (spaces, etc.), so be careful when you modify the Makefile. It is recommended to keep a copy of the original Makefile.

Now you may type make as usual. However, after rebuilding libadusr.so, you must ensure that the Intel dynamic libraries that were dynamically linked are present in the same directory as libadusr.so. You may copy these libraries from their original location or use a symbolic link, for example,

ln -s /opt/intel_fc_80/lib/libifcoremt.so.5 .
ln -s /opt/intel_fc_80/lib/libifcore.so.5 . 

Now you are ready to run your problem.