Low-cost and versatile fabrication of silicon-compatible photonic integrated circuits for active devices and sensors