Skip to content
Snippets Groups Projects
Commit 110548bc authored by AlQuemist's avatar AlQuemist Committed by Ammar Nejati
Browse files

build_multipy.py: add the build instructions for Linux

parent 41989f7d
No related branches found
No related tags found
1 merge request!1698Python script to build installers and wheels for all platforms and Python versions
......@@ -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 ---")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment