Shaders compile but their output is ignored

I have tested both my own and other people’s shader scripts, including the example shader templates provided in Blender. They all compile; however, when I connect their output nodes to the input nodes of other shaders, they have no effect. For instance, if I set a downstream shader’s default input color to red, set my upstream test shader’s output color to green and connect the two shaders, the downstream shader will still be red, i.e. it will retain its default value. Likewise, my test shaders do not output results for printf(), error() or warning(). I have ensured that all the shaders perform dynamic calculations and have set “optimize=0” as instructed here, but this has not solved the problem. I have encountered this issue in version 2.69 on a Windows 8 computer and in version 2.71 (binaries) on a Debian computer, using both real-time and single-frame rendering in Cycles. I am getting no console errors at all on either computer.

Here is an example of a shader script that doesn’t work, despite the fact that it compiles:

You can see that even though the shader is meant to output a factor of 0.5, 0.3 or 0.7, it has no effect; the color mix node, which has a default factor of 0.0 (fully black) renders the object as fully black irrespective of the upstream shader. When I set the default factor to, say, 1.0 (fully white), the node renders the object fully white, again irrespective of the upstream shader.

I’ve been trying to sort out this problem for two days but can think of no solutions. Any advice would be welcome.

In your screenshot above, enable the “Open Shading Language” checkbox in the render area of the properties panel.

Thank you very much, jandress. I didn’t even think of looking for a tick-box!