diff --git a/devtools/deploy/multipy/build_multipy.py b/devtools/deploy/multipy/build_multipy.py index 9b89e09478a2811c1df291d727234a39adc2d6b1..228709437b26264cda4b1acdbbc6b006b7c54860 100644 --- a/devtools/deploy/multipy/build_multipy.py +++ b/devtools/deploy/multipy/build_multipy.py @@ -88,6 +88,60 @@ class WindowsMake: return pack_prc +class LinuxMake: + PLATFORM = "linux" + ARCH = "x86_64" + CC = "gcc" + CXX = "g++" + MPLBACKEND = "Agg" + QTCMake_DIR = "/usr/local/Qt6/6.2.3/gcc_64/lib/cmake" + NPROC = 8 + PY_PLATFORM_BASE = "/home/build/multipython/Python" + # supported Python platforms: 3.9, 3.8, 3.10, 3.11 + SUPPORTED_PY_VERSIONS = ("39", "38", "310", "311") + + def _setenv(): + ENV["CC"] = LinuxMake.CC + ENV["CXX"] = LinuxMake.CXX + ENV["MPLBACKEND"] = LinuxMake.MPLBACKEND + + def configure(dirs:BuildDirs): + """ + Configure the build with a given source and build directory + and a given Python platform + """ + LinuxMake._setenv() + conf_prc = subp.run( + ["cmake", + "-DCMAKE_PREFIX_PATH=" + LinuxMake.QTCMake_DIR, + "-DZERO_TOLERANCE=ON", + "-DBA_PY_PACKAGE=ON", + "-DDEVELOPER_CHECKS=ON", + "-DBA_PY_PLATFORM=" + dirs.python, + "-B", dirs.build, "-S", dirs.source]) + + return conf_prc + + def build(dirs:BuildDirs): + """ Build in the given build directory """ + build_prc = subp.run(["cmake", "--build", dirs.build, "--config Release", + "--parallel %i" % LinuxMake.NPROC]) + return build_prc + + def test(dirs:BuildDirs): + """ Perform tests """ + os.chdir(dirs.build) + test_prc = subp.run(["ctest", "-C", "Release", "--parallel %i" % LinuxMake.NPROC, + "--output-on-failure"]) + return test_prc + + def pack(dirs:BuildDirs): + """ Build package """ + subp.run(["bash", dirs.build + "/var/mk_pypack_linux.sh"]) + pack_prc = subp.run(["cpack", dirs.build, "-B " + dirs.package]) + return pack_prc + + def make(maker, source_dir, python_version): """ Make for the given version of Python """ print("#--- DIAGNOSTICS ---")