Benedict Cumberbatch and Keira Knightley are to walk the red carpet to launch this year’s BFI London Film Festival with their film telling the life story of Alan Turing, the tortured genius hailed as the father of computer science.

The Imitation Game, which also features Matthew Goode, Mark Strong, Rory Kinnear and Charles Dance, will receive its European premiere on October 8 at the Odeon Leicester Square with a live cinecast from the red carpet and simultaneous screenings at cinemas across the UK, offering a star-studded British opening to the annual movie extravaganza.

Cumberbatch, who turned 38 at the weekend, said it was “a lovely birthday present” and he was “absolutely thrilled”. He added: “It’s such an important story and I’m just over the moon to have it up-front and centre in such a wonderful festival in my home town.”

The Imitation Game, directed by Norwegian Morten Tyldum, of Headhunters fame, follows Turing as he and his brilliant team at Bletchley Park crack the German Enigma code — and then as he is convicted as a homosexual for “gross indecency” and commits suicide in 1954 at the age of 41.

Cumberbatch said: “He was a brilliant man who was pushed into some bad places but always tried to come out with positive ideas.”

Although his war-time work helped bring an early end to the conflict, his contribution remained for many years an Official Secret.

His significance is now acknowledged and the injustice of his conviction was recognised with a posthumous pardon from the Queen last year. Cumberbatch said the film might bring Turing’s name to new audiences in countries such as America. “I hope this will do a great service to his legacy. He was a compassionate, caring individual and I hope the film shows him in 3D. He was brave and humorous — and a really beautiful writer of the most amazing poetry.”

The film was shot at locations including Bletchley Park — which had been hugely helpful, Cumberbatch said. “The science is so complicated it’s extraordinarily difficult to grasp. That is pure acting. But in those buildings you soak up a bit of the history, which is very important. It was an amazing experience just being there,”

Clare Stewart, BFI London Film Festival director, said they were thrilled to have “one of the most anticipated films of the year” for the opening night gala.

The 58th BFI London Film Festival in partnership with American Express will run from October 8 to 19. The Imitation Game will be released in cinemas on November 14. bfi.org.uk/lff