# SPDX-License-Identifier: MIT # # SPDX-FileCopyrightText: 2023 Olivier Dion # Configure me: ## The provider of the events. PROVIDER?=mpi ## The MPI header to use. MPI_HEADER?=$(shell pkg-config --variable=includedir ompi)/mpi.h LTTNG_UST_CFLAGS=$(shell pkg-config --cflags lttng-ust) LTTNG_UST_LIBS=$(shell pkg-config --libs lttng-ust) # Do not modify below. EXTRA_CFLAGS=$(LTTNG_UST_CFLAGS) $(CFLAGS) EXTRA_LIBS=$(LTTNG_UST_LIBS) -ldl $(LDFLAGS) 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 all: liblttng-ust-mpi.so test-mpi clean: rm -f $(AUTOGEN_MPI_API) rm -f null.o rm -f liblttng-ust-mpi.so test-mpi lttng-ust-mpi.c rm -rf traces check: all ./check test-mpi: test-mpi.c mpicc -o $@ $^ liblttng-ust-mpi.so: lttng-ust-mpi.c $(AUTOGEN_MPI_API) 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) lttng-ust-mpi.c: $(MPI_HEADER) | lttng-auto-mpi-wrappers ./lttng-auto-mpi-wrappers $(MPI_HEADER) $@ $(AUTOGEN_MPI_API) &: $(MPI_HEADER) ./lttng-auto-ust-api --ignore MPI_Pcontrol --provider $(PROVIDER) --emulated-classes --common-prefix MPI_ $^ $(AUTOGEN_MPI_API) .PHONY: check