This blog is for noting down the details about setting up the development environment for RMCProfile on Windows machine. The notes here are still based on the conventional way of compiling using make
files. There is some work happening in the background now to transfer the compiling to using cmake
. Before the whole pipeline of cmake
is ready, we will still rely on the route as in the current blog. In fact, even the current route is depracated, some of the notes will still apply when setting up the development environment.
-
Nowadays, we are pretty much using the intel Fortran compiler which now is free, through the
oneAPI
toolkit. To install the compiler, we need to first installMicrosoft Visual Studio
(the community version is fine, and it is free). We may need to remove whatever existing old versions ofMicrosoft Visual Studio
(e.g., the 2019 version may need to be removed, if the we intend to use the 2022 version). I am not sure whether this is the cause for my issue, but in my case, I have been struggling a lot with theoneAPI
setup in the down stream. Anyhow, having a clean version of 2022 turns out to be working fine for me. -
Then we want to install the
OneAPI
toolkit.Here is the official website for download and instructions (as of writing), oneAPI Base Toolkit download and install
See the
Run Sample Code to Verify Installation
section on the website for the command to run for terminal (e.g.,powershell
) initialization. -
To use
make
and also for the purpose of back-compatibility for some plotting routines, we need to installCygwin
and set up thepgplot
library inside theCygwin
environment (see the section at the very bottom for details about setting uppgplot
inCygwin
). When installingCygwin
, the following selections are necessary:make
,x11
andxorg
. Later on when installing thepgplot
library, if some of theX11
stuff are missing, we can Google what we need to include forX11
installation according to the error message we got. -
We will need to install
nvcc
for compiling CUDA codes involved in theRMCProfile
project. As of writing, the offial website for download the installation file is this. In case it is changed, we can just google ‘CUDA nvcc install’ or something relevant to search for information. -
In preparation for the compiling, we may need to delete unnecessary entries in the
PATH
environment variable. Otherwise, thenvcc
command will fail when it is trying to set up the environment on-the-fly. It is something relevant to the running ofvcvars64.bat
script which will be running on-the-fly when runningnvcc
, and the fundamental reason for the potential failure is the value of the environment variablePATH
is too long. On Windows, we can useStart
to search for ‘environment variable’ to bring up the GUI window for changing thePATH
variable. -
On
powershell
, we need to runcmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'
to initialize the terminal environment.
This command needs to be run each time when launching a new
powershell
terminal.When we see error like this,
LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
it infers the
oneAPI
environment initializer was not run, in which case we just need to run the command above to initialize the environment and try again the compiling. -
As a side note, with the latest intel
oneAPI
compiler (ifort
), the argument that goes intoc_loc
(the function used in the source codes for fetching the address of a pointer
) should be defined as a pointer. The original definition of some of the variables (used as the argument forc_loc
) as allocatable arrays would not work. -
When encountering the issue with unresolved CUDA symbols, we may need to change the cuda library files to the version that is compatible with the version of
nvcc
being used for the compiling. Specifically, two CUDA library filescublas.lib
andcudart.lib
need to be linked while making thermcprofile.exe
executable. For specific command for linking, etc., refer to thoseMakefile
files in theRMCProfile
repository – for the moment, the source code is not open source yet. To get access, get in touch with me here. We need to copy the proper version of these two files to somewhere (and the path to the two library files will be specified while linking to makermcprofile.exe
).In my case, I was using the
12.6
version ofnvcc
and my library files could be found here,C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib\x64
.
=================I AM A SEPARATOR=================
Here follows are the detaild instructions about setting up pgplot
in Cygwin
.
-
Grab the
pgplot5.2.tar.gz
file which has already been included in the main directory of theRMCProfile
repository. -
Decompress and extract the contents of the distribution file in a source directory. In this sense, I always place
pgplot5.2.tar.gz
under /usr/local/src. Then we can do,cd /usr/local/src mv [SOMEWHERE]/pgplot5.2.tar.gz . tar zxvf pgplot5.2.tar.gz
This will create
/usr/local/src/pgplot
and subdirectories. -
Create the directory where
PGPLOT
will be actually installed,mkdir /usr/local/pgplot cd /usr/local/pgplot
-
Copy the file
drivers.list
from the source directory to the installation directory,cp /usr/local/src/pgplot/drivers.list .
-
Edit that file and remove the exclamation mark (first column of each row) in front of the following graphic devices,
/PS, /VPS, /CPS, /VCPS, /Xserve and /XWindow
-
Create the makefile. From the installation directory
/usr/local/pgplot
, execute,/usr/local/src/pgplot/makemake /usr/local/src/pgplot linux g77_gcc_aout
-
Edit the file makefile and change the line,
FCOMPL=g77
to
FCOMPL=gfortran
-
Compile the source files,
make make cpg make clean