From 757788b603307af6f29e8905d517cbb9ca456eaf Mon Sep 17 00:00:00 2001 From: Xingqiu Yuan Date: Tue, 11 Jun 2024 10:44:54 -0400 Subject: [PATCH 1/3] add extra_link_args for flexible variable compile support --- src/gt4py/cartesian/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gt4py/cartesian/config.py b/src/gt4py/cartesian/config.py index ad031b80c2..c977017097 100644 --- a/src/gt4py/cartesian/config.py +++ b/src/gt4py/cartesian/config.py @@ -53,6 +53,10 @@ extra_compile_args: List[str] = ( list(GT4PY_EXTRA_COMPILE_ARGS.split(" ")) if GT4PY_EXTRA_COMPILE_ARGS else [] ) +GT4PY_EXTRA_LINK_ARGS: str = os.environ.get("GT4PY_EXTRA_LINK_ARGS", "") +extra_link_args: List[str] = ( + list(GT4PY_EXTRA_LINK_ARGS.split(" ")) if GT4PY_EXTRA_LINK_ARGS else [] +) build_settings: Dict[str, Any] = { "boost_include_path": os.path.join(BOOST_ROOT, "include"), "cuda_bin_path": os.path.join(CUDA_ROOT, "bin"), @@ -62,7 +66,7 @@ "openmp_cppflags": os.environ.get("OPENMP_CPPFLAGS", "-fopenmp").split(), "openmp_ldflags": os.environ.get("OPENMP_LDFLAGS", "-fopenmp").split(), "extra_compile_args": {"cxx": extra_compile_args, "cuda": extra_compile_args}, - "extra_link_args": [], + "extra_link_args": {"cxx": extra_link_args, "cuda": extra_link_args}, "parallel_jobs": multiprocessing.cpu_count(), "cpp_template_depth": os.environ.get("GT_CPP_TEMPLATE_DEPTH", GT_CPP_TEMPLATE_DEPTH), } From c266afcb463e7abf2eeaa1b3f51189f5d07b0820 Mon Sep 17 00:00:00 2001 From: Xingqiu Yuan Date: Tue, 11 Jun 2024 15:54:37 -0400 Subject: [PATCH 2/3] using one setting for all build --- src/gt4py/cartesian/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gt4py/cartesian/config.py b/src/gt4py/cartesian/config.py index c977017097..51f0a3c940 100644 --- a/src/gt4py/cartesian/config.py +++ b/src/gt4py/cartesian/config.py @@ -66,7 +66,7 @@ "openmp_cppflags": os.environ.get("OPENMP_CPPFLAGS", "-fopenmp").split(), "openmp_ldflags": os.environ.get("OPENMP_LDFLAGS", "-fopenmp").split(), "extra_compile_args": {"cxx": extra_compile_args, "cuda": extra_compile_args}, - "extra_link_args": {"cxx": extra_link_args, "cuda": extra_link_args}, + "extra_link_args": extra_link_args, "parallel_jobs": multiprocessing.cpu_count(), "cpp_template_depth": os.environ.get("GT_CPP_TEMPLATE_DEPTH", GT_CPP_TEMPLATE_DEPTH), } From bd5c3ffb703192d49dad6169f5ac705f7542727b Mon Sep 17 00:00:00 2001 From: xyuan Date: Mon, 17 Jun 2024 12:08:41 -0400 Subject: [PATCH 3/3] meet the precommit requirement pattern --- src/gt4py/cartesian/config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gt4py/cartesian/config.py b/src/gt4py/cartesian/config.py index 51f0a3c940..ec2f0da724 100644 --- a/src/gt4py/cartesian/config.py +++ b/src/gt4py/cartesian/config.py @@ -54,9 +54,8 @@ list(GT4PY_EXTRA_COMPILE_ARGS.split(" ")) if GT4PY_EXTRA_COMPILE_ARGS else [] ) GT4PY_EXTRA_LINK_ARGS: str = os.environ.get("GT4PY_EXTRA_LINK_ARGS", "") -extra_link_args: List[str] = ( - list(GT4PY_EXTRA_LINK_ARGS.split(" ")) if GT4PY_EXTRA_LINK_ARGS else [] -) +extra_link_args: List[str] = list(GT4PY_EXTRA_LINK_ARGS.split(" ")) if GT4PY_EXTRA_LINK_ARGS else [] + build_settings: Dict[str, Any] = { "boost_include_path": os.path.join(BOOST_ROOT, "include"), "cuda_bin_path": os.path.join(CUDA_ROOT, "bin"),