floooh / oryol

A small, portable and extensible C++ 3D coding framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not compiling on macOS10.14.1 (recent update)

danhambleton opened this issue · comments

I just updated Mojave and tried to built my project (which has been working great). I now get these errors:
image
Any suggestions?

Hmm, I've also been on Mojave since the beta (currently 10.14.2 and Xcode 10.1) and haven't noticed problems (except that GL support in GLFW is broken of course, so you should use metal-osx-xcode-debug, but at least compiling also still works with the GL backend).

The error message looks like the shader generation build step didn't work (the class DbgTextShader is created by the code generator).

If this is the case there should be other error messages earlier when the ALL_GENERATE target is built, can you check and copy-paste them here?

Also did you try the following?

> ./fips diag tools
...anything unusual here?
> ./fips clean all
...clean everything, just in case any partially generated files are around
...which might confuse the timestamp checking
> ./fips build
...and rebuild

All the versions again on my machine for cross-checking:

  • macOS: 10.14.2 Beta (18C48a)
  • Xcode: 10.1 (10B61)
  • clang --version: Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  • cmake --version: cmake version 3.13.0
  • python --version: Python 2.7.10 (the one that comes preinstalled on macOS)

Cheers!

Interesting! The diagnostics reveals:

=== tools:
git:	found
cmake:	found
ccmake:	found
make:	found
ninja:	OPTIONAL, NOT FOUND (required for building '*-ninja-*' configs)
xcodebuild:	found
javac:	OPTIONAL, NOT FOUND (version 8 required for Android development, installed with the Java JDK)
java:	OPTIONAL, NOT FOUND (version 8 required for Android development, installed with the Java JDK)
python2:	found
ccache:	OPTIONAL, NOT FOUND (used with './fips set ccache on')
/bin/sh: code: command not found
vscode:	OPTIONAL, NOT FOUND (used as IDE with vscode configs)
clion:	OPTIONAL, NOT FOUND (used as IDE with clion configs)

So, looks like bin/sh is missing (or appears to be)? No idea why that might the case, but it does explain a lot.

Update: As expected, bin/sh is definitely on the machine and available via PATH. So, any ideas as to why fips doesn't pick it up?

No, the error message is misleading (I wonder why it's here though), it means that "/bin/sh" can't find "code" (the VSCode executable). So apart from the confusing message, everything is alright.

PS: I have fixed that confusing output problem.

Here is the output of the build step...
build_debug.txt

In case it helps, DebugShaders.h is being created BUT the file is empty...

image

Ok, looks like the shader code generation had a problem. Can you do the following:

  • ./fips clean (that's important to remove the partially generated shader files)
  • ./fips gen + open (to open Xcode)
  • select and build the ALL_GENERATE target, and post the output here like in this screenshot:

screen shot 2018-11-27 at 10 15 28 am


Showing Recent Messages

Prepare build
note: Using legacy build system


Build target ALL_GENERATE of project iogramx with configuration Debug

PhaseScriptExecution CMake\ Rules /Users/daniel/Dev/iogramx/fips-build/iogramx/osx-xcode-debug/oryol_Dbg/iogramx.build/Debug/ALL_GENERATE.build/Script-C0E09B622AD94DBEB561478C.sh
    cd /Users/daniel/Dev/iogramx/iogramx
    /bin/sh -c /Users/daniel/Dev/iogramx/fips-build/iogramx/osx-xcode-debug/oryol_Dbg/iogramx.build/Debug/ALL_GENERATE.build/Script-C0E09B622AD94DBEB561478C.sh

echo ""

cd /Users/daniel/Dev/iogramx/iogramx && /usr/local/bin/python /Users/daniel/Dev/iogramx/fips-build/iogramx/osx-xcode-debug/fips-gen.py /Users/daniel/Dev/iogramx/fips-build/iogramx/osx-xcode-debug/fips_codegen.yml
## shader code gen: /Users/daniel/Dev/iogramx/iogramx/src/shaders.glsl

It does seem to pick the shaders from my project (which uses oryol as an import), but no mention of the DebugShaders...

Hmm and below the line

## shader code gen: /Users/daniel/Dev/iogramx/iogramx/src/shaders.glsl

There's nothing else? At least until this line it looks as expected, the interesting part happens right after that log message though.

A few other things to check:

  • whether the oryol-shdc executable works:
# from the oryol project directory:
> cd tools/osx
> ./oryol_shdc -help
Oryol SPIR-V to GLSL/HLSL/MSL cross-compiler
Based on SPIRV-Cross: https://github.com/KhronosGroup/SPIRV-Cross
-help		-- show help
-spirv		-- SPIR-V input file
-o		-- output file
-lang		-- target language (glsl100, glsles3, glsl120, glsl330, metal, hlsl

...and it would be interesting whether any cross-compiled shader files are generated at all (this is done by the oryol-shdc tool):

> cd ../fips-build/oryol/osx-xcode-debug/code/Samples/Triangle
> ls
CMakeFiles              oryol.build             shaders_fs.glsl.frag    shaders_fs.glsl330.json shaders_vs.glsl330
Info.plist              shaders.cc              shaders_fs.glsl.spv     shaders_vs.glsl.spv     shaders_vs.glsl330.json
cmake_install.cmake     shaders.h               shaders_fs.glsl330      shaders_vs.glsl.vert

Note the *.spv and .glsl330 files. Do these exist?