From eff6f82abf9d65ef83a0686b2a0b279e7c1397af Mon Sep 17 00:00:00 2001 From: "Claude ROUX[Systemic AI]" Date: Tue, 5 Jan 2021 14:12:07 +0100 Subject: [PATCH] Update install.py We add arm compiling for Apple Silicon machines --- install.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/install.py b/install.py index e1a2a3ca..dbce911f 100755 --- a/install.py +++ b/install.py @@ -203,10 +203,14 @@ def displayhelp(s): cleanlibs += "\t$(MAKE) -C libsound clean\n" incpath += " -Iinclude/macos/ao" + ostype = subprocess.Popen(["uname", "-a"], stdout=subprocess.PIPE).stdout.read() if withgui: compilelibs += "\t$(MAKE) -C libgui all\n" cleanlibs += "\t$(MAKE) -C libgui clean\n" - incpath += " -Iinclude/macos/fltk" + if "arm64" in ostype: + incpath += " -Iinclude/macarm/fltk" + else: + incpath += " -Iinclude/macos/fltk" incpath += "\n" compilelibs += "\n\n" @@ -234,8 +238,11 @@ def displayhelp(s): f.write("TAMGUCONSOLENAME = tamgu\n") if withgui: - f.write("FLTKLIBS=-Llibs/macos -lfltk -lfltk_images\n") - f.write("JPEGLIB = -lfltk_jpeg\n\n") + if "arm64" in ostype: + f.write("FLTKLIBS=-Llibs/macarm -lfltk -lfltk_images -lfltk_jpeg\n") + else: + f.write("FLTKLIBS=-Llibs/macos -lfltk -lfltk_images\n") + f.write("JPEGLIB = -lfltk_jpeg\n\n") if withsound: f.write("SOURCEMM = macsound.mm\n") @@ -259,9 +266,14 @@ def displayhelp(s): f.write("PYTHONLIB = /Library/Frameworks/Python.framework/Versions/"+pversion+"/Python\n") else: f.write("PYTHONLIB = "+pythonpath+"\n") - - f.write("C++11Flag = -std=c++11 -DTamgu_REGEX -DMAVERICK -DAPPLE\n") - f.write("INTELINT = -DINTELINTRINSICS -mavx2 -DAVXSUPPORT\n") + + # AVX instructions are not available on arm64 machines + if "arm64" in ostype: + f.write("C++11Flag = -std=c++11 -DTamgu_REGEX -DMAVERICK -DAPPLE -DFLTK14\n") + f.write("INTELINT =\n") + else: + f.write("C++11Flag = -std=c++11 -DTamgu_REGEX -DMAVERICK -DAPPLE\n") + f.write("INTELINT = -DINTELINTRINSICS -mavx2 -DAVXSUPPORT\n") f.close(); print("You can launch 'make all libs' now") sys.exit(0)