residuum / PuRestJson

PuREST JSON is a library for connecting Puredata (Pd) to HTTP services and encoding and decoding JSON data.
ix.residuum.org/pd/purest_json.html
Other
74 stars 9 forks source link

Compiling dance on Darwin arm64 OSX12.6.1 #69

Closed patricecolet closed 1 year ago

patricecolet commented 1 year ago

% git clone https://github.com/residuum/PuRestJson.git Cloning into 'PuRestJson'... remote: Enumerating objects: 2890, done. remote: Counting objects: 100% (254/254), done. remote: Compressing objects: 100% (162/162), done. remote: Total 2890 (delta 124), reused 200 (delta 86), pack-reused 2636 Receiving objects: 100% (2890/2890), 3.05 MiB | 1.45 MiB/s, done. Resolving deltas: 100% (1798/1798), done.

% cd PuRestJson

% make Makefile:45: pd-lib-builder/Makefile.pdlibbuilder: No such file or directory make: *** No rule to make target `pd-lib-builder/Makefile.pdlibbuilder'. Stop.

Makefile.pdlinbuilder is taken from another external project:

% cp ../pd-flite/pd-lib-builder/Makefile.pdlibbuilder pd-lib-builder

% brew install json-c curl liboauth --universal Error: invalid option: --universal

% make

++++ info: using Makefile.pdlibbuilder version 0.4.4 ++++ info: using Pd API /Applications/Pd-0.52-2.app/Contents/Resources/src/m_pd.h ++++ info: making target all in lib purest_json ++++ info: making src/json-encode.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /sw/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/json-encode.o -c src/json-encode.c In file included from src/json-encode.c:31: src/json-encode.h:31:10: fatal error: 'json-c/json.h' file not found

in Makefile.pdlibbuilder:

cpp.flags := -DUNIX -DMACOSX -I /opt/homebrew/include

% make ++++ info: using Makefile.pdlibbuilder version 0.4.4 ++++ info: using Pd API /Applications/Pd-0.52-2.app/Contents/Resources/src/m_pd.h ++++ info: making target all in lib purest_json ++++ info: making src/json-encode.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /opt/homebrew/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/json-encode.o -c src/json-encode.c src/json-encode.c:36:10: fatal error: 'uthash.h' file not found

include "uthash.h"

     ^~~~~~~~~~

1 error generated. make: *** [src/json-encode.o] Error 1

% brew install uthash

% make
++++ info: using Makefile.pdlibbuilder version 0.4.4 ++++ info: using Pd API /Applications/Pd-0.52-2.app/Contents/Resources/src/m_pd.h ++++ info: making target all in lib purest_json ++++ info: making src/json-encode.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /opt/homebrew/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/json-encode.o -c src/json-encode.c ++++ info: linking objects in json-encode.pd_darwin for lib purest_json cc -undefined suppress -flat_namespace -bundle -o json-encode.pd_darwin src/json-encode.o -lc -lcurl -ljson-c -loauth
ld: library not found for -ljson-c

in Makefile.pdlibbuilder darwin section:

c.ldlibs := -lc -L/opt/homebrew/lib

% make
++++ info: using Makefile.pdlibbuilder version 0.4.4 ++++ info: using Pd API /Applications/Pd-0.52-2.app/Contents/Resources/src/m_pd.h ++++ info: making target all in lib purest_json ++++ info: evaluating implicit prerequisites in lib purest_json..... ++++ info: making src/json-encode.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /opt/homebrew/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/json-encode.o -c src/json-encode.c ++++ info: linking objects in json-encode.pd_darwin for lib purest_json cc -undefined suppress -flat_namespace -bundle -o json-encode.pd_darwin src/json-encode.o -lc -L/opt/homebrew/lib -lcurl -ljson-c -loauth
++++ info: making src/rest.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /opt/homebrew/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/rest.o -c src/rest.c ++++ info: linking objects in rest.pd_darwin for lib purest_json cc -undefined suppress -flat_namespace -bundle -o rest.pd_darwin src/rest.o -lc -L/opt/homebrew/lib -lcurl -ljson-c -loauth
++++ info: making src/urlparams.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /opt/homebrew/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/urlparams.o -c src/urlparams.c ++++ info: linking objects in urlparams.pd_darwin for lib purest_json cc -undefined suppress -flat_namespace -bundle -o urlparams.pd_darwin src/urlparams.o -lc -L/opt/homebrew/lib -lcurl -ljson-c -loauth
++++ info: making src/oauth.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /opt/homebrew/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/oauth.o -c src/oauth.c ++++ info: linking objects in oauth.pd_darwin for lib purest_json cc -undefined suppress -flat_namespace -bundle -o oauth.pd_darwin src/oauth.o -lc -L/opt/homebrew/lib -lcurl -ljson-c -loauth
++++ info: making src/json-decode.o in lib purest_json cc -DPD -I "/Applications/Pd-0.52-2.app/Contents/Resources/src" -DUNIX -DMACOSX -I /opt/homebrew/include -DVERSION='"2.0.0-alpha"' -I"src/uthash/src" -std=c99 -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -o src/json-decode.o -c src/json-decode.c ++++ info: linking objects in json-decode.pd_darwin for lib purest_json cc -undefined suppress -flat_namespace -bundle -o json-decode.pd_darwin src/json-decode.o -lc -L/opt/homebrew/lib -lcurl -ljson-c -loauth
++++info: target all in lib purest_json completed

ivan-ef commented 1 year ago

Tested, working

residuum commented 1 year ago

Thanks for your help, I have implemented it in the automatic build scripts.