Compiling CASINO in Windows 7

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
Zoltan_Radnai
Posts: 7
Joined: Wed Jan 08, 2014 2:24 pm

Re: Compiling CASINO in Windows 7

Post by Zoltan_Radnai »

"linuxpc-gcc" is the name of a CASINO_ARCH configuration. "gcc" is the name of the compiler. The two are different things.
Amir_Shamkhali wrote:I select p option but it does not work because I deleted the previous compiled file and its arch.
The "p" option works fine in Cygwin. If it's not working, then your CASINO installation is damaged, maybe you deleted an essential part of it. Delete the CASINO directory, and reextract it from the downloaded tar.gz file.

The "p" option expects you to specify the name of a CASINO_ARCH, which is "linuxpc-gcc" for Cygwin.
When I select "n" option, it wants fortran and gcc compilers. I enter gfortran and it accepts, but when I use "linuxpc-gcc" it is not accepted (cannot find compiler), but when I enter gcc it accepts. what is wrong?
You should not use the "n" option, it is not required in Cygwin. (At any rate, this option expects you to specify the name of a compiler, for which "gcc" is the correct answer).
Amir_Shamkhali
Posts: 10
Joined: Thu Mar 20, 2014 11:48 am

Re: Compiling CASINO in Windows 7

Post by Amir_Shamkhali »

Dear Zoltan
I think that the compilation was successful. When I defined the PATH for runqmc and typed "runqmc --help" the following massage is appeared. Is it anything true?

Code: Select all

$ runqmc --help
WARNING: Current CASINO_ARCH=linuxpc-gcc does not match the following
         parameters of the current machine: KERNEL OS
Usage
=====
runqmc [<options>] [[--] <directories>]

This script will run the CASINO calculations set up in <directories>.
<directories> is '.' by default.  <options> can be given as GNU-style long
options ('--option[=value]') or as UNIX-style short options ('-abc<c-value>
-de <e-value> -f...', where the space between '-x' and '<x-value>' is
optional).

Allowed options on this machine type:
 --force | -f
   Run the calculation without checking for presence/correctness of input
   files.

 --check-only | -c
   Stop before running the calculation.  In clusters, this option can be used
   to produce the batch submission script for manual checking; '--check-only
   --force' would only produce a submission script in these systems.

 --unlock | -u
   Ignore existing lock files and run the calculation regardless.  Using this
   option will remove stale lock files left over by a runqmc instance that died
   without being able to unlock the directory.

 --version=<version> | --opt | --dev | --debug|-d | --prof
   Select the binary version <version>, which ought to be one of 'opt', 'dev',
   'debug' or 'prof'.  --opt, --dev, --debug and --prof are equivalent to
   the respective --version=<version> option.  -d sets <version> to 'debug'.
   <version> is set to 'opt' by default.

 --continue
   Continue a previous run which provides continuation info.  This requires
   using the MAX_CPU_TIME and/or MAX_REAL_TIME input keywords.  This option
   is not available when running multiple jobs.

 --auto-continue
   Start and automatically continue a run until it finishes.  This requires
   using the MAX_CPU_TIME and/or MAX_REAL_TIME input keywords, and
   partitioning the job into multiple blocks (CASINO can emergency stop
   at the end of a block if there is not sufficient time remaining to do at
   least one more block).  This option is not available when running multiple
   jobs.

 --home=<home> | --chome=<home> | -H <home>
   Set the location of the CASINO installation to <home>.  By default, <home>
   is determined by the location of this script, or set to $HOME/CASINO if
   unsuccessful.

 --binary=<binary> | -b <binary>
   Set the binary name to use to <binary> instead of 'casino'.  This only needs
   to be used for custom compilations with the option 'EXECUTABLE=<binary>'.

 --tpp=<tpp> | -t <tpp>
   Set the number of OpenMP threads per process to <tpp>.  This requires having
   compiled the code with OpenMP support, as in 'make Openmp'

 --help | -h
   Display this help.  If the CASINO_ARCH can be determined and exists, the
   help will display options specific to the current manchine, else all options
   will be displayed.

 --verbosity=<verbosity> | -v | -q
   Set the verbosity level of the machine set-up process to <verbosity>.  By
   default <verbosity> is 0.  '-v' increases the verbosity level by 1, and
   '-q' decreases it by 1.

 --info | -i
   Report back various machine-dependent parameters whose value one might like
   to know when deciding how to run a job, then stop. This is useful
   for inquiring what runqmc believes to be e.g. the number of cores per node,
   according to the currently activated arch file.

 --background | -B
   Run CASINO in the background, returning control to the shell after starting
   the run.  This has the same effect as 'runqmc & disown', whereby the
   CASINO process is detached from the shell, so if one wants to stop the run
   'kill' or 'killall' must be used.  It is safe to log out after running with
   this option, the calculation will continue - no need for nohup/disown.
   Running multiple jobs causes them to run in the background whether this
   option is specified or not.

 --print-out | -P
   Print out the output of CASINO as it is being run.  Implies --background.
   [CTRL]-[C] will stop the print-out, and the CASINO job will remain in the
   background.  This option is ignored when running multiple jobs.

 --debugger=<debugger> | --gdb|-g | --valgrind
   Run the code through the a debugger.  This automatically sets <version> to
   'debug' if no version had been selected.  --gdb and -g are equivalent to
   --debugger="gdb -q".  --valgrind is equivalent to --debugger="valgrind"
   Note that specific debuggers tend to work better with specific compilers,
   for example the gdb debugger tends works better with GCC's gfortran than
   with Intel's ifort.

Additional options on this particular machine:
 --user.nice=<nice>
   Nice-value for the job on workstations.
   Default value: <determined at run time>
   Minimum value: <determined at run time>
   Maximum value: 19
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Compiling CASINO in Windows 7

Post by Mike Towler »

I think you actually need to be using the CASINO_ARCH 'windowspc-gcc' where the OS is defined correctly - not the linuxpc-gcc one.. Then it won't whine about the kernel/OS.
Zoltan_Radnai
Posts: 7
Joined: Wed Jan 08, 2014 2:24 pm

Re: Compiling CASINO in Windows 7

Post by Zoltan_Radnai »

Mike Towler wrote:I think you actually need to be using the CASINO_ARCH 'windowspc-gcc' where the OS is defined correctly - not the linuxpc-gcc one.. Then it won't whine about the kernel/OS.
No, "linuxpc-gcc" is the correct one to use. The Cygwin environment behaves, for our purposes, like a GNU/Linux machine. The "windowspc-gcc" ARCH serves a different purpose, and is obsolete in my opinion. With "linuxpc-gcc", CASINO compiles and runs fine, without the need for further special configuration.

The Warning about the KERNEL and OS variable can be safely ignored. In theory it's possible to eliminate it by making a new ARCH specifically for Cygwin/Linux, based on linuxpc-gcc. However, the Warning does not affect CASINO's operation.

Here comes some technical explanation for the difference between linuxpc-gcc and windowspc-gcc, mostly for clarity. You can safely ignore the text below unless you really want to get into the nitty gritty details.

There are two ways to use the Cygwin environment to compile an application originally written for Linux, in order to run it under Windows. The first is to compile it targeting the Cygwin environment. In this case, the application will require Cygwin to run, but will see an almost complete Linux-like environment, so usually little or no special care needs to be taken. The application does not need to be aware that it's running on Windows.

The second way is to compile the application to natively target Windows. You still need Cygwin for the compilation (as it includes the necessary tools), but in principle the application then does not require Cygwin to run. It will run as a native Windows application. In many cases, this usually involves extra headache, some of the most common issues being difference in path separator (/ vs \) and symlinks. CASINO certainly needs some massaging if it's compiled this way.

When the ARCH is set to "linuxpc-gcc", then the first scenario happens. This is rather painless and in my opinion works well. When the ARCH is set to "windowspc-gcc", then the second scenario happens. This ARCH is rather old, and I don't think that other than Pablo, anyone has ever used it for anything.
Zoltan_Radnai
Posts: 7
Joined: Wed Jan 08, 2014 2:24 pm

Re: Compiling CASINO in Windows 7

Post by Zoltan_Radnai »

Amir_Shamkhali wrote:Dear Zoltan
I think that the compilation was successful. When I defined the PATH for runqmc and typed "runqmc --help" the following massage is appeared. Is it anything true?

Code: Select all

$ runqmc --help
WARNING: Current CASINO_ARCH=linuxpc-gcc does not match the following
         parameters of the current machine: KERNEL OS
You can safely ignore the Warning, looks like you got things working correctly. Have fun with CASINO!
Amir_Shamkhali
Posts: 10
Joined: Thu Mar 20, 2014 11:48 am

Re: Compiling CASINO in Windows 7

Post by Amir_Shamkhali »

Dear Zoltan
Thanks for your good guidance. How we can compile CASINO in cygwin for multi-core Intel processors to run in parallel? I'm using intel-Core-i7-950 cpu. What extra packages should be installed for MPI or openmpi?
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Compiling CASINO in Windows 7

Post by Mike Towler »

The warning about the KERNEL and OS variable can be safely ignored. In theory it's possible to eliminate it by making a new ARCH specifically for Cygwin/Linux, based on linuxpc-gcc. However, the Warning does not affect CASINO's operation.
Yes, but (a) ignoring it is untidy and - as CASINO developers - we don't do untidiness if we can help it ;) , and (b) knowing the kernel and OS (and hence the fact that we're using Cygwin) is in principle useful with the [a] Auto-detect valid CASINO_ARCHs for this machine option of the install script. Perhaps it could be taught to make helpful suggestions about missing stuff, or to use the install required software using package manager option? (I have no idea how one does that in Cygwin..).
The second way is to compile the application to natively target Windows. You still need Cygwin for the compilation (as it includes the necessary tools), but in principle the application then does not require Cygwin to run. It will run as a native Windows application. In many cases, this usually involves extra headache, some of the most common issues being difference in path separator (/ vs \) and symlinks. CASINO certainly needs some massaging if it's compiled this way.

Quite so. The documentation and install script need to make it absolutely clear that running as a native Windows application is not currently supported.

When the ARCH is set to "linuxpc-gcc", then the first scenario happens. This is rather painless and in my opinion works well. When the ARCH is set to "windowspc-gcc", then the second scenario happens. This ARCH is rather old, and I don't think that other than Pablo, anyone has ever used it for anything.

It's perfectly in order to make a 'windowspc_cygwin-gcc' (or whatever) arch. If the current 'windowspc' arch intended for Native Windows applications isn't useful for anything then it can be retired - otherwise it just causes confusion.

Presumably once you get MPI sorted out we'll need a 'windowspc_cygwin-gcc-parallel' ARCH (or whatever) as well..
Zoltan_Radnai
Posts: 7
Joined: Wed Jan 08, 2014 2:24 pm

Re: Compiling CASINO in Windows 7

Post by Zoltan_Radnai »

Amir_Shamkhali wrote:Dear Zoltan
Thanks for your good guidance. How we can compile CASINO in cygwin for multi-core Intel processors to run in parallel? I'm using intel-Core-i7-950 cpu. What extra packages should be installed for MPI or openmpi?
I'm afraid I have never tried to compile CASINO for parallel execution under Cygwin, nor do I know how you would get MPI working there. You have to try and figure this out yourself.
Amir_Shamkhali
Posts: 10
Joined: Thu Mar 20, 2014 11:48 am

Re: Compiling CASINO in Windows 7

Post by Amir_Shamkhali »

I think that I should find shared libraries for cyqwin. If it is not possible, only way is to compile CASINO in native Windows using MPICH. I'm trying.
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Compiling CASINO in Windows 7

Post by Mike Towler »

OK, I've now updated question A11 of the FAQ with Zoltan's instructions. See here:

http://vallico.net/casinoqmc/faqs/

This will allow you to run on a single core (which is of course pretty pointless with QMC, as it's an expensive technique) with some unnecessary whining by the run scripts. The remaining technical problems are thus:

(1) Need new linuxpc_cygwin-gcc.arch to stop runqmc whining about KERNEL/OS (the FAQ now recommends using linuxpc-gcc.arch). That means we need to understand the output of 'uname' in Cygwin on the various kinds of Windows;

(2) We don't know how to install MPI under Cygwin - I can't believe this can be very difficult; there seem to be any number of How To guides on the internet. (Amir to report..)

(3) Auto-detection via the install script apparently doesn't work ("WARNING: Received 0 reports instead of 146?").

ZR to report on (1) and (3) - when he has the time.
Post Reply