CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   CGNS Compiling (https://www.cfd-online.com/Forums/main/12105-cgns-compiling.html)

Diego August 28, 2006 14:56

CGNS Compiling
 
Hi everyone!

I just recently downloaded CGNS ver 2.4, I tried to compile it using VS 2005 C++ Express, but it was unsuccessful, then I tried to compile it using MinGW with the MSYS interface, but I get the following error when I use the compiled library in one of my FORTRAN code: "no a valid reference cg_open_f_". The CGNS have a test case to prove your FORTRAN compiler, but although the test as sucessful, I still get the same error when I tried to compile my code, please can anyone tell me how to compile CGNS library in WinXP and how to use it in a Lahey Fortran 95 compiler.

manaliac April 23, 2010 04:29

CGNS under widows
 
Hello,
I saw your post, and I wondered if you succeeded in installing CGNS lib and compiling a fortran program.

Thank you

DoHander April 23, 2010 08:56

In order to successfully compile CGNS you will need an ANSI C compiler (Visual Studio 2003,2005,2008 are not ANSI C conformal) if you use Linux, Windows or Mac you can use the gcc compiler to compile CGNS.

Do

manaliac April 23, 2010 09:15

Hello,
I succeeded in building the cgns lib with MS Visual C++ ( nmake), but when I tried to compile a fortran program given with the test files, I failed.

It seemed like the libcgns.lib contains a lot of errors or something like that, because when I compile under Fortran Power Station 4.0 I received a bunch of errors (these errors are generated in case I added libcgns.lib as file into the projet (as library file) :
Linking...
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
cgwrite.obj : error LNK2001: unresolved external symbol _CG_ARRAY_WRITE_F@28
libcgns.lib(cgns_io.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcgns.lib(ADF_interface.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcgns.lib(ADF_internals.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcgns.lib(cg_ftoc.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcgns.lib(cgnslib.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcgns.lib(cgns_internals.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcgns.lib(cgns_error.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcgns.lib(cgns_io.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcgns.lib(ADF_interface.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcgns.lib(ADF_internals.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcgns.lib(cg_ftoc.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcgns.lib(cgnslib.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcgns.lib(cgns_internals.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcgns.lib(cgns_error.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcgns.lib(cgnslib.obj) : error LNK2001: unresolved external symbol __ftol2_sse
libcgns.lib(cgns_error.obj) : error LNK2001: unresolved external symbol ___iob_func
libcgns.lib(cgns_io.obj) : error LNK2001: unresolved external symbol ___iob_func
libcgns.lib(ADF_interface.obj) : error LNK2001: unresolved external symbol ___iob_func
libcgns.lib(ADF_internals.obj) : error LNK2001: unresolved external symbol ___iob_func
libcgns.lib(cgns_io.obj) : error LNK2001: unresolved external symbol __stat64i32
libcgns.lib(ADF_internals.obj) : error LNK2001: unresolved external symbol __ctime64
libcgns.lib(ADF_internals.obj) : error LNK2001: unresolved external symbol __time64
cgwrite.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.
cgwrite.exe - 24 error(s), 28 warning(s).

So I didn't know anymore if the errors are in the CGNS lib or not.
When I didnt add that library, I had :
--------------------Configuration: cgwrite - Win32 Debug--------------------
Linking...
cgwrite.obj : error LNK2001: unresolved external symbol _CG_CLOSE_F@8
cgwrite.obj : error LNK2001: unresolved external symbol _CG_DATACLASS_WRITE_F@8
cgwrite.obj : error LNK2001: unresolved external symbol _CG_BCDATA_WRITE_F@28
cgwrite.obj : error LNK2001: unresolved external symbol _CG_DATASET_WRITE_F@36
cgwrite.obj : error LNK2001: unresolved external symbol _CG_GRIDLOCATION_WRITE_F@8
cgwrite.obj : error LNK2001: unresolved external symbol _CG_BOCO_NORMAL_WRITE_F@36
cgwrite.obj : error LNK2001: unresolved external symbol _CG_BOCO_WRITE_F@44
cgwrite.obj : error LNK2001: unresolved external symbol _CG_DESCRIPTOR_WRITE_F@20
cgwrite.obj : error LNK2001: unresolved external symbol _CG_1TO1_WRITE_F@48
cgwrite.obj : error LNK2001: unresolved external symbol _CG_CONN_WRITE_F@76
cgwrite.obj : error LNK2001: unresolved external symbol _CG_HOLE_WRITE_F@48
cgwrite.obj : error LNK2001: unresolved external symbol _CG_UNITS_WRITE_F@24
cgwrite.obj : error LNK2001: unresolved external symbol _CG_ARRAY_WRITE_F@28
cgwrite.obj : error LNK2001: unresolved external symbol _cg_goto_f
cgwrite.obj : error LNK2001: unresolved external symbol _CG_DISCRETE_WRITE_F@28
cgwrite.obj : error LNK2001: unresolved external symbol _CG_FIELD_WRITE_F@40
cgwrite.obj : error LNK2001: unresolved external symbol _CG_SOL_WRITE_F@32
cgwrite.obj : error LNK2001: unresolved external symbol _CG_COORD_WRITE_F@36
cgwrite.obj : error LNK2001: unresolved external symbol _CG_ZONE_WRITE_F@32
cgwrite.obj : error LNK2001: unresolved external symbol _CG_BASE_WRITE_F@28
cgwrite.obj : error LNK2001: unresolved external symbol _CG_ERROR_EXIT_F@0
cgwrite.obj : error LNK2001: unresolved external symbol _CG_OPEN_F@20
cgwrite.exe : fatal error LNK1120: 22 unresolved externals
Error executing link.exe.
cgwrite.exe - 23 error(s), 0 warning(s)


So do you have an idea why I have these errors?

DoHander April 23, 2010 18:51

Are you sure your C++ and Fortran compiler are compatible ? What version of Microsoft VS you use ?

Do

manaliac April 24, 2010 16:51

I'm using MS Visual C++ 2008, and for the fortran it's Fortran Power Station 4.0.

What do you think about it? Are they incompatible?

Thanks

Manal

DoHander April 24, 2010 19:20

I'm almost certain they are totally incompatible !!! Fortran Power Station 4.0 is a very old Fortran 77 compiler.

Compatible compilers (after my knowledge):

1. Visual Studio 6.0 and Compaq Visual Fortran (commercial, obsolete compilers)
2. Intel Visual Fortran and Intel C++ (commercial)
3. gfortran and gcc (free)

Do

DoHander April 24, 2010 19:22

I suppose you can use Cygwin to compile all libCGNS and your Fortran programs (you will have for free all the tools you need to do your projects).

Do

manaliac April 25, 2010 09:03

I do have Cygwin, so I have to download a package for Cygwin which contains a Fortran compiler?

Thanks for all your replies.

Manal

DoHander April 25, 2010 10:06

If you have Cygwin installed just double click on Setup.exe (or something similar from which you have initially install Cygwin) and be sure gfortran (this is the Fortran compiler) and gcc (the C compiler) are selected for installation.

You can search Google for "cygwin gfortran installation" or "cygwin gcc installation" if my above instructions looks obscure :).

Do

manaliac April 25, 2010 10:46

Thank you for your advice! I've got Cygwin a week ago, and I downloaded all the important packages (gcc, make, emacs) minus the gfortran! But I will try tomorrow at work to do it! And I let you know if I succeed or not!

Have a good day!

Manal

manaliac April 26, 2010 04:20

I've got the COMPAQ VISUAL FORTRAN 6.6, do you think it's a compatible version with the Visual C++ 2008 express??

Thanks

MAnal

DoHander April 26, 2010 14:51

COMPAQ VISUAL FORTRAN 6.6 is compatible with Visual Studio 6, I don't think will work with VS 2008 Express Edition.

Do

Mimou June 22, 2010 11:05

Hi manaliac,
It seems that I have the same problem as you, have you succeed to run CGNS?

Deevyendu July 29, 2010 04:58

CGNS installation
 
hi i downloaded CGNS sof
tware but not getting how to install it ...can any one tel how to compile ... cgns with help of ansi c or gcc ? i had downloaded but not getting how to complie or how to see the files

hamzamotiwala November 4, 2010 04:14

Hello,

I am new to this forum. Since the discussion was about CGNS, I thought of making a relevant request .I am looking for a working sample C program that can read and write data from an unstructured grid file in CGNS Format. Can anyone help me out with this problem please. Will really appreciate the help.

Thanks :)

shirazbj November 6, 2010 03:50

Hi,

I use gcc 4.5.1 from Equation Solution ( http://www.equation.com/servlet/equation.cmd?call=fortran )

complied libcgns.lib from source under win xp.

Then tried the write_test.c example under the \tests folder. I got a test.cgns file, it looks all good in VisIt2.1

Have fun.

Cean

chen04 December 21, 2014 01:40

Quote:

Originally Posted by Diego
;44953
Hi everyone!

I just recently downloaded CGNS ver 2.4, I tried to compile it using VS 2005 C++ Express, but it was unsuccessful, then I tried to compile it using MinGW with the MSYS interface, but I get the following error when I use the compiled library in one of my FORTRAN code: "no a valid reference cg_open_f_". The CGNS have a test case to prove your FORTRAN compiler, but although the test as sucessful, I still get the same error when I tried to compile my code, please can anyone tell me how to compile CGNS library in WinXP and how to use it in a Lahey Fortran 95 compiler.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!
Dear Diego
I recently also try to install CGNS on my playform, I tried to compile it using VS2010 and interfortran 2011, and it was unsucessful, when I use nmake install it warns me can not find %\cgns_3.2.1\src\lib\cngs.lib. I wonder have you ever meet this error. If so can you tell me how to correct it, If not can you tell me how to install cgsn and which complier should I use.Thank you very much!
Chen


All times are GMT -4. The time now is 08:58.