diff --git a/Makefile b/Makefile index de88bc07..723e9a52 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,8 @@ bin: autoortho/.version ./autoortho/__main__.py -o autoortho_lin.bin autoortho_osx.bin: autoortho/.version - python3.10 -m nuitka --verbose --verbose-output=nuitka.log \ + #python3.10 -m nuitka --verbose --verbose-output=nuitka.log + python3 -m nuitka --verbose --verbose-output=nuitka.log \ --macos-app-icon=autoortho/imgs/ao-icon.ico \ --enable-plugin=eventlet \ --enable-plugin=tk-inter \ diff --git a/autoortho/aoimage/Makefile.osx b/autoortho/aoimage/Makefile.osx index 96cbbd45..ba70e0e1 100644 --- a/autoortho/aoimage/Makefile.osx +++ b/autoortho/aoimage/Makefile.osx @@ -2,6 +2,7 @@ TARGET=main JPGT=/opt/libjpeg-turbo/lib64/ +#JPGT=/opt/homebrew/opt/jpeg-turbo/lib HEADERS=$(wildcard *.h) OBJECTS=aoimage.o @@ -10,13 +11,20 @@ OBJECTS=aoimage.o CC=gcc LD=gcc -CFLAGS+=-O2 -Wall -fPIC -fdiagnostics-color -fvisibility=hidden \ - $(DEFINES) +CFLAGS+=-O2 -arch arm64 -arch x86_64 -Wall -fPIC -fdiagnostics-color -fvisibility=hidden -I/opt/libjpeg-turbo/include/ \ + $(DEFINES) -LDFLAGS=-shared -rdynamic -nodefaultlibs -lpthread +LDFLAGS=-shared -rdynamic -nodefaultlibs -arch arm64 -arch x86_64 -lpthread #LIBS=-lturbojpeg -#LIBS=./libturbojpeg.a -LIBS=-L$(JPGT) -lturbojpeg +# Statically linked with libjpeg-turbo-3.0.1 +LIBS=$(JPGT)/libturbojpeg.a +#LIBS=-L$(JPGT) -lturbojpeg + +#CFLAGS+=-O2 -Wall -fPIC -fdiagnostics-color -fvisibility=hidden \ + $(DEFINES) +# +#LDFLAGS=-shared -rdynamic -nodefaultlibs -lpthread +#LIBS=-L$(JPGT) -lturbojpeg all: $(TARGET) @@ -25,11 +33,10 @@ all: $(TARGET) main: main.c aoimage.dylib $(HEADERS) $(CC) $(CFLAGS) -o main \ - main.c aoimage.c $(LIBS) + main.c aoimage.c $(LIBS) aoimage.dylib: $(OBJECTS) $(LD) -o aoimage.dylib $(LDFLAGS) $(OBJECTS) $(LIBS) clean: rm -f $(OBJECTS) $(TARGET) aoimage.dylib - diff --git a/autoortho/aoimage/aoimage.dylib b/autoortho/aoimage/aoimage.dylib old mode 100644 new mode 100755 index 02079feb..8284e1f5 Binary files a/autoortho/aoimage/aoimage.dylib and b/autoortho/aoimage/aoimage.dylib differ diff --git a/autoortho/autoortho.py b/autoortho/autoortho.py index 5ab0fe54..1b9066ea 100644 --- a/autoortho/autoortho.py +++ b/autoortho/autoortho.py @@ -140,6 +140,14 @@ def diagnose(CFG): log.warning(f" Maptype: {maptype} FAILED!") failed = True + log.info(f"Checking DDS file compression:") + dds_compressor = CFG.pydds.compressor.upper() + if dds_compressor != "ISPC" and platform.system().lower() == 'darwin': + log.warning(f" {dds_compressor} FAILED! Not supported on MacOS, use ISPC instead!") + failed = True + else: + log.info(f" {dds_compressor} OK!") + log.info("------------------------------------") if failed: log.warning("***************") diff --git a/autoortho/flighttrack.py b/autoortho/flighttrack.py index d40f9409..75103167 100644 --- a/autoortho/flighttrack.py +++ b/autoortho/flighttrack.py @@ -5,6 +5,7 @@ import json import socket import threading +import platform from aoconfig import CFG import logging log = logging.getLogger(__name__) @@ -23,6 +24,11 @@ app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app) +if platform.system().lower() == 'darwin': + local_host = '127.0.0.1' +else: + local_host = '0.0.0.0' + class FlightTracker(object): @@ -192,13 +198,13 @@ def metrics(): def run(): #app.run(host='0.0.0.0', port=CFG.flightdata.webui_port, debug=CFG.general.debug, threaded=True, use_reloader=False) log.info("Start flighttracker...") - socketio.run(app, host='0.0.0.0', port=int(CFG.flightdata.webui_port)) - log.info("Exiting flighttracker ...") + socketio.run(app, host=local_host, port=int(CFG.flightdata.webui_port)) + log.info("Exiting flighttracker ...") def main(): ft.start() try: - app.run(host='0.0.0.0', debug=False, threaded=True, use_reloader=False) + app.run(host=local_host, debug=False, threaded=True, use_reloader=False) except KeyboardInterrupt: print("Shutdown requested.") finally: diff --git a/autoortho/pydds.py b/autoortho/pydds.py index 25b223dc..ff0d591d 100644 --- a/autoortho/pydds.py +++ b/autoortho/pydds.py @@ -30,13 +30,18 @@ _stb_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),'lib','windows','stb_dxt.dll') _ispc_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),'lib','windows','ispc_texcomp.dll') elif platform.system().lower() == 'darwin': - #_stb_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),'lib','darwin_arm','libstbdxt.dylib') + # Note, issues with STB so disabled for macos + # _stb_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),'lib','darwin_arm','libstbdxt.dylib') _ispc_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),'lib','darwin_arm','libispc_texcomp.dylib') else: print("System is not supported") exit() -#_stb = CDLL(_stb_path) +if platform.system().lower() == 'darwin': + _stb = None +else: + _stb = CDLL(_stb_path) + _ispc = CDLL(_ispc_path) DDSD_CAPS = 0x00000001 # dwCaps/dwCaps2 is enabled.