Generally voluntary, but it satisfies the EU Energy Efficiency Directive's audit obligation (Art. 8) for large enterprises in many member states, and large energy users increasingly face it in tenders.
From our guide: ISO 50001 Energy Management — full context, charts and sources there.