Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A CMake build system for cfl3d and some bug fixes (at least in Linux) #4

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

A CMake build system for cfl3d and some bug fixes (at least in Linux) #4

wants to merge 29 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 8, 2017

Hi, Christopher Rumsey

Thanks for your cfl3d code going public. I used this code and I thought it was very difficult to build it. So I wrote a cmake build system to detect MPI/CGNS libs, configure cfl3d automatically and generate makefile or IDE projects for compilation automatically. I think it may be helpful to someone.

The modification of CMake branch is limited to:

  • A lot of CMakeLists.txt are created to consists the cmake build system
  • A cgns-2.5.5 source code package is added to /external/cgns for compilation in case of no libcgns.a available in system library directories.
  • A usage description is added to README.md
  • In order to compile complex version of cfl3d, some .gt./.lt. comparison of complex variables in source code bc2010.F, barth3d.F, foureqn.F, global.F spalart.F are enclosed by real() function to avoid errors during compilation of complex version of cfl3d.
  • in cputime.F of maggie, a gfortran version of intrisic function ETIME is added to conditional compilation to improve compatability of cfl3d to gfortran in Linux.
  • A bash script to download all testcases are included in CFL3D/testcase directory.

I have tested it in a linux OS - Ubuntu 16.04 LTS.

FYI, cmake of kitware.inc is a cross platform build system widely used in industry. Here is a trend of serveral automatic build tools.
comparison of serveral automatic build tools

Best regards.

Di Cheng Ph.D.
Engineer in fluid mechanics
Research and Development Center
China Academy of Aerospace Aerodynamics
Phone: +86-l58Ol5949ll
Address: No.17, YunGang West Road, Fengtai District, Beijing, China
Zip Code:100074

@vliqi
Copy link
Contributor

vliqi commented Aug 9, 2017

very good job.I will test Intel fortran&Absoft fortran in windows

@ghost
Copy link
Author

ghost commented Aug 9, 2017

@vliqi
I am not sure if it will work on Windows. You can use cmake -G to generate visual studio project file to compile it.

However, because the -w option in original build system and I turned it off in cmake build system, a lot of warnings are exposed. I do think it is better to resolve it rather than ignore it.

$  grep -i warning make.log
cc1: warning: command line option ‘-Wno-align-commons’ is valid for Fortran but not for C
cc1: warning: command line option ‘-fdefault-real-8’ is valid for Fortran but not for C
cc1: warning: command line option ‘-fbacktrace’ is valid for Fortran but not for C
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (32 vs 16 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (224 vs 392 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (224 vs 392 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (224 vs 392 bytes)
Warning: Named COMMON block ‘turbconv’ at (1) shall be of the same size as elsewhere (128 vs 64 bytes)
Warning: Named COMMON block ‘turbconv’ at (1) shall be of the same size as elsewhere (56 vs 128 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (224 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (192 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘info’ at (1) shall be of the same size as elsewhere (224 vs 392 bytes)
Warning: Named COMMON block ‘reyue’ at (1) shall be of the same size as elsewhere (16 vs 32 bytes)
Warning: Named COMMON block ‘deformz’ at (1) shall be of the same size as elsewhere (48 vs 56 bytes)
Warning: Named COMMON block ‘deformz’ at (1) shall be of the same size as elsewhere (48 vs 56 bytes)
Warning: Named COMMON block ‘deformz’ at (1) shall be of the same size as elsewhere (88 vs 56 bytes)
Warning: Named COMMON block ‘unst’ at (1) shall be of the same size as elsewhere (80 vs 48 bytes)
Warning: Legacy Extension: Label at (1) is not in the same block as the GOTO statement at (2)
Warning: Legacy Extension: Label at (1) is not in the same block as the GOTO statement at (2)
Warning: Legacy Extension: Label at (1) is not in the same block as the GOTO statement at (2)
Warning: Type mismatch in argument ‘x’ at (1); passed COMPLEX(8) to REAL(8)
Warning: Type mismatch in argument ‘x’ at (1); passed COMPLEX(8) to REAL(8)
Warning: Type mismatch in argument ‘x’ at (1); passed COMPLEX(8) to REAL(8)
Warning: Type mismatch in argument ‘x’ at (1); passed COMPLEX(8) to REAL(8)
Warning: Legacy Extension: Label at (1) is not in the same block as the GOTO statement at (2)
Warning: Legacy Extension: Label at (1) is not in the same block as the GOTO statement at (2)
Warning: Legacy Extension: Label at (1) is not in the same block as the GOTO statement at (2)

There are four types of them:

  • Named COMMON block size mismatch
  • Legacy Extension of GOTO statement
  • passed COMPLEX(8) to REAL(8)
  • command line option problem for a c source file in libcommon.

I think refractoring of the old fortran code is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant