Errors in Dos format

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
Post Reply
Nguyen_Oanh
Posts: 17
Joined: Mon Sep 12, 2016 10:32 am

Errors in Dos format

Post by Nguyen_Oanh »

Dear users!
When I run CASINO program to calculate for C2HF with correlation.data.
I have a problem with DOS format when I optimise the trial wave function
File '/home/oanhnguyen/Desktop/C2HF/input' appears to be in DOS format.
DOS2UNIX cannot be found. Please convert this file by hand, or use the
-f option to runqmc to bypass error checking.

I used optimise for Jastrow and backflow factor or only Jastrow, this error were appeared.
So, How can I fix it ?
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Errors in Dos format

Post by Mike Towler »

Hi Nguyen,

This means (probably) that your file 'input' was created on a Windows machine and you're trying to use it on a Unix/Linux machine or a modern Mac. To quote the dos2unix man page:

Code: Select all

The Dos2unix package includes utilities "dos2unix" and "unix2dos" to convert plain text files in DOS or Mac format to Unix format and vice versa. In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks.
The runqmc script is aware that this can happen, and if it finds you're using a DOS input file it will automatically run the standard utility 'dos2unix' to convert it before CASINO tries to read it and crashes.. However, it's telling you that it can't find dos2unix and that's probably because you don't have it installed. Thus - install it.. ('sudo apt-get install dos2unix' or whatever, depending on what Linux distribution you're running.)

Cheers,
Mike
Post Reply