Jorgen
2007-09-04, 04:38
If you are trying to create a double precision ABAQUS vumat shared library and are having trouble since you like to use proper Fortan style which includes using the command implicit none at the beginning of all functions. Then this hint might be of interest.
By default, ABAQUS requires you to write your Fortran code using the "include 'vaba_param.inc'" command, which is a really bad idea since that allows you to use variables without explicitly defining them. The problem with this approach is that it very easily leads to errors and is generally considered bad practice!
Fortunately, there is a way to compile your own shared VUMAT library by using a command like the following:
ifort -fPIC -r8 -O2 -c vumat.f90
ifort -cxxlib-gcc -gcc-version=330 -fPIC -threads -shared \
-Wl,-u,vcosimulation_ -Wl,-u,vcosimulation0_ -Wl,-u,vdload_ \
-Wl,-u,vfabric_ -Wl,-u,vfric_ -Wl,-u,vuel_ -Wl,-u,vufield_ \
-Wl,-u,vuinter_ -Wl,-u,vumat_ -Wl,-soname,libexplicitU-D.so \
-o libexplicitU-D.so vumat.o /opt/abaqus/6.7-1/exec/lbr/explicitU_static.a \
-L /opt/abaqus/6.7-1/exec/lbr -L /opt/abaqus/6.7-1/External \
/opt/abaqus/6.7-1/exec/lbr/libexplicitB.so \
/opt/abaqus/6.7-1/exec/lbr/libABQUTI_CoreUtils.so \
/opt/abaqus/6.7-1/exec/lbr/libABQUTI_UtiLicensing.so \
-parallel -Wl,-Bdynamic -i-dynamic -lifport -lifcoremt
This particular command works for a 64-bit Linux computer running ABAQUS v6.7.
The way I found out the specific compiler flags was by temporarily modify the link_sl variable in the abaqus_v6.env file to include the echo command:
link_sl = ("echo " + fortCmd +
" -cxxlib-gcc -gcc-version=%i -fPIC -threads -shared " %verId +
"%E -Wl,-soname,%U -o %U %F %A %L %B -parallel -Wl,-Bdynamic " +
"-i-dynamic -lifport -lifcoremt")
This way the actual link command is echoed on the screen when running abaqus with a source file using the "user=vumat.f" options. This makes it possible to create shared libraries without running the "abaqus make" command which is not powerful enough.
By default, ABAQUS requires you to write your Fortran code using the "include 'vaba_param.inc'" command, which is a really bad idea since that allows you to use variables without explicitly defining them. The problem with this approach is that it very easily leads to errors and is generally considered bad practice!
Fortunately, there is a way to compile your own shared VUMAT library by using a command like the following:
ifort -fPIC -r8 -O2 -c vumat.f90
ifort -cxxlib-gcc -gcc-version=330 -fPIC -threads -shared \
-Wl,-u,vcosimulation_ -Wl,-u,vcosimulation0_ -Wl,-u,vdload_ \
-Wl,-u,vfabric_ -Wl,-u,vfric_ -Wl,-u,vuel_ -Wl,-u,vufield_ \
-Wl,-u,vuinter_ -Wl,-u,vumat_ -Wl,-soname,libexplicitU-D.so \
-o libexplicitU-D.so vumat.o /opt/abaqus/6.7-1/exec/lbr/explicitU_static.a \
-L /opt/abaqus/6.7-1/exec/lbr -L /opt/abaqus/6.7-1/External \
/opt/abaqus/6.7-1/exec/lbr/libexplicitB.so \
/opt/abaqus/6.7-1/exec/lbr/libABQUTI_CoreUtils.so \
/opt/abaqus/6.7-1/exec/lbr/libABQUTI_UtiLicensing.so \
-parallel -Wl,-Bdynamic -i-dynamic -lifport -lifcoremt
This particular command works for a 64-bit Linux computer running ABAQUS v6.7.
The way I found out the specific compiler flags was by temporarily modify the link_sl variable in the abaqus_v6.env file to include the echo command:
link_sl = ("echo " + fortCmd +
" -cxxlib-gcc -gcc-version=%i -fPIC -threads -shared " %verId +
"%E -Wl,-soname,%U -o %U %F %A %L %B -parallel -Wl,-Bdynamic " +
"-i-dynamic -lifport -lifcoremt")
This way the actual link command is echoed on the screen when running abaqus with a source file using the "user=vumat.f" options. This makes it possible to create shared libraries without running the "abaqus make" command which is not powerful enough.