File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1010import argparse
1111import re
1212import json
13+ import sys
14+ import os
1315from pathlib import Path
1416
15- import pympistandard as std
16-
1717# ============================= Constants / Globals ============================
1818DIR = Path ("." )
1919OUTPUT = DIR / "mpi.h"
8080parser .add_argument ("-o" , "--output" , type = str , help = "output path for the header file" )
8181parser .add_argument ("--mangle-names" , help = "enable name mangling for constants and datatypes" , action = "store_true" )
8282parser .add_argument ("--no-mangle" , help = "disable name mangling (default)" , action = "store_true" )
83+ parser .add_argument ("--pympistd-dir" , type = str , help = "directory for the pympistandard library" )
8384
8485args = parser .parse_args ()
8586
9394 OUTPUT = Path (args .output )
9495if args .input :
9596 INPUT = Path (args .input )
97+ if args .pympistd_dir :
98+ PYMPISTANDARD_DIR = Path (args .pympistd_dir )
99+
100+ # A bit of a hack to load the pympistandard module, which is in
101+ # the Open MPI '3rd-party" tree in the source dir.
102+ pympi_dir = PYMPISTANDARD_DIR / "src"
103+ sys .path .insert (0 , str (pympi_dir .resolve ()))
104+
105+ import pympistandard as std
96106
97107# ================================== Load JSON =================================
98108with open (JSON_PATH ) as f :
Original file line number Diff line number Diff line change @@ -565,6 +565,7 @@ standard_abi/mpi.h: $(top_srcdir)/docs/mpi-standard-apis.json $(top_srcdir)/ompi
565565 $(OMPI_V_GEN ) $(PYTHON ) $(top_srcdir ) /ompi/mpi/bindings/c_header.py \
566566 --input $(top_srcdir ) /ompi/mpi/c/abi.h.in \
567567 --abi-json $(top_srcdir ) /docs/mpi-standard-abi.json \
568+ --pympistd $(top_srcdir ) /3rd-party/pympistandard/src \
568569 --output $(top_srcdir ) /ompi/mpi/c/standard_abi/mpi.h
569570
570571# Mangled version
@@ -573,6 +574,7 @@ abi.h: $(top_srcdir)/docs/mpi-standard-apis.json $(top_srcdir)/ompi/mpi/bindings
573574 --input $(top_srcdir ) /ompi/mpi/c/abi.h.in \
574575 --output $(top_srcdir ) /ompi/mpi/c/abi.h \
575576 --abi-json $(top_srcdir ) /docs/mpi-standard-abi.json \
577+ --pympistd-dir $(top_srcdir ) /3rd-party/pympistandard \
576578 --mangle-names
577579
578580% _abi_generated.c : % .c.in
@@ -586,7 +588,7 @@ abi.h: $(top_srcdir)/docs/mpi-standard-apis.json $(top_srcdir)/ompi/mpi/bindings
586588 $<
587589endif
588590
589- MAINTAINERCLEANFILES = *_generated.c abi.h
591+ MAINTAINERCLEANFILES = *_generated.c $( nobase_include_HEADERS )
590592if OMPI_STANDARD_ABI
591593include Makefile_abi.include
592594endif
You can’t perform that action at this time.
0 commit comments