2323# $HEADER$
2424#
2525
26- SUBDIRS = profile
27-
2826include $(top_srcdir ) /Makefile.ompi-rules
2927
3028# Note that Automake's Fortran-buidling rules uses CPPFLAGS and
@@ -45,14 +43,14 @@ AM_FCFLAGS = -I$(top_srcdir)/ompi/mpi/fortran/use-mpi-f08/mod \
4543 $(OMPI_FC_MODULE_FLAG )$(top_builddir ) /ompi/$(OMPI_FORTRAN_USEMPI_DIR ) \
4644 $(OMPI_FC_MODULE_FLAG ) mod \
4745 $(OMPI_FC_MODULE_FLAG ) bindings \
48- -I$(top_srcdir ) -I$(top_builddir ) $(FCFLAGS_f90 ) \
49- -DOMPI_BUILD_MPI_PROFILING=0
46+ -I$(top_srcdir ) -I$(top_builddir ) $(FCFLAGS_f90 )
5047
5148MOSTLYCLEANFILES = *.mod
5249
5350CLEANFILES += *.i90
5451
5552lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08.la
53+ noinst_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08_profile.la
5654
5755module_sentinel_files = \
5856 mod/libforce_usempif08_internal_modules_to_be_built.la \
@@ -97,9 +95,9 @@ sizeof_f08.f90:
9795 --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4 ) \
9896 --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32 )
9997
100- profile/ psizeof_f08.f90 : $(top_builddir ) /config.status
101- profile/ psizeof_f08.f90 : $(sizeof_pl )
102- profile/ psizeof_f08.f90 :
98+ psizeof_f08.f90 : $(top_builddir ) /config.status
99+ psizeof_f08.f90 : $(sizeof_pl )
100+ psizeof_f08.f90 :
103101 $(OMPI_V_GEN ) $(sizeof_pl ) \
104102 --impl=$@ --ierror=optional --pmpi \
105103 --maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK ) \
@@ -110,34 +108,25 @@ profile/psizeof_f08.f90:
110108 --complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4 ) \
111109 --complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32 )
112110
113- CLEANFILES += sizeof_f08.h sizeof_f08.f90 profile/ psizeof_f08.f90
111+ CLEANFILES += sizeof_f08.h sizeof_f08.f90 psizeof_f08.f90
114112
115113mpi_api_files = \
116114 abort_f08.F90 \
117- accumulate_f08.F90 \
118115 add_error_class_f08.F90 \
119116 add_error_code_f08.F90 \
120117 add_error_string_f08.F90 \
121118 aint_add_f08.F90 \
122119 aint_diff_f08.F90 \
123- allgather_f08.F90 \
124120 allgather_init_f08.F90 \
125- allgatherv_f08.F90 \
126121 allgatherv_init_f08.F90 \
127122 alloc_mem_f08.F90 \
128- allreduce_f08.F90 \
129123 allreduce_init_f08.F90 \
130- alltoall_f08.F90 \
131124 alltoall_init_f08.F90 \
132- alltoallv_f08.F90 \
133125 alltoallv_init_f08.F90 \
134- alltoallw_f08.F90 \
135126 alltoallw_init_f08.F90 \
136127 barrier_f08.F90 \
137128 barrier_init_f08.F90 \
138- bcast_f08.F90 \
139129 bcast_init_f08.F90 \
140- bsend_f08.F90 \
141130 bsend_init_f08.F90 \
142131 buffer_attach_f08.F90 \
143132 buffer_detach_f08.F90 \
@@ -255,7 +244,6 @@ mpi_api_files = \
255244 file_write_at_all_end_f08.F90 \
256245 file_write_at_all_f08.F90 \
257246 file_write_at_f08.F90 \
258- file_write_f08.F90 \
259247 file_write_ordered_begin_f08.F90 \
260248 file_write_ordered_end_f08.F90 \
261249 file_write_ordered_f08.F90 \
@@ -334,15 +322,13 @@ mpi_api_files = \
334322 intercomm_create_from_groups_f08.F90 \
335323 intercomm_merge_f08.F90 \
336324 iprobe_f08.F90 \
337- irecv_f08.F90 \
338325 ireduce_f08.F90 \
339326 ireduce_scatter_f08.F90 \
340327 ireduce_scatter_block_f08.F90 \
341328 irsend_f08.F90 \
342329 iscan_f08.F90 \
343330 iscatter_f08.F90 \
344331 iscatterv_f08.F90 \
345- isend_f08.F90 \
346332 isendrecv_f08.F90 \
347333 isendrecv_replace_f08.F90 \
348334 issend_f08.F90 \
@@ -380,9 +366,7 @@ mpi_api_files = \
380366 put_f08.F90 \
381367 query_thread_f08.F90 \
382368 raccumulate_f08.F90 \
383- recv_f08.F90 \
384369 recv_init_f08.F90 \
385- reduce_f08.F90 \
386370 reduce_init_f08.F90 \
387371 reduce_local_f08.F90 \
388372 reduce_scatter_f08.F90 \
@@ -403,7 +387,6 @@ mpi_api_files = \
403387 scatter_init_f08.F90 \
404388 scatterv_f08.F90 \
405389 scatterv_init_f08.F90 \
406- send_f08.F90 \
407390 send_init_f08.F90 \
408391 sendrecv_f08.F90 \
409392 sendrecv_replace_f08.F90 \
@@ -427,7 +410,6 @@ mpi_api_files = \
427410 status_set_elements_f08.F90 \
428411 status_set_elements_x_f08.F90 \
429412 testall_f08.F90 \
430- testany_f08.F90 \
431413 test_cancelled_f08.F90 \
432414 test_f08.F90 \
433415 testsome_f08.F90 \
@@ -468,13 +450,11 @@ mpi_api_files = \
468450 unpack_external_f08.F90 \
469451 unpack_f08.F90 \
470452 unpublish_name_f08.F90 \
471- waitall_f08.F90 \
472453 waitany_f08.F90 \
473454 wait_f08.F90 \
474455 waitsome_f08.F90 \
475456 win_allocate_f08.F90 \
476457 win_allocate_shared_f08.F90 \
477- win_attach_f08.F90 \
478458 win_call_errhandler_f08.F90 \
479459 win_complete_f08.F90 \
480460 win_create_dynamic_f08.F90 \
@@ -508,28 +488,25 @@ mpi_api_files = \
508488 win_test_f08.F90 \
509489 win_unlock_f08.F90 \
510490 win_unlock_all_f08.F90 \
511- win_wait_f08.F90
512-
513- # JMS Somehow this variable substitution isn't quite working, and I
514- # don't have time to figure it out. So just wholesale copy the file
515- # list. :-(
516- # pmpi_api_files = $(mpi_api_files:%=profile/p%)
491+ win_wait_f08.F90 \
492+ api_f08_generated.F90
517493
518494lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = \
519495 $(mpi_api_files ) \
520496 mpi-f08.F90
521497
522- # These are generated; do not ship them
523- nodist_lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES =
524-
525498if BUILD_FORTRAN_SIZEOF
526499SIZEOF_H = sizeof_f08.h
527- nodist_lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES + = \
500+ nodist_lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = \
528501 sizeof_f08.h \
529502 sizeof_f08.f90 \
530- profile/ psizeof_f08.f90
503+ psizeof_f08.f90
531504endif
532505
506+ lib@OMPI_LIBMPI_NAME@_usempif08_la_FCFLAGS = \
507+ $(AM_FCFLAGS ) \
508+ -DOMPI_BUILD_MPI_PROFILING=0
509+
533510#
534511# Include the mpi_f08-based MPI extensions in libmpi_usempif08, too.
535512#
@@ -539,13 +516,20 @@ endif
539516#
540517
541518lib@OMPI_LIBMPI_NAME@_usempif08_la_LIBADD = \
542- profile/libmpi_usempif08_pmpi .la \
519+ lib@OMPI_LIBMPI_NAME@_usempif08_profile .la \
543520 $(OMPI_MPIEXT_USEMPIF08_LIBS ) \
544521 $(top_builddir ) /ompi/mpi/fortran/mpif-h/lib@OMPI_LIBMPI_NAME@_mpifh.la \
545522 $(top_builddir ) /ompi/lib@OMPI_LIBMPI_NAME@.la \
546523 mod/libusempif08_internal_modules.la \
547524 base/libusempif08_ccode.la
548- lib@OMPI_LIBMPI_NAME@_usempif08_la_DEPENDENCIES = $(module_sentinel_files )
525+
526+ #
527+ # Make sure to build the profile library before this library, since adding it
528+ # to LIBADD doesn't enforce any ordering
529+ #
530+ lib@OMPI_LIBMPI_NAME@_usempif08_la_DEPENDENCIES = \
531+ $(module_sentinel_files ) \
532+ lib@OMPI_LIBMPI_NAME@_usempif08_profile.la
549533lib@OMPI_LIBMPI_NAME@_usempif08_la_LDFLAGS = -version-info $(libmpi_usempif08_so_version )
550534
551535#
@@ -558,6 +542,44 @@ mpi_api_lo_files = $(mpi_api_files:.F90=.lo)
558542$(mpi_api_lo_files ) : bindings/libforce_usempif08_internal_bindings_to_be_built.la
559543
560544mpi-f08.lo : $(module_sentinel_files ) $(SIZEOF_H )
545+ mpi-f08.F90 : $(SIZEOF_H )
546+
547+ #
548+ # Profiling interface
549+ #
550+
551+ lib@OMPI_LIBMPI_NAME@_usempif08_profile_la_SOURCES = \
552+ $(mpi_api_files )
553+
554+ lib@OMPI_LIBMPI_NAME@_usempif08_profile_la_FCFLAGS = \
555+ $(AM_FCFLAGS ) \
556+ -DOMPI_BUILD_MPI_PROFILING=1
557+
558+
559+ #
560+ # Generate the Fortran bindings and C wrapper functions for bindings with a
561+ # *.in template.
562+ #
563+
564+ if OMPI_GENERATE_BINDINGS
565+
566+ include Makefile.prototype_files
567+
568+ api_f08_generated.F90 : $(prototype_files )
569+ $(OMPI_V_GEN ) $(PYTHON ) $(top_srcdir ) /ompi/mpi/bindings/bindings.py \
570+ --builddir $(abs_top_builddir ) \
571+ --srcdir $(abs_top_srcdir ) \
572+ --output $(abs_builddir ) /$@ \
573+ fortran \
574+ code \
575+ --lang fortran \
576+ --prototype-files $(ready_prototype_files )
577+
578+ EXTRA_DIST = $(extra_dist_prototype_files )
579+
580+ # Delete generated file on maintainer-clean
581+ MAINTAINERCLEANFILES = api_f08_generated.F90
582+ endif
561583
562584# ##########################################################################
563585
0 commit comments