Compile CGNS under windows

Categories: CFD

PC environment is as follows..

OS : windows 7

Program : MS Visual Studio 2008, Intell Visual Fortran

[How to install cgns library and cgnstools]

  1. Download lastest source file(ver. 3.1.3) from http://cgns.sourceforge.net/download.html

  2. Download HDF5 from http://www.hdfgroup.org/HDF5/release…n5.html#obtain and install it.

=> I’m not sure if it is necessary but I followed an install guide in the cgns sources

=> I’m not sure waht you should install. But I choosed hdf5-1.8.12-win64-vs10shared.zip and hdf5-1.8.12-win32-vs10shared.zip

  1. Download Tcl from http://www.activestate.com/activetcl/downloads and install it.

=> In my case, I installed it to c:Program filesTcl

=> Regist …Tclinclude as include < environment variables

…Tcllib as lib < environment variables

  1. Unzip cgnslib_3.1.3.tar. wherever you want

=>then some files and directories will be shown

  1. Excute “Visual Studio 2008 Command Prompt” from Start>Miscrosoft Visual Stuio 2008>Visual Studio Tools

=>cmd won’t work if you don’t set path or something in environment configuration.

  1. Go to the …src under the directory you unzipped cgnslib_3.1.3

=> ex) c:Program filesCGNScgnslib_3.1.3src>__

  1. type

..src>configure.bat -lfs -ifort -tcl [tcl directory] -install [install directory]

=> here, [tcl directory] is where the tcl is installed. ex)c:Progra~1Tcl

=> [install directory] is where a result will be installed. ex)c:Progra~1CGNS

=> Caution! There should not be any blanck when those directories are typed. Type “Progra~1” instead of “Program files”.

  1. type

..src>nmake all

=> In my case two error messages were given but those didn’t matter. I just typed this command one more.

  1. type

..src>namke install

=> Then 2 or 4 folders including files will be installed to [install directory]

=> If you have no problem, then there should be 4 directories.

include, bin, share, lib

=> In my case there were just 2 folders, include, lib. so I executed.

…srcCgnstools>cgconfig.bat

…srcCgnstools>nmake install

————————————————————————————————————————————————————-

A. Regist following folders in MS Visual Studio>Tools>Options>Intel(r) VF>Compiler

…>CGNS>lib

…>CGNS>include

=> But, when I compiled fortran code from example codes, I had to include “..CGNSlibcgns.lib” as resource file in MS Visual IDE. Refer attached image.

B. Just execute batch files in the folder, …CGNS>bin for cgnstools

 

EXAMPLES FOR CONFIGURE:

1Compile with VS2012 FOR 32BIT

cd C:Program Files (x86)Microsoft Visual Studio 11.0VCbin

c:

vcvars32.bat

cd E:Graduate ThesisGRID_TECHCGNScgnslib_3.2.1src

e:

configure.bat -lfs -ifort -tcl c:/Progra~2/Tcl -install c:Progra~2CGNS

If you need HDF5, you could add -hdf5 c:/Progra~2/HDF_GR~1/HDF5/1828BA~1.12

2Compile with VS2012 FOR 64BIT

cd C:Program Files (x86)Microsoft Visual Studio 11.0VC

c:

vcvarsall.bat amd64

cd E:Graduate ThesisGRID_TECHCGNScgnslib_3.2.1src

e:

configure.bat -lfs -ifort -tcl c:/Progra~1/Tcl -64 -install c:Progra~1CGNS

If you need HDF5, you could add -hdf5 c:/Progra~1/HDF_GR~1/HDF5/1828BA~1.12

 

NOTICE: IF YOU USE HDF5, THE LIB FILE OF HDF5 SHOULD BE LINKED IN YOUR PROJECT

comments powered by Disqus