From debba3fcbfa2c94ea20cebb938228c92c99c94f0 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Thu, 3 Nov 2016 10:40:58 +0100 Subject: [PATCH 1/4] WIP --- flext/Makefile | 14 ++++++++++++-- flext/package.txt | 7 ++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/flext/Makefile b/flext/Makefile index f67037fd..f4bf6818 100644 --- a/flext/Makefile +++ b/flext/Makefile @@ -8,6 +8,7 @@ EXTERNALS ?= ssr_binaural ssr_nfc_hoa ssr_aap ssr_wfs ssr_vbap PD_TARGETS := $(EXTERNALS:%=%_pd) +MAX_TARGETS := $(EXTERNALS:%=%_max) FLEXTPATH ?= /usr/local/src/flext @@ -15,21 +16,30 @@ all: pd pd: $(PD_TARGETS) +max: $(MAX_TARGETS) + %_pd: %.cpp check_flext_path NAME='$(@:%_pd=%~)' MAIN_SOURCE='$<' $(FLEXTPATH)/build.sh pd gcc +%_max: %.cpp check_flext_path + NAME='$(@:%_max=%~)' MAIN_SOURCE='$<' $(FLEXTPATH)/build.sh max gcc + check_flext_path: @test -n '$(FLEXTPATH)' || ( echo \"FLEXTPATH\" is empty! ; false ) @test -d '$(FLEXTPATH)' || \ ( echo \"$(FLEXTPATH)\" not found! Set FLEXTPATH! ; false ) -clean: $(EXTERNALS:%=%_pd_clean) +clean: $(EXTERNALS:%=%_pd_clean) $(EXTERNALS:%=%_max_clean) %_pd_clean: check_flext_path NAME='$(@:%_pd_clean=%~)' $(FLEXTPATH)/build.sh pd gcc clean @rmdir pd-linux 2> /dev/null || true -.PHONY: all pd clean check_flext_path +%_max_clean: check_flext_path + NAME='$(@:%_max_clean=%~)' $(FLEXTPATH)/build.sh max gcc clean + @rmdir max-darwin 2> /dev/null || true + +.PHONY: all pd max clean check_flext_path # TODO: When adding $(PD_TARGETS) to .PHONY, it ceases to work ... why? diff --git a/flext/package.txt b/flext/package.txt index 429fa8db..fb27f60b 100644 --- a/flext/package.txt +++ b/flext/package.txt @@ -10,10 +10,15 @@ INCPATH = -I../apf -I../src PKG_CONFIG ?= pkg-config -INCPATH += `$(PKG_CONFIG) --cflags libxml-2.0` +#INCPATH += `$(PKG_CONFIG) --cflags libxml-2.0` +INCPATH += -I$(HOME)/.local/include +INCPATH += -I$(HOME)/.local/include/libxml2 CXXFLAGS = -std=c++11 +# for XCode clang (not compatible with OSX 10.6): +CXXFLAGS += -stdlib=libc++ -mmacosx-version-min=10.7 LIBS = -lfftw3f -lsndfile -lxml2 +LIBS += -L$(HOME)/.local/lib # vim:filetype=make From 7ec350f67a1785f563a46b02d6fae584b0d9bae3 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Tue, 15 Nov 2016 18:27:36 +0100 Subject: [PATCH 2/4] WIP --- flext/README_Max.md | 69 +++++++++++++++++++++++++++++++++++++++++++++ flext/package.txt | 12 ++++---- 2 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 flext/README_Max.md diff --git a/flext/README_Max.md b/flext/README_Max.md new file mode 100644 index 00000000..af936e7a --- /dev/null +++ b/flext/README_Max.md @@ -0,0 +1,69 @@ +Note that the linked libraries (libxml2, libsndfile and flext) and the SSR external have to be compiled with the same compiler and the same standard library. +In the following instructions GCC is used for everything. + +* Install homebrew like described on http://brew.sh/ + +* Install the GNU compiler GCC + + brew install gcc + +* Compile and Install SSR dependencies (using GCC): + + export HOMEBREW_CC=gcc-6 HOMEBREW_CXX=g++-6 + brew install --build-from-source libxml2 + brew install --build-from-source libsndfile + +* Get the Max SDK from https://cycling74.com/downloads/sdk/ + Newer versions might not work with flext, so you should choose an old one, + e.g. version 5.x: http://www.cycling74.com/download/MaxSDK-5.1.7.zip + +* Unpack the Max SDK to $HOME/Applications (or wherever) + +* Get flext from Github: https://github.com/grrrr/flext + +* Build flext: + + cd flext + export CC=gcc-6 CXX=g++-6 + bash build.sh max gcc + + Change MAXSDKPATH in buildsys/config-mac-max-gcc.txt: + + MAXSDKPATH=$(HOME)/Applications/MaxSDK-5.1.7/c74support + + In the same file, change INSTPATH, INITPATH and HELPPATH: + + INSTPATH=$(HOME)/Documents/Max\ 7/Library + INITPATH=$(HOME)/Documents/Max\ 7/Library + HELPPATH=$(HOME)/Documents/Max\ 7/Library + + Also change FLEXTPREFIX if you don't want it to be installed to /usr/local. + + Save the file and run again: + + bash build.sh max gcc + + If necessary, edit config.txt, then run yet again: + + bash build.sh max gcc + + Finally, install it with + + sudo bash build.sh max gcc install + + If $FLEXTPREFIX is writable for your user account, you don't need "sudo". + + + + + LDFLAGS: -L/usr/local/opt/libxml2/lib + CPPFLAGS: -I/usr/local/opt/libxml2/include + export CC=gcc-6 CXX=g++-6 + + + + + + + + diff --git a/flext/package.txt b/flext/package.txt index fb27f60b..ab58547f 100644 --- a/flext/package.txt +++ b/flext/package.txt @@ -10,15 +10,15 @@ INCPATH = -I../apf -I../src PKG_CONFIG ?= pkg-config -#INCPATH += `$(PKG_CONFIG) --cflags libxml-2.0` -INCPATH += -I$(HOME)/.local/include -INCPATH += -I$(HOME)/.local/include/libxml2 +INCPATH += `$(PKG_CONFIG) --cflags libxml-2.0` +#INCPATH += -I$(HOME)/.local/include +#INCPATH += -I$(HOME)/.local/include/libxml2 CXXFLAGS = -std=c++11 # for XCode clang (not compatible with OSX 10.6): -CXXFLAGS += -stdlib=libc++ -mmacosx-version-min=10.7 +#CXXFLAGS += -stdlib=libc++ -mmacosx-version-min=10.7 -LIBS = -lfftw3f -lsndfile -lxml2 -LIBS += -L$(HOME)/.local/lib +#LIBS = -lfftw3f -lsndfile -lxml2 +#LIBS += -L$(HOME)/.local/lib # vim:filetype=make From c672c35677a1a6e1e798040eb96e785094f1acd8 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Thu, 12 Jan 2017 14:50:05 +0100 Subject: [PATCH 3/4] WIP --- apf/examples/Makefile | 7 ++++++- apf/examples/README | 4 +++- flext/README_Max.md | 49 +++++++++++++++++++++++++++++++++++-------- flext/package.txt | 1 + 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/apf/examples/Makefile b/apf/examples/Makefile index 19d3a41a..ab8fae65 100644 --- a/apf/examples/Makefile +++ b/apf/examples/Makefile @@ -71,13 +71,18 @@ $(PORTAUDIO_STUFF): LDLIBS += -lportaudio $(FFTW_STUFF): LDLIBS += -lfftw3f -# For Puredata stuff see also package.txt +# For Puredata/Max stuff see also package.txt pd: check_flext_path package.txt $(FLEXTPATH)/build.sh pd gcc .PHONY: pd +max: check_flext_path package.txt + $(FLEXTPATH)/build.sh max gcc + +.PHONY: max + check_flext_path: @test -n '$(FLEXTPATH)' || ( echo \"FLEXTPATH\" is empty! ; false ) @test -d '$(FLEXTPATH)' || \ diff --git a/apf/examples/README b/apf/examples/README index f25ccb20..e51fd6ea 100644 --- a/apf/examples/README +++ b/apf/examples/README @@ -4,7 +4,9 @@ Compilation: make -make pd +make pd FLEXTPATH=/path/to/flext + +make max FLEXTPATH=/path/to/flext make mex diff --git a/flext/README_Max.md b/flext/README_Max.md index af936e7a..51276aa0 100644 --- a/flext/README_Max.md +++ b/flext/README_Max.md @@ -1,4 +1,6 @@ -Note that the linked libraries (libxml2, libsndfile and flext) and the SSR external have to be compiled with the same compiler and the same standard library. +Note that the linked libraries (libxml2, libsndfile and flext) and the SSR +external have to be compiled with the same compiler and the same C++ standard +library. In the following instructions GCC is used for everything. * Install homebrew like described on http://brew.sh/ @@ -7,17 +9,13 @@ In the following instructions GCC is used for everything. brew install gcc -* Compile and Install SSR dependencies (using GCC): - - export HOMEBREW_CC=gcc-6 HOMEBREW_CXX=g++-6 - brew install --build-from-source libxml2 - brew install --build-from-source libsndfile - * Get the Max SDK from https://cycling74.com/downloads/sdk/ Newer versions might not work with flext, so you should choose an old one, e.g. version 5.x: http://www.cycling74.com/download/MaxSDK-5.1.7.zip -* Unpack the Max SDK to $HOME/Applications (or wherever) + flext doesn't support 64-bit yet, see https://github.com/grrrr/flext/pull/10 + +* Unpack the Max SDK to e.g. $HOME/Applications * Get flext from Github: https://github.com/grrrr/flext @@ -25,11 +23,14 @@ In the following instructions GCC is used for everything. cd flext export CC=gcc-6 CXX=g++-6 + export MACOSX_DEPLOYMENT_TARGET=10.6 bash build.sh max gcc Change MAXSDKPATH in buildsys/config-mac-max-gcc.txt: MAXSDKPATH=$(HOME)/Applications/MaxSDK-5.1.7/c74support + #MAXSDKPATH=$(HOME)/Applications/MaxSDK-6.1.4/c74support + #MAXSDKPATH=$(HOME)/Applications/max-sdk-7.1.0/source/c74support In the same file, change INSTPATH, INITPATH and HELPPATH: @@ -39,6 +40,8 @@ In the following instructions GCC is used for everything. Also change FLEXTPREFIX if you don't want it to be installed to /usr/local. + Keep ARCH=i386, ...? + Save the file and run again: bash build.sh max gcc @@ -51,19 +54,47 @@ In the following instructions GCC is used for everything. sudo bash build.sh max gcc install - If $FLEXTPREFIX is writable for your user account, you don't need "sudo". + If $FLEXTPREFIX is writable for your user account (like it typically is when + you use Homebrew), you don't need "sudo". + +* Compile and Install SSR dependencies (using GCC): + + export HOMEBREW_CC=gcc-6 HOMEBREW_CXX=g++-6 + export CFLAGS="-arch i386" + brew install -v --build-from-source libxml2 + brew install -v --build-from-source libsndfile + brew install -v --build-from-source fftw + + We have to build it from source to use the right compiler and standard + library, and we have to use "-arch i386" because the Max SDKs are only +available for that architecture. + +making the SSR external: + + +export FLEXTPATH=$HOME/git/flext LDFLAGS: -L/usr/local/opt/libxml2/lib CPPFLAGS: -I/usr/local/opt/libxml2/include + export PKG_CONFIG_PATH=/usr/local/opt/libxml2/lib/pkgconfig export CC=gcc-6 CXX=g++-6 + export MACOSX_DEPLOYMENT_TARGET=10.6 + + +SDK 7.1.0: +could actually be compiled +after uncommenting the following line in flext/source/flbuf.cpp + ::object_method((t_object *)p,(t_symbol *)sym_dirty); +but then, when connecting the external and switching on DSP processing: +msp object need to be updated for msp64 diff --git a/flext/package.txt b/flext/package.txt index ab58547f..6be36f61 100644 --- a/flext/package.txt +++ b/flext/package.txt @@ -19,6 +19,7 @@ CXXFLAGS = -std=c++11 #CXXFLAGS += -stdlib=libc++ -mmacosx-version-min=10.7 #LIBS = -lfftw3f -lsndfile -lxml2 +LIBS += `$(PKG_CONFIG) --libs libxml-2.0` #LIBS += -L$(HOME)/.local/lib # vim:filetype=make From eed8292c572452119299eaf9b823d00438b264f3 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Mon, 3 Jul 2017 16:21:31 +0200 Subject: [PATCH 4/4] WIP --- flext/README_Max.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flext/README_Max.md b/flext/README_Max.md index 51276aa0..f467a44f 100644 --- a/flext/README_Max.md +++ b/flext/README_Max.md @@ -20,6 +20,7 @@ In the following instructions GCC is used for everything. * Get flext from Github: https://github.com/grrrr/flext * Build flext: + Note: MACOSX_DEPLOYMENT_TARGET=10.6 doesn't work with XCode compiler cd flext export CC=gcc-6 CXX=g++-6 @@ -98,3 +99,9 @@ after uncommenting the following line in flext/source/flbuf.cpp but then, when connecting the external and switching on DSP processing: msp object need to be updated for msp64 + +SDK 7.0.1 with XCode and command line tools: +flex compilation works, many warnings but no errors +make max CXXFLAGS=-stdlib=libc++ +but: clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) +