armory3d / armortools

3D Content Creation Tools
https://armorpaint.org
Other
3.29k stars 336 forks source link

Build Failed on MacOS #1718

Closed Anthony-Gaudino closed 3 months ago

Anthony-Gaudino commented 5 months ago

ArmorPaint version: 2afcbffbef150444d600e5868d062b5803fb8e66

OS / GPU model: macOS 14.5 (23F79), M1 Pro

Issue description: Trying to build on macOS on Xcode produces a series of errors:

armortools/armorcore/Sources/krom_api.h:2186:8 Redefinition of 'scale'

armortools/armorcore/Sources/krom_api.h:2186:16 Call to undeclared function 'TO_F32'; ISO C99 and later do not support implicit function declarations

armortools/armorcore/Sources/krom_api.h:2186:23 Use of undeclared identifier 'args'

armortools/armorcore/Sources/krom_api.h:2188:63 No member named 'data' in 'struct u8_array'

armortools/armorcore/Sources/krom_api.h:2259:7 Use of undeclared identifier 'texsobol'; did you mean 'tex_sobol'?

armortools/armorcore/Sources/krom_api.h:2260:54 Use of undeclared identifier 'texsobol'; did you mean 'tex_sobol'?

armortools/armorcore/Sources/krom_api.h:2261:3 Use of undeclared identifier 'texsobol'; did you mean 'tex_sobol'?

armortools/armorcore/Sources/krom_api.h:2263:7 Use of undeclared identifier 'texscramble'; did you mean 'tex_scramble'?

armortools/armorcore/Sources/krom_api.h:2264:54 Use of undeclared identifier 'texscramble'; did you mean 'tex_scramble'?

armortools/armorcore/Sources/krom_api.h:2265:3 Use of undeclared identifier 'texscramble'; did you mean 'tex_scramble'?

armortools/armorcore/Sources/krom_api.h:2267:7 Use of undeclared identifier 'texrank'; did you mean 'tex_rank'?

armortools/armorcore/Sources/krom_api.h:2268:54 Use of undeclared identifier 'texrank'; did you mean 'tex_rank'?

armortools/armorcore/Sources/krom_api.h:2269:3 Use of undeclared identifier 'texrank'; did you mean 'tex_rank'?

armortools/armorcore/Sources/krom_api.h:2272:150 Use of undeclared identifier 'texsobol'; did you mean 'tex_sobol'?

armortools/armorcore/Sources/krom_api.h:2272:176 Use of undeclared identifier 'texscramble'; did you mean 'tex_scramble'?

armortools/armorcore/Sources/krom_api.h:2272:205 Use of undeclared identifier 'texrank'; did you mean 'tex_rank'?

armortools/armorcore/Sources/krom_api.h:2286:31 No member named 'data' in 'struct u8_array'

This seems to be the same as reported on #1715

Steps to reproduce:

git clone --recursive https://github.com/armory3d/armortools
cd armortools
git checkout 2afcbffbef150444d600e5868d062b5803fb8e66
git submodule update --init --recursive
cd armorcore
git apply Patches/metal_raytrace.diff --directory=Kinc
cd ../armorpaint
../armorcore/Kinc/make --from ../armorcore -g metal
cp -a build/krom/ ../armorcore/Deployment

After that open Xcode and try to build it.

Anthony-Gaudino commented 5 months ago

On 413f6d93ba5cfe437593e1359f11bcf424f818ad I was able to build on Xcode, had to make a small fix on iron_string.c (#include <ctype.h>) but when running I get this error: Could not load krom.js, aborting.

Anthony-Gaudino commented 5 months ago

Used ../armorcore/Kinc/make --from ../armorcore -g metal --compile instead of ../armorcore/Kinc/make --from ../armorcore -g metal which generates the ArmorPaint.app executable, but it always crashes when running it.

Anthony-Gaudino commented 5 months ago

Was able to have version 0.9 running with:

git clone --recursive https://github.com/armory3d/armortools --branch 23.08
cd armortools/armorcore
git apply patch/metal_raytrace.diff --directory=Kinc
cd ../armorpaint
../armorcore/Kinc/make --from ../armorcore -g metal
cp -a build/krom/ ../armorcore/Deployment
../armorcore/Kinc/make --from ../armorcore -g metal --compile

Then navigate to armortools/armorpaint/build/build and run ArmorPaint.app.

Maybe running

../armorcore/Kinc/make --from ../armorcore -g metal
cp -a build/krom/ ../armorcore/Deployment

Is not necessary, but I did it anyway this time.

luboslenco commented 3 months ago

Sorry it's taking so long, hopefully fixed in the coming days.