From 2109f3ade9d6a202c413ed9ad3e3475caa944ae3 Mon Sep 17 00:00:00 2001 From: Charles BIENVENUE Date: Wed, 5 Nov 2025 22:47:07 +0000 Subject: Parallel Build, OpenMP Support with Fortran 90, and Improved Module Dependencies --- PyGan/src/setup_lcm.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'PyGan/src/setup_lcm.py') diff --git a/PyGan/src/setup_lcm.py b/PyGan/src/setup_lcm.py index 79e7891..76829b4 100644 --- a/PyGan/src/setup_lcm.py +++ b/PyGan/src/setup_lcm.py @@ -22,16 +22,25 @@ def main(): extralink=["-lnvc","-lnvcpumath"] elif Compiler == "LLVMTOOLS": libdir="../../lib/"+mach+"_llvm" - libNv=" " + libNv=None extralink=[ ] elif Compiler == "INTELTOOLS": libdir="../../lib/"+mach+"_intel" - libNv=" " + libNv=None extralink=[ ] else: libdir="../../lib/"+mach - libNv=" " + libNv=None extralink=[ ] + # Filter out missing/empty library dirs to avoid "-L " warnings + def _dirs(*paths): + out=[] + for p in paths: + if p and isinstance(p, str) and os.path.isdir(p): + out.append(p) + return out + lib_dirs = _dirs(libdir, libNv) + rpath_dirs = _dirs(libNv) setup(name="Lcm", version="5.0", description="Python interface for the lcm C library API", @@ -41,8 +50,8 @@ def main(): ext_modules=[Extension("lcm", ["lcmmodule.c"], extra_link_args = extralink, include_dirs=["../../../Ganlib/src",incdir], - library_dirs=[libdir,libNv], - runtime_library_dirs=[libNv], + library_dirs=lib_dirs, + runtime_library_dirs=rpath_dirs, libraries=["Ganlib"] ) ]) if __name__ == "__main__": -- cgit v1.2.3