gcc:未知类型名称

时间:2017-07-27 23:22:21

标签: gcc compiler-errors gcc-warning cc

我正在尝试在ubuntu16.04 LTS机器上安装名为PDSLin的线性求解器。我安装了所有依赖项,但是当运行make for PDSLin时,我收到了这些警告和错误。我不明白gcc -c中的-c来自何处以及是否是不识别“superlu_options_t”变量的原因。

(cd src; make lib;)
make[1]: Entering directory '/home/afrah/pdslin/src'
(make all; cd slu; make lib)
make[2]: Entering directory '/home/afrah/pdslin/src'
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include   -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC   pdslin_graph.c
pdslin_graph.c: In function ‘a_plus_at_CompRow_loc_with_diag’:
pdslin_graph.c:51:26: warning: variable ‘sz_tcolind_loc’ set but not used [-Wunused-but-set-variable]
   int_t sz_tcolind_send, sz_tcolind_loc, sz_tcolind_recv;
                          ^
pdslin_graph.c: In function ‘perm_snodes’:
pdslin_graph.c:898:22: warning: passing argument 1 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
   ParMETIS_V3_NodeND(disp, m_rowptr, m_colind, &numflag, options,
                      ^
// similar warnings
pdslin_graph.c:1034:9: warning: variable ‘numflag’ set but not used [-Wunused-but-set-variable]
   int   numflag;
         ^
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include   -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC   pdslin_wrapper.c
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include   -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC   pdslin_perm.c
pdslin_perm.c: In function ‘comp_perm’:
pdslin_perm.c:113:24: warning: passing argument 1 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
     ParMETIS_V3_NodeND(disp, rowptr_l, colind_l, &numflag, options,
                        ^
In file included from pdslin_perm.c:14:0:
/home/afrah/SuperLU_DIST_5.1.2/SRC/parmetis.h:102:13: note: expected ‘idx_t * {aka long int *}’ but argument is of type ‘int *’
 int __cdecl ParMETIS_V3_NodeND(
             ^
pdslin_perm.c:113:30: warning: passing argument 2 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
     ParMETIS_V3_NodeND(disp, rowptr_l, colind_l, &numflag, options,
                              ^
In file included from pdslin_perm.c:14:0:
/home/afrah/SuperLU_DIST_5.1.2/SRC/parmetis.h:102:13: note: expected ‘idx_t * {aka long int *}’ but argument is of type ‘int *’
 int __cdecl ParMETIS_V3_NodeND(
             ^
pdslin_perm.c:113:40: warning: passing argument 3 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
     ParMETIS_V3_NodeND(disp, rowptr_l, colind_l, &numflag, options,
                                        ^

// warnings

gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include   -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC   pdslin_util.c
In file included from pdslin_util.c:11:0:
/home/afrah/pdslin/include/pdslin_slu.h:49:24: error: unknown type name ‘superlu_options_t’
 void get_perm_c_dist_t(superlu_options_t *options, int_t pnum, int_t ispec, S
                        ^
/home/afrah/pdslin/include/pdslin_slu.h:70:24: error: unknown type name ‘superlu_options_t’
 int_t pdslin_symbfact( superlu_options_t *options, /* input options */
                        ^
pdslin_util.c: In function ‘a_plus_at’:
pdslin_util.c:116:9: warning: variable ‘nnz_loc’ set but not used [-Wunused-but-set-variable]
   int_t nnz_loc;    /* number of local nonzeros in matrix A */
         ^
pdslin_util.c:107:26: warning: variable ‘sz_tcolind_loc’ set but not used [-Wunused-but-set-variable]
   int_t sz_tcolind_send, sz_tcolind_loc, sz_tcolind_recv;
                          ^
pdslin_util.c: In function ‘pdslin_print_stat’:
pdslin_util.c:1047:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘long long int’ [-Wformat=]
     printf( "   domain dim             : (%.2lf, %.2lf ) %ld / %ld, %ld\n",
             ^
pdslin_util.c:1047:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘long long int’ [-Wformat=]
pdslin_util.c:1047:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘long long int’ [-Wformat=]
pdslin_util.c:1049:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘long long int’ [-Wformat=]
     printf( "   domain nnz             : (%.2lf, %.2lf ) %ld / %ld, %ld\n",
             ^

// warnings

makefile:103: recipe for target 'pdslin_util.o' failed
make[2]: *** [pdslin_util.o] Error 1
make[2]: Leaving directory '/home/afrah/pdslin/src'
make[2]: Entering directory '/home/afrah/pdslin/src/slu'
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include   -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC   get_perm_c.c
get_perm_c.c:49:11: error: unknown type name ‘superlu_options_t’
           superlu_options_t *options,
           ^
get_perm_c.c:167:19: error: unknown type name ‘superlu_options_t’
 get_perm_c_dist_t(superlu_options_t *options, int_t pnum, int_t ispec, SuperM
                   ^
makefile:41: recipe for target 'get_perm_c.o' failed
make[2]: *** [get_perm_c.o] Error 1
make[2]: Leaving directory '/home/afrah/pdslin/src/slu'
makefile:46: recipe for target 'lib' failed
make[1]: *** [lib] Error 2
make[1]: Leaving directory '/home/afrah/pdslin/src'
makefile:8: recipe for target 'all' failed
make: *** [all] Error 2

这是我的makefile:

 #
# top directory make.inc
# 
# on hopper: % module load cray-petsc which also loads cray-tpsl, including pt-schotch and parmetis.

########################################################################
# home directory, where the software is located
TOP  = /home/afrah/pdslin

INCLUDEDIR =/usr/include
########################################################################
# hybrid solver library name
LIB  = $(TOP)/lib/libhybrid.a

########################################################################
# Libraries:
#
# MPI/BLAS libraries
L_MPI =  /usr/share/mpich-install/lib/libmpi.a -llibmpi
I_MPI =  -I/usr/share/mpich-install/include
L_BLAS = -llibblas -lliblapack

########################################################################
# make utility
MAKE = make

########################################################################
# archiver and flags to build the library
ARCH         = /usr/bin/ar
ARCHFLAGS    = -cr
RANLIB       = /usr/bin/ranlib
########################################################################
# C compiler and flags
CC    = gcc
FLAGS =  -Wall -DWITH_HIPS -DWITH_PETSC
FLAGS =  -Wall -DWITH_HIPS -DWITH_PETSC 

########################################################################
# fortran compiler and flags
FC     = mpif90
FLIB   = -pgf90libs
FFLAGS = -fast 
FFLAGS = -g 
########################################################################
# linker used to link example program with the library
#LINKER = /usr/share/mpich-install/bin/mpicc -Wl,--allow-multiple-definition
LINKER = CC -Wl,--allow-multiple-definition 

########################################################################
# C++ compiler (this is not needed for your standard compilation)
CPP = mpicxx

####################################################################

#L_PPART = -L/usr/share/parmetis/lib/libparmetis -lparmetis 

#I_PPART = -I/usr/local/include 


L_PPART =  -L/usr/local/lib  -llibscotch  -llibptscotch \
           -L/usr/local/lib  -lptscotcherr  -llibscotchmetis -lptscotchparmetis 
I_PPART = -DSCOTCH_ORDER -I/usr/local/include

#------------------------------------------------------#
# Metis Library, and its header files
L_METIS = -L/usr/share/parmetis/lib/libmetis -lmetis 
I_METIS =  -I/usr/share/parmetis/include 


#------------------------------------------------------#
# SuperLU_DIST library, and its header files  (hopper: module load superlu_dist)
# SLUDIST = /global/common/hopper2/acts/SuperLU/SuperLU_DIST/2.5
# L_SLUDIST = -L$(SLUDIST)/craypgi-xe6_O/lib -lsuperlu_dist_2.5
# I_SLUDIST = -DDEBUGlevel=0 -DPRNTlevel=1 -DAdd_ -DUSE_VENDOR_BLAS -I$(SLUDIST)/SRC 

SLUDIST = /home/afrah/SuperLU_DIST_5.1.2
I_SLUDIST = -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I$(SLUDIST)/SRC
L_SLUDIST =  -L$(SLUDIST)/lib -llibsuperlu_dist.so


#------------------------------------------------------#
# Petsc library, and its header files
# double version
I_PETSC = -I/home/afrah/petsc/include \
          -I/home/afrah/petsc/arch-linux2-c-debug/include
L_PETSC = -L/home/afrah/petsc/arch-linux2-c-debug/lib -llibpetsc


#------------------------------------------------------#
# Other optional libraries

# serial SuperLU
L_SLU = -L/home/afrah/SuperLU_5.2.0/lib -llibsuperlu_5.2.a
I_SLU = -I/home/afrah/SuperLU_5.2.0/SRC

########################################################################
########################################################################
# accumulate all includes and libraries

INC  = -I$(TOP)/include $(I_SLU) -I$(INCLUDEDIR) $(I_SLUDIST) $(I_PPART) $(I_METIS)  $(I_MPI) $(I_PETSC)
LIBS = $(LIB) $(L_SLU) $(L_SLUDIST) $(L_PPART) $(L_METIS) $(L_BLAS) $(L_MPI) $

(L_PETSC) ZLIBS = $(LIB)$(L_SLUDIST)$(L_PPART)$(L_METIS)$(L_BLAS)$(L_MPI)$(L_SLU)$(L_PETSC)

0 个答案:

没有答案