su2code / SU2

SU2: An Open-Source Suite for Multiphysics Simulation and Design
https://su2code.github.io
Other
1.33k stars 843 forks source link

Error compiling AD version #587

Closed hongyanbu closed 6 years ago

hongyanbu commented 6 years ago

Following is the error infomation:

Making all in Common/lib
make[2]: Entering directory `/home/bu/SU2/SU2_AD/Common/lib'
  CXX      ../src/libSU2_AD_a-config_structure.o
In file included from ../../../externals/medi/include/medi/ampi/ampi.hpp:41:0,
                 from ../../../externals/medi/include/medi/medi.hpp:33,
                 from ../../../Common/lib/../src/../include/./mpi_structure.hpp:55,
                 from ../../../Common/lib/../src/../include/config_structure.hpp:41,
                 from ../../../Common/lib/../src/config_structure.cpp:38:
../../../externals/medi/include/medi/ampi/../../../generated/medi/ampiFunctions.hpp: In function ‘int medi::AMPI_T_cvar_write(MPI_T_cvar_handle, const void*)’:
../../../externals/medi/include/medi/ampi/../../../generated/medi/ampiFunctions.hpp:9635:40: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
     return MPI_T_cvar_write(handle, buf);
                                        ^
In file included from ../../../Common/lib/../src/../include/./mpi_structure.hpp:42:0,
                 from ../../../Common/lib/../src/../include/config_structure.hpp:41,
                 from ../../../Common/lib/../src/config_structure.cpp:38:
/usr/include/mpich-x86_64/mpi.h:1447:5: error:   initializing argument 2 of ‘int MPI_T_cvar_write(MPI_T_cvar_handle, void*)’ [-fpermissive]
 int MPI_T_cvar_write(MPI_T_cvar_handle handle, void *buf);
     ^
In file included from ../../../externals/medi/include/medi/ampi/ampi.hpp:41:0,
                 from ../../../externals/medi/include/medi/medi.hpp:33,
                 from ../../../Common/lib/../src/../include/./mpi_structure.hpp:55,
                 from ../../../Common/lib/../src/../include/config_structure.hpp:41,
                 from ../../../Common/lib/../src/config_structure.cpp:38:
../../../externals/medi/include/medi/ampi/../../../generated/medi/ampiFunctions.hpp: In function ‘int medi::AMPI_T_pvar_write(MPI_T_pvar_session, MPI_T_pvar_handle, const void*)’:
../../../externals/medi/include/medi/ampi/../../../generated/medi/ampiFunctions.hpp:9732:49: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
     return MPI_T_pvar_write(session, handle, buf);
                                                 ^
In file included from ../../../Common/lib/../src/../include/./mpi_structure.hpp:42:0,
                 from ../../../Common/lib/../src/../include/config_structure.hpp:41,
                 from ../../../Common/lib/../src/config_structure.cpp:38:
/usr/include/mpich-x86_64/mpi.h:1460:5: error:   initializing argument 3 of ‘int MPI_T_pvar_write(MPI_T_pvar_session, MPI_T_pvar_handle, void*)’ [-fpermissive]
 int MPI_T_pvar_write(MPI_T_pvar_session session, MPI_T_pvar_handle handle, void *buf);
     ^
make[2]: *** [../src/libSU2_AD_a-config_structure.o] Error 1
make[2]: Leaving directory `/home/bu/SU2/SU2_AD/Common/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bu/SU2/SU2_AD'
make: *** [SU2_AD] Error 2

Following is the config log:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/lib64/mpich/bin/mpicxx accepts -g... yes
checking dependency style of /usr/lib64/mpich/bin/mpicxx... gcc3
checking whether we are using the GNU C compiler... yes
checking whether /usr/lib64/mpich/bin/mpicc accepts -g... yes
checking for /usr/lib64/mpich/bin/mpicc option to accept ISO C89... none needed
checking dependency style of /usr/lib64/mpich/bin/mpicc... gcc3
checking whether /usr/lib64/mpich/bin/mpicc and cc understand -c and -o together... yes
checking for ranlib... ranlib
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether /usr/lib64/mpich/bin/mpicxx accepts -g... (cached) yes
checking dependency style of /usr/lib64/mpich/bin/mpicxx... (cached) gcc3
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages
checking for python2.7-config... /usr/bin/python2.7-config
checking python include flags... -I/usr/include/python2.7 -I/usr/include/python2.7
checking how to run the C preprocessor... /usr/lib64/mpich/bin/mpicc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of short int... 2
checking size of int... 4
checking size of unsigned int... 4
checking size of long int... 8
checking size of float... 4
checking size of double... 8
checking size of void *... 8
checking X11/Intrinsic.h usability... no
checking X11/Intrinsic.h presence... no
checking for X11/Intrinsic.h... no
<<< Configuring library with Metis support >>>
<<< Configuring library with Parmetis support >>>
<<< Configuring library with CGNS support >>>
checking for ../externals/codi/include/codi.hpp... yes
checking for ../externals/medi/include/medi/medi.hpp... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating externals/tecio/Makefile
config.status: creating externals/metis/Makefile
config.status: creating externals/parmetis/Makefile
config.status: creating externals/cgns/Makefile
config.status: creating Makefile
config.status: creating externals/Makefile
config.status: creating Common/lib/Makefile
config.status: creating SU2_CFD/obj/Makefile
config.status: creating SU2_DOT/obj/Makefile
config.status: creating SU2_MSH/obj/Makefile
config.status: creating SU2_DEF/obj/Makefile
config.status: creating SU2_SOL/obj/Makefile
config.status: creating SU2_GEO/obj/Makefile
config.status: creating SU2_PY/Makefile
config.status: creating SU2_PY/pySU2/Makefile
config.status: executing depfiles commands

-------------------------------------------------------------------------
|    ___ _   _ ___                                                      |
|   / __| | | |_  )   Release 6.1.0 'Falcon'                            |
|   \__ \ |_| |/ /                                                      |
|   |___/\___//___|   Suite                                             |
|                                                                       |
-------------------------------------------------------------------------
| The current SU2 release has been coordinated by the                   |
| SU2 International Developers Society <www.su2devsociety.org>          |
| with selected contributions from the open-source community.           |
-------------------------------------------------------------------------
| The main research teams contributing to the current release are:      |
| - Prof. Juan J. Alonso's group at Stanford University.                |
| - Prof. Piero Colonna's group at Delft University of Technology.      |
| - Prof. Nicolas R. Gauger's group at Kaiserslautern U. of Technology. |
| - Prof. Alberto Guardone's group at Polytechnic University of Milan.  |
| - Prof. Rafael Palacios' group at Imperial College London.            |
| - Prof. Vincent Terrapon's group at the University of Liege.          |
| - Prof. Edwin van der Weide's group at the University of Twente.      |
| - Lab. of New Concepts in Aeronautics at Tech. Inst. of Aeronautics.  |
-------------------------------------------------------------------------
| Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon,       |
|                      Tim Albring, and the SU2 contributors.           |
|                                                                       |
| SU2 is free software; you can redistribute it and/or                  |
| modify it under the terms of the GNU Lesser General Public            |
| License as published by the Free Software Foundation; either          |
| version 2.1 of the License, or (at your option) any later version.    |
|                                                                       |
| SU2 is distributed in the hope that it will be useful,                |
| but WITHOUT ANY WARRANTY; without even the implied warranty of        |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
| Lesser General Public License for more details.                       |
|                                                                       |
| You should have received a copy of the GNU Lesser General Public      |
| License along with SU2. If not, see <http://www.gnu.org/licenses/>.   |
-------------------------------------------------------------------------

Build Configuration Summary:

    Source code location: /home/bu/SU2
    Install location:     /home/bu/SU2
    Version:              6.1.0
    C++ Compiler:         /usr/lib64/mpich/bin/mpicxx
    C Compiler:           /usr/lib64/mpich/bin/mpicc
    Preprocessor flags:   -DHAVE_MPI 
    Compiler flags:       -O3 -Wall
    Linker flags:         
    MPI support:          yes
    Metis support:        yes
    Parmetis support:     yes
    TecIO support:        no
    CGNS support:         yes
    HDF5 support:         no
    SZIP support:         no
    ZLIB support:         no
    Mutation++ support:   no
    Jsoncpp support:      no
    LAPACK support:       no
    Datatype support:
        double              no
        complex             no
        codi_reverse        yes
        codi_forward        no

    External includes:    -DHAVE_CGNS -I$(top_srcdir)/externals/cgns -I$(top_srcdir)/externals/cgns/adf -DHAVE_PARMETIS -I$(top_srcdir)/externals/parmetis/include -DHAVE_METIS -I$(top_srcdir)/externals/metis/include 
    External libs:        $(top_builddir)/externals/cgns/libcgns.a $(top_builddir)/externals/parmetis/libparmetis.a $(top_builddir)/externals/metis/libmetis.a 

    Build SU2_CFD:        yes
    Build SU2_DOT:        yes
    Build SU2_MSH:        no
    Build SU2_DEF:        no
    Build SU2_SOL:        no
    Build SU2_GEO:        no
    Build Py Wrapper:     no

Please be sure to add the $SU2_HOME and $SU2_RUN environment variables,
and update your $PATH (and $PYTHONPATH if applicable) with $SU2_RUN.

Based on the input to this configuration, add these lines to your .bashrc file:

export SU2_RUN="/home/bu/SU2/bin"
export SU2_HOME="/home/bu/SU2"
export PATH=$PATH:$SU2_RUN
export PYTHONPATH=$PYTHONPATH:$SU2_RUN
pcarruscag commented 6 years ago

Hi, What version of mpich are you using? Pedro

hongyanbu commented 6 years ago

Hi, What version of mpich are you using? Pedro

Hi, Pedro @pcarruscag I'm using mpich-3.0 & mpich-3.0-devel, installed with yum on CentOS 7. Hongyan

pcarruscag commented 6 years ago

From the looks of things in that version some function signatures are not compatible with MeDi, I downloaded the source for 3.0 to be sure, version 3.3b3 on the other hand seems to be compatible. If you have the option to update give it a go, if not try compiling with -fpermissive (CXXFLAGS="-O3 -Wall -fpermissive" I think).

vdweide commented 6 years ago

I strongly advice you not to use -fpermissive. That is a fix for bad programming.

pcarruscag commented 6 years ago

@vdweide agreed, but for the sake of not giving SU2 a bad rep, the MPI standard specifies those variables to be const (https://www.mpi-forum.org/docs/mpi-3.0/mpi30-report.pdf page 572 or 602 of the pdf) so this is a (small-ish) mpich 3.0 implementation issue.

hongyanbu commented 6 years ago

From the looks of things in that version some function signatures are not compatible with MeDi, I downloaded the source for 3.0 to be sure, version 3.3b3 on the other hand seems to be compatible. If you have the option to update give it a go, if not try compiling with -fpermissive (CXXFLAGS="-O3 -Wall -fpermissive" I think).

Switched to mpich-3.3b3, compiled successfully. Thanks a lot! @pcarruscag @vdweide