# Abaqus-preCICE-FeniCS coupling issue

**URL:** <https://precice.discourse.group/t/abaqus-precice-fenics-coupling-issue/2053>\
**Category:** Using preCICE\
**Tags:** abaqus\
**Created:** [August 5, 2024, 2:52pm UTC](https://precice.discourse.group/t/abaqus-precice-fenics-coupling-issue/2053 "2024-08-05T14:52:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kandekac](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/kandekac/32/1167_2.png) [@kandekac](https://precice.discourse.group/u/kandekac)\
**Post date:** [August 5, 2024, 2:52pm UTC](https://precice.discourse.group/t/abaqus-precice-fenics-coupling-issue/2053/1 "2024-08-05T14:52:45Z")

</div>

I am trying to couple Abaqus and precice library, where I have written Abaqus user subroutine: _coupling.f90_

system: cluster (super computer); precice v2.4.0 (installed via spack); mpi: openmpi

I am using fortran module from precice: precice.f90, this on compilation with _gfortran -c precice.f90_ gives me _precice.mod_ and _precice.o_ files.

In order to use precice functions inside the abaqus subroutine, a shared library file is necessary to abaqus, created by linking _coupling.f90_ and _precice.mod_ and _libprecice_.  
I am using the following commands to create the shared library _libstandard.so_ (all files are in same folder):

```
F03 ?= gfortran

all: libstandardU.so

libstandardU.so: coupling.f90
    $(F03) -shared -fPIC $^ -o $@ -I. $(shell pkg-config --libs libprecice)

```

then I ran:

```
abaqus job=Read.inp user=coupling.f90 ask=off int

```

I am still getting the error as undefined symbol precice:

```
Begin Abaqus/Standard Analysis
Mon 05 Aug 2024 03:56:08 PM CEST
Run standard
/cluster/SIMULIA/EstProducts/2024/linux_a64/code/bin/standard: symbol lookup error: /tmp/kandekac_Read_552606/libstandardU.so: undefined symbol: precice_

```

My code snippet to call the precice function inside the abaqus subroutine is:

```
      USE precice
      IMPLICIT NONE

      CHARACTER(50):: config, participantName, meshName
      CHARACTER(50):: writeInitialData, readItCheckp, writeItCheckp
      CHARACTER(50):: writeDataName
      CHARACTER(50):: node_coor_data_name
      CHARACTER(50):: spall_thick_data_name
      INTEGER :: ongoing,dimensions,meshID,bool,numberOfVertices
      INTEGER :: writeDataID, node_coor_ID, spall_thick_ID
      REAL(8):: precice_dt, solver_dt

```

I am not sure, why it does not link precice?  
Can anyone help me with this linking problem?

---

<div class="post-metadata">

**Author:** ![IshaanDesai](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ishaandesai/32/1048_2.png) [@IshaanDesai](https://precice.discourse.group/u/IshaanDesai)\
**Post date:** [August 11, 2024, 7:39pm UTC](https://precice.discourse.group/t/abaqus-precice-fenics-coupling-issue/2053/2 "2024-08-11T19:39:13Z")

</div>

Hi @kandekac

I have coupled Abaqus to other software using preCICE, by using the Fortran bindings of preCICE. Using the Fortran bindings you can directly call preCICE API in the Abaqus subroutine. This way does not require any linking or compilation of functionality for coupling. I would suggest using the Fortran bindings rather than the Fortran module.
