CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   CGNS fortran code compiling with intel visual fortran xe (

dokeun April 3, 2012 11:26

CGNS fortran code compiling with intel visual fortran xe
Dear ...

I compiled cgnslib_3.1.3 using CMake-gui(ver 2.8.7) with generator 'visual studio 9 2008' and there were some options as follows.

I'd like to know what other Names unchecked in Value colume are

Should I check ENABLE_FORTRAN in order to use fortran code for my program?

However, when I did configure & generate with this option, I couldn't build "cgns.sln"

Should I check BUILD_CGNSTOOLS in order to use cgnstools?
================================================== ============
Name __________________________________________________ Value
================================================== ============
BUILD_CGNSTOOLS___________________________________ ___ □
CGNS_BUILD_SHARED_________________________________ ___v
CGNS_USE_SHARED___________________________________ ___v
CMAKE_BUILD_Type__________________________________ ____Release
CMAKE_INSTALL_PREFIX______________________________ ____C:/Program files/cgns
ENABLE_FORTRAN____________________________________ ____□
ENABLE_HDF5_______________________________________ ____□
ENABLE_LEGACY_____________________________________ ____□
ENABLE_LFS________________________________________ ____□
ENABLE_SCOPING____________________________________ ___□
ENABLE_TESTS______________________________________ ____□
================================================== ============

With default option, I could build cgns.sln by MS visual studio and got some files as follows in debug folder

"cgns.idb, cgns.lib, cgns.pdb, cgnsdll.dll, cgnsdll.exp, cgnsdll.idb, cgnsdll.ilk, cgnsdll.lib, cgnsdll.pdb"

What should I do with these files in order to test fortran files described in CGNS User's Manual?

dokeun April 5, 2012 21:01

got solved
1 Attachment(s)
Hi there.
After few days of efforts, I somehow installed the library & cgnstools.
When I first tried to install it, I didn't even know what makefile, cmake mean.
And README and other explanation files included were not enough for me.
Even though this looks clumsy a little, it works.
So I'd like to share my experience hoping that it can be a help.
And I hope someone presents more refined solution.

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

2. Download HDF5 from 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

3. Download Tcl from and install it.
=> In my case, I installed it to c:\Program files\Tcl
=> Regist ...Tcl\include as include < environment variables
...Tcl\lib as lib < environment variables

4. Unzip cgnslib_3.1.3.tar. wherever you want
=>then some files and directories will be shown

5. 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.

6. Go to the ...\src under the directory you unzipped cgnslib_3.1.3
=> ex) c:\Program files\CGNS\cgnslib_3.1.3\src>__

7. type
..\src>configure.bat -lfs -ifort -tcl [tcl directory] -install [install directory]
=> here, [tcl directory] is where the tcl is installed. ex)c:\Progra~1\Tcl
=> [install directory] is where a result will be installed. ex)c:\Progra~1\CGNS
=> Caution! There should not be any blanck when those directories are typed. Type "Progra~1" instead of "Program files".

8. type
..\src>nmake all
=> In my case two error messages were given but those didn't matter. I just typed this command one more.

9. 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.
...src\sgnstools>nmake install
A. Regist following folders in MS Visual Studio>Tools>Options>Intel(r) VF>Compiler
=> But, when I compiled fortran code from example codes, I had to include "..CGNS\lib\cgns.lib" as resource file in MS Visual IDE. Refer attached image.

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

All times are GMT -4. The time now is 01:52.