CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Compiling CFL3D (https://www.cfd-online.com/Forums/main/204540-compiling-cfl3d.html)

taalf July 26, 2018 04:03

Compiling CFL3D
 
Hi all,

It seems the CFL3D code was recently set public again after a long period.

The fact is that the official way ton compile it seems a bit outdated. Even the doc says:

"The Install script is very old, and may or may not create a workable makefile for your particular machine." (here)

While I followed instructions, I get the following error:

Code:

$ ./Install    # This seems to work
$ make cfl3d_mpi
(...)
make[1]: Entering directory `/home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs'
mpif90 -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w -ip -fno-alias -xHost -traceback -module /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs  -r8  -c add2x.F
gfortran: error: unrecognized command line option ‘-ip’
gfortran: error: unrecognized command line option ‘-fno-alias’
gfortran: error: unrecognized command line option ‘-traceback’
gfortran: error: unrecognized command line option ‘-module’
gfortran: error: unrecognized command line option ‘-r8’
make[1]: *** [add2x.o] Error 1
make[1]: Leaving directory `/home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs'
make: *** [Zlibs] Error 2

Is there someone having successfully compiled the last version of CFL3D on Linux ? I have Linux Mint.

Best regards,

taalf July 26, 2018 05:06

Well, I removed all occurences of the "unrecognizes command line options" in the Install script, and it started compile.

Now I have another error:
Code:

==============================================================
                    compiling cfl3d_mpi               
==============================================================
                                                             
( cd cfl/mpi; make -f makefile cfl3d_mpi \
        FFLAG="-O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs  " \
        FFLAG_SPEC="-O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs  " \
        LFLAG="-z muldefs -fpe0" \
        EXEC="cfl3d_mpi" \
        CPPFLAG="-P" \
        CPPOPT=" -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN " \
        AROPT="rusc" \
        RANLIB="true" \
        CPP="cpp" \
        LLIBS="" \
        FTN="mpif90" \
        DIR="cfl/mpi" \
        CFLSRC_D="../../../source/cfl3d/dist" \
        CFLSRC_S="../../../source/cfl3d/libs" \
        HEADER="../../../header" )
make[1]: Entering directory `/home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/mpi'
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c ccomplex.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c development.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c main.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c bc_blkint.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c findmin_new.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c plot3d.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c rrest.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c bc_patch.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c forceout.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c plot3t.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c rrestg.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c calyplus.F
gfortran: warning: /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs: linker input file unused because linking not done
mpif90 -DDIST_MPI -DDBLE_PRECSN -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN  -O2 -w /home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/libs    -c pointers.F
pointers.F:35.9:

      use module_kwstm, only:kws_get_nummem                           
        1
Fatal Error: Can't open module file 'module_kwstm.mod' for reading at (1): No such file or directory
make[1]: *** [pointers.o] Error 1
make[1]: Leaving directory `/home/tougeron/documents/installation/cfd/cfl3d/CFL3D/build/cfl/mpi'
make: *** [Zmpi] Error 2


taalf July 26, 2018 05:33

OK, I copy-pasted the following files from build/cfl/libs/ to build/cfl/mpi/ and it continues compiling:

module_kwstm.mod
module_profileout.mod
module_contour.mod

Let's see if it will be OK now.

hjabird July 26, 2018 05:45

I faced similar issues a while ago. Whilst I don't remember the specifics the notes I wrote for my future self are as follows:

Everything is easier with MPICH - just go sudo apt install MPICH
./Install
mv ~/CFL3D/build/makefile ~/CFL3D/build/makefile.bu
cp ~/CFL3D/build/makefile_mac_gnu ~/CFL3D/build/makefile
now modify the makefile from gfortran to mpif90
I found I ended up having to run install more than once last time?
For MPI you still need the cfl3d.inp

It took me a while to work out how to open the files in Paraview. To do this open the the .g file in as a Plot3D. There is then an option to open the .q file in the properties section for the Paraview source.

Good luck.

taalf July 26, 2018 05:57

OK, so it seems the compilation completed well.

Here, a sum up of what I did (CFL3D v6 on Linux Mint 17.3 64bit):

EDIT: the method given in previous/following comments seems to be better than this one.

1- Download the CFL3D code:
Code:

git clone https://github.com/nasa/CFL3D
2- Go to the build/ dir:
Code:

cd CFL3D/build/
3- Edit the 'Install' script file and, under "# Default to INTEL settings", remove all occurences of following options:
‘-ip’
‘-fno-alias’
‘-traceback’
‘-module’
‘-r8’
'-xHost'
'-fpe0'

4- Launch the 'Install' script:
Code:

./Install
5- Make CFL3D libraries only:
Code:

make cfd3d_libs
6- Copy .mod files from one dir to another:
Code:

cp cfl/libs/*.mod cfl/seq/
cp cfl/libs/*.mod cfl/mpi/

7- Compile sequential and parallel versions of CFL3D:
Code:

make cfl3d_seq
make cfl3d_mpi

Can't say, however, how well will run this compiled code...

taalf July 26, 2018 06:09

Quote:

Originally Posted by hjabird (Post 700558)
I faced similar issues a while ago. Whilst I don't remember the specifics the notes I wrote for my future self are as follows:

Everything is easier with MPICH - just go sudo apt install MPICH
./Install
mv ~/CFL3D/build/makefile ~/CFL3D/build/makefile.bu
cp ~/CFL3D/build/makefile_mac_gnu ~/CFL3D/build/makefile
now modify the makefile from gfortran to mpif90
I found I ended up having to run install more than once last time?
For MPI you still need the cfl3d.inp

It took me a while to work out how to open the files in Paraview. To do this open the the .g file in as a Plot3D. There is then an option to open the .q file in the properties section for the Paraview source.

Good luck.

Hi hjabird,

Your method worked as well and seems to be cleaner than mine (especially because I removed lots of options that can be subsituted by other ones with your method).

Just to say, the only makefile template I found was "makefile_mac_gfortran_example".

Thank you very much for advices and experience sharing.

All the best,

velujrf December 22, 2020 01:11

I got stuck while proceeding the installation of CFL3D in Linux V16. Kindly help me
 
We have these files but file format is .F90 only. How can I convert this .F90 to .mod ?

I am unable to copy-paste the following files from build/cfl/libs/ to build/cfl/mpi/

module_kwstm.mod
module_profileout.mod
module_contour.mod

velujrf December 22, 2020 01:37

we have completed the below steps while installing CFL3D in linux :
./Install
mv ~/CFL3D/build/makefile ~/CFL3D/build/makefile.bu
cp ~/CFL3D/build/makefile_mac_gnu ~/CFL3D/build/makefile

I renamed the below files which actually was in .f90 format, I have changed to .mod manually, then I copy-pasted the following files from build/cfl/libs/ to build/cfl/mpi/

module_kwstm.mod
module_profileout.mod
module_contour.mod

cp ~/Desktop/CFL3D/build/cfl/libs/*.mod ~/Desktop/CFL3D/build/cfl/seq/
cp ~/Desktop/CFL3D/build/cfl/libs/*.mod ~/Desktop/CFL3D/build/cfl/mpi/

We got stuck while executing the below commands
make cfl3d_seq
make cfl3d_mpi

Getting the below error :

================================================== ============
compiling cfl3d_libs
================================================== ============

( cd cfl/libs; make -f makefile cfl3d_libs \
FFLAG="-O2 -w -module /home/midhun/Desktop/CFL3D/build/cfl/libs " \
FFLAG_SPEC="-O2 -w -module /home/midhun/Desktop/CFL3D/build/cfl/libs " \
LFLAG="-z muldefs" \
EXEC="cfl3d_libs" \
CPPFLAG="-P" \
CPPOPT="-DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN " \
AROPT="rusc" \
RANLIB="true" \
CPP="cpp" \
CFLAG="" \
LLIBS="" \
FTN="mpif90" \
DIR="cfl/libs" \
CFLSRC_S="../../../source/cfl3d/libs" \
CFLSRC_D="../../../source/cfl3d/dist" \
HEADER="../../../header" )
make[1]: Entering directory '/home/midhun/Desktop/CFL3D/build/cfl/libs'
mpif90 -DP3D_SINGLE -DLINUX -DINTEL -DDBLE_PRECSN -O2 -w -module /home/midhun/Desktop/CFL3D/build/cfl/libs -c add2x.F
make[1]: mpif90: Command not found
makefile:129: recipe for target 'add2x.o' failed
make[1]: *** [add2x.o] Error 127
make[1]: Leaving directory '/home/midhun/Desktop/CFL3D/build/cfl/libs'
makefile:370: recipe for target 'Zlibs' failed
make: *** [Zlibs] Error 2

shereez234 October 29, 2022 06:44

A makefile that works on Ubuntu linux
 
Code:

#   
#    $Id$
#
#=============================================================================
#
#  This is the primary/top-level makefile: builds either the parallel or
#  sequential versions of CFL3D, as well as the preprocessors PRECFL3D,
#  RONNIE, and MAGGIE and SPLITTER. Only sequential versions of
#  of MAGGIE AND RONNIE are currently available
#
#
#                          cfl3dv6.0 directory structure:
#
#                                    CFL3DV6.0 
#                                        |
#                              -------------------
#                              |        |        |
#                            SOURCE  BUILD  HEADER
#                              |
#        --------------------------------------------
#        |      |        |      |        |      |
#      CFL3D  PRECFL3D  RONNIE  MAGGIE  SPLITTER  TOOLS (source code archives)
#        |
#    -------
#    |    |
#    DIST  LIBS
#
#
#                        build directory structure:
#
#                                  BUILD (you are here)
#                                    |
#        ----------------------------------------------------------------
#        |            |        |      |      |    |    |      |      |
#      CFL        CFLCMPLX  PRECFL  PRERON  RON  MAG  TOOLS  SPLIT SPLITCMPLX
#        |            |        |      |      |    |    |      |      |
#    ---------    ----------    |      |      |    |    |      |      |
#    |  |  |    |    |  |    |      |      |    |    |      |      |
#  LIBS SEQ MPI  LIBS SEQ MPI  SEQ    SEQ    SEQ  SEQ  SEQ    SEQ    SEQ
#
#          (bottom level of build is the "construction" level)
#
#=============================================================================


# *************** COMPILER FLAG DEFINITIONS (MACHINE SPECIFIC) ***************
#                (CURRENT DEFINITIONS FOR LINUX ARCHITECTURE)

FFLAG        = -O2 -w -I$(MPILIB_INCDIR) -I$(MPI_INCDIR) -fallow-argument-mismatch /media/mohamedsereez/bigDisk/Software/CFL3D-master/build/$(CFLLIBSD)
FFLAG_SPEC  = -O2 -w -I$(MPILIB_INCDIR) -I$(MPI_INCDIR) -fallow-argument-mismatch /media/mohamedsereez/bigDisk/Software/CFL3D-master/build/$(CFLLIBSD)
PREC        =
PREC_MPI    = -DDBLE_PRECSN
LFLAG        = -z muldefs
LLIBS        = -lmpich 
LLIBS_SEQ    = 
MPI_INCDIR  = -I/usr/lib/x86_64-linux-gnu/mpich/include
MPILIB_INCDIR =/usr/lib/x86_64-linux-gnu
CGNS_INCDIR  =
CPP          = cpp
CPPFLAG      = -P
CPPOPT      =  $(MPI_INCDIR) -DDIST_MPI $(PREC_MPI)
CPPOPT_SP    = -DP3D_SINGLE -DLINUX -DINTEL -DNOREDIRECT $(PREC_MPI) $(CGNS_INCDIR)
CPPOPT_CMPLX = -DCMPLX
FTN          = mpif90
CFLAG        =
AROPT        = rusc
RANLIB      = true
INLINE      =

# ********************** EXECUTABLE NAME DEFINITIONS *************************

EXEC_CFLSEQ        = cfl3d_seq
EXEC_CFLMPI        = cfl3d_mpi
EXEC_CFLLIBS        = cfl3d_libs
EXEC_PRESEQ        = precfl3d
EXEC_RONSEQ        = ronnie
EXEC_PRERONSEQ      = preronnie
EXEC_MAGSEQ        = maggie
EXEC_SPLIT          = splitter
EXEC_TOOLS          = cfl3d_tools

EXEC_CFLCMPLXSEQ    = cfl3dcmplx_seq
EXEC_CFLCMPLXMPI    = cfl3dcmplx_mpi
EXEC_CFLCMPLXLIBS  = cfl3dcmplx_libs
EXEC_SPLITCMPLX    = splittercmplx

# ********************** DIRECTORY NAME DEFINITIONS *************************

#            ALL DIRECTORY PATHS RELATIVE TO THIS DIRECTORY (BUILD)

# "CONSTRUCTION" DIRECTORIES (first-level directory names on right of the
# equal signs below must be different than the executable names above,
# or else make will think the executable is always up to date; e.g. if
# EXEC_RONSEQ  = ronnie then RONSEQD = ronnie/seq is not acceptable)

CFLMPID        = cfl/mpi
CFLLIBSD        = cfl/libs
CFLSEQD        = cfl/seq
PRESEQD        = precfl/seq
RONSEQD        = ron/seq
PRERONSEQD      = preron/seq
MAGSEQD        = mag/seq
SPLITD          = split/seq
TOOLSD          = tools/seq

CFLCMPLXMPID    = cflcmplx/mpi
CFLCMPLXLIBSD  = cflcmplx/libs
CFLCMPLXSEQD    = cflcmplx/seq
SPLITCMPLXD    = splitcmplx/seq

# SOURCE-CODE DIRECTORIES - code changes must be made in these directories

CFLSRC_D  = ../source/cfl3d/dist
CFLSRC_S  = ../source/cfl3d/libs
PRESRC    = ../source/precfl3d
RONSRC    = ../source/ronnie
PRERONSRC = ../source/ronnie
MAGSRC    = ../source/maggie
SPLITSRC  = ../source/splitter
TOOLSSRC  = ../source/tools

# HEADER-FILE DIRECTORY

HEADER    = ../header

# MAKEFILE OPTION - to process "if defs", use can either cpp built into the
#                  fortran compiler or an explict call to an external cpp
#
# MAKEFILE  = makefile    ... use fortran cpp
#          = makefile_cpp ... use external cpp (may need to alter path
#                              in the "CPP = " statement under "COMPILER
#                              FLAG DEFINITIONS" above

MAKEFILE  = makefile

Top part of the makeFile (copy paste up to the line shown) - And also you will need to adjust include directories to relevant in your PC


All times are GMT -4. The time now is 16:11.