'Not able to compile swift on Ubuntu 18.04

I installed swift toolchain using instructions from swift.org. While compiling helloworld code I am getting below error.

warning: 'helloworld': failed loading cached manifest for 'helloworld': disk I/O error
error: 'helloworld': Invalid manifest
<unknown>:0: error: unable to open output file '/usr2/xyz/.cache/clang/ModuleCache/IJ5GUC7XMAO5/SwiftShims-1TLN9ZL6HKTHR.pcm': 'No such file or directory'
<unknown>:0: error: could not build C module 'SwiftShims'

I tried removing '/usr2/xyz/.cache/clang/ModuleCache', but did not work. Please help in resolving this issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source