1 # SPDX-License-Identifier: MIT
3 # SPDX-FileCopyrightText: 2023 Olivier Dion <odion@efficios.com>
7 ## The provider of the events.
10 ## The MPI header to use.
11 MPI_HEADER?
=$(shell pkg-config
--variable
=includedir ompi
)/mpi.h
13 LTTNG_UST_CFLAGS
=$(shell pkg-config
--cflags lttng-ust
)
14 LTTNG_UST_LIBS
=$(shell pkg-config
--libs lttng-ust
)
16 # Do not modify below.
17 EXTRA_CFLAGS
=$(LTTNG_UST_CFLAGS
)
18 EXTRA_LIBS
=$(LTTNG_UST_LIBS
) -ldl
20 AUTOGEN_MPI_API
=lttng-ust-mpi-defs.h lttng-ust-mpi.h lttng-ust-mpi-classes.h lttng-ust-mpi-impl.c lttng-ust-mpi-states.h
22 all: liblttng-ust-mpi.so test-mpi
25 rm -f
$(AUTOGEN_MPI_API
)
27 rm -f liblttng-ust-mpi.so test-mpi lttng-ust-mpi.c
36 liblttng-ust-mpi.so
: lttng-ust-mpi.c
$(AUTOGEN_MPI_API
)
37 gcc
-O2
-D ENABLE_LTTNG_TRACEPOINTS
-I .
-I
$$(dirname
$(MPI_HEADER
)) -Wall
-Werror
-shared
-fPIC
$(EXTRA_CFLAGS
) -o
$@ lttng-ust-mpi.c lttng-ust-mpi-impl.c
$(EXTRA_LIBS
)
39 lttng-ust-mpi.c
: $(MPI_HEADER
) | lttng-auto-mpi-wrappers
40 .
/lttng-auto-mpi-wrappers
$(MPI_HEADER
) $@
42 $(AUTOGEN_MPI_API
) &: $(MPI_HEADER
)
43 .
/lttng-auto-ust-api
--ignore MPI_Pcontrol
--provider
$(PROVIDER
) --emulated-classes
--common-prefix MPI_
$^
$(AUTOGEN_MPI_API
)