From 7dfcc480ba1e19bd3232349fc733caef94034292 Mon Sep 17 00:00:00 2001 From: stainer_t Date: Mon, 8 Sep 2025 13:48:49 +0200 Subject: Initial commit from Polytechnique Montreal --- PyGan/src/setup_lcm.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 PyGan/src/setup_lcm.py (limited to 'PyGan/src/setup_lcm.py') diff --git a/PyGan/src/setup_lcm.py b/PyGan/src/setup_lcm.py new file mode 100644 index 0000000..79e7891 --- /dev/null +++ b/PyGan/src/setup_lcm.py @@ -0,0 +1,49 @@ +# +# python3 setup_lcm.py install --home=. +# +from sys import version_info +if version_info[0] == 3 and version_info[1] >= 12: + from setuptools import setup, Extension +elif version_info[0] > 3: + from setuptools import setup, Extension +else: + from distutils.core import setup, Extension +import sysconfig +import numpy + +def main(): + import os + incdir = numpy.get_include() + mach = os.path.basename(os.getcwd()) + Compiler = os.environ.get("COMPILER", None) # Compiler selection + if Compiler == "NVTOOLS": + libdir="../../lib/"+mach+"_nvidia" + libNv=os.environ.get("NVTOOLS", None)+"/../lib" + extralink=["-lnvc","-lnvcpumath"] + elif Compiler == "LLVMTOOLS": + libdir="../../lib/"+mach+"_llvm" + libNv=" " + extralink=[ ] + elif Compiler == "INTELTOOLS": + libdir="../../lib/"+mach+"_intel" + libNv=" " + extralink=[ ] + else: + libdir="../../lib/"+mach + libNv=" " + extralink=[ ] + setup(name="Lcm", + version="5.0", + description="Python interface for the lcm C library API", + author="Alain Hebert", + author_email="alain.hebert@polymtl.ca", + license="LGPL", + ext_modules=[Extension("lcm", ["lcmmodule.c"], + extra_link_args = extralink, + include_dirs=["../../../Ganlib/src",incdir], + library_dirs=[libdir,libNv], + runtime_library_dirs=[libNv], + libraries=["Ganlib"] ) ]) + +if __name__ == "__main__": + main() -- cgit v1.2.3