[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bgl-discuss] include file



Hi,

  Thanks for your suggestions. After include "mpi.h" first, and then "stdio.h", the errors for MPI gone. The new include file is like:

#include        "mpi.h"
#undef          SEEK_SET
#undef          SEEK_CUR
#undef          SEEK_END
#include        <stdio.h>
#include        <string.h>
//#include        <iostream.h>
//#include        <iomanip.h>
//#include        <fstream.h>
#include        <math.h>
#include        "polylib.h"
#include        "veclib.h"
#include        "fftw.h"
#include        "rfftw.h"
......

  They still have conflicts with <iostream.h>, but as they are not used very much in my code, so just comment out.

  Now compilation is fine with:

/bgl/BlueLight/ppcfloor/bglsys/bin/mpicxx -I./include -I/bgl/BlueLight/ppcfloor/bglsys/include -g -c -o ./append.o src/append.C
/bgl/BlueLight/ppcfloor/bglsys/bin/mpicxx -I./include -I/bgl/BlueLight/ppcfloor/bglsys/include -g -c -o ./polylib.o src/polylib.C
/bgl/BlueLight/ppcfloor/bglsys/bin/mpicxx -I./include -I/bgl/BlueLight/ppcfloor/bglsys/include -g -c -o ./turbulence180e.o src/turbulence180e.C

  But when I try to link it, it seems all other include files do not works! It can not find variables in veclib.h, fftw.h, ...

/bgl/BlueLight/ppcfloor/bglsys/bin/mpicxx -I/bgl/home1/jinxu/work/Hybrid/include -I/bgl/BlueLight/ppcfloor/bglsys/include -L/bgl/home1/jinxu/work/Hybrid/Hlib/Linux -lblas_LINUX -llapack_LINUX -lvec -lfftw -lrfftw -g -o ./turbulence180e ./turbulence180e.o ./append.o ./polylib.o -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts

  ./turbulence180e.o: In function `channel::channel[in-charge]()':
/home/jinxu/work/Hybrid/src/turbulence180e.C:192: undefined reference to `dmatrix'
/home/jinxu/work/Hybrid/src/turbulence180e.C:193: undefined reference to `dmatrix'
/home/jinxu/work/Hybrid/src/turbulence180e.C:194: undefined reference to `dmatrix'
/home/jinxu/work/Hybrid/src/turbulence180e.C:195: undefined reference to `dmatrix'
/home/jinxu/work/Hybrid/src/turbulence180e.C:196: undefined reference to `dmatrix'
./turbulence180e.o:/home/jinxu/work/Hybrid/src/turbulence180e.C:197: more undefined references to `dmatrix' follow
./turbulence180e.o: In function `channel::Solvechannel()':
/home/jinxu/work/Hybrid/src/turbulence180e.C:155: undefined reference to `fftw_create_plan'
/home/jinxu/work/Hybrid/src/turbulence180e.C:156: undefined reference to `fftw_create_plan'
/home/jinxu/work/Hybrid/src/turbulence180e.C:157: undefined reference to `fftw_create_plan'
/home/jinxu/work/Hybrid/src/turbulence180e.C:157: undefined reference to `fftw_create_plan'
/home/jinxu/work/Hybrid/src/turbulence180e.C:158: undefined reference to `fftw_create_plan'
........

   There is no MPI error at this moment, but something still looks strange. As /bgl/home1/jinxu/work/Hybrid/Hlib/Linux/libvec.a has definition of dmatrix function, and declaration is in /bgl/home1/jinxu/work/Hybrid/include/veclib.h

work/Hybrid> grep dmatrix include/*.h
include/dbutils.h:void  plotdmatrix  (double **, int , int , int , int );
include/dbutils.h:void  showdmatrix  (double **, int , int , int , int);
include/veclib.bckup.h:double  **dmatrix     (int rmin, int rmax, int cmin, int cmax);
include/veclib.bckup.h:void     free_dmatrix (double **mat, int rmin, int cmin);
include/veclib.h:double  **dmatrix     (int rmin, int rmax, int cmin, int cmax);
include/veclib.h:void     free_dmatrix (double **mat, int rmin, int cmin);

work/Hybrid> nm Hlib/Linux/libvec.a | grep dmatrix
00000000 T dmatrix
000004b0 T free_dmatrix

   Any more suggestion on it would be appreciated. Thanks.

Jin
 
  
 


At 03:48 PM 9/7/2005, Xu, Jin wrote:

>Hi,
>
>   I am trying to compile my C++ code on BlueGene, but have some problems 
> with include files.

This is a bug in the MPI-2 specification, which the mpi.h header file 
(specifically, the mpicxx.h file included by mpi.h) is warning you 
about.  To work around this, try including mpi.h before stdio.h (and 
xxxstream.h).  Alternately, if you aren't using SEEK_SET etc, #undef them 
before including mpi.h .

Bill


>   The command I use is following:
>
>work/Hybrid> /bgl/BlueLight/ppcfloor/bglsys/bin/mpicxx -I./include 
>-I/bgl/BlueLight/ppcfloor/bglsys/include -g -c -o ./turbulence180e.o 
>src/turbulence180e.C
>
>    And it gives following output.
>
>In file included from 
>/bgl/BlueLight/DRV202_2005-050606-SLES8/ppc/blrts-gnu/include/c++/3.2/backward/iostream.h:31,
>                  from src/turbulence180e.h:1,
>                  from src/turbulence180e.C:16:
>/bgl/BlueLight/DRV202_2005-050606-SLES8/ppc/blrts-gnu/include/c++/3.2/backward/backward_warning.h:32:2: 
>warning: #warning This file includes at least one deprecated or antiquated 
>header. Please consider using one of the 32 headers found in section 
>17.4.1.2 of the C++ standard. Examples include substituting the <X> header 
>for the <X.h> header for C++ includes, or <sstream> instead of the 
>deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
>In file included from 
>/bgl/BlueLight/DRV202_2005-050606-SLES8/ppc/bglsys/include/mpi.h:1107,
>                  from src/turbulence180e.h:11,
>                  from src/turbulence180e.C:16:
>/bgl/BlueLight/DRV202_2005-050606-SLES8/ppc/bglsys/include/mpicxx.h:26:2: 
>#error "SEEK_SET is #defined but must not be for the C++ binding of MPI"
>/bgl/BlueLight/DRV202_2005-050606-SLES8/ppc/bglsys/include/mpicxx.h:30:2: 
>#error "SEEK_CUR is #defined but must not be for the C++ binding of MPI"
>/bgl/BlueLight/DRV202_2005-050606-SLES8/ppc/bglsys/include/mpicxx.h:35:2: 
>#error "SEEK_END is #defined but must not be for the C++ binding of MPI"
>
>   The file src/turbulence180e.h contains:
>
>#include        <iostream.h>
>#include        <iomanip.h>
>#include        <fstream.h>
>#include        <stdio.h>
>#include        <string.h>
>#include        <math.h>
>#include        "polylib.h"
>#include        "veclib.h"
>#include        "fftw.h"
>#include        "rfftw.h"
>#include        "mpi.h"
>.......
>
>    There seems some conflicts for iostream.h and mpi.h with others.
>
>    I like to hear any suggestions.
>
>Thanks,
>Jin
>
>
>- --------------------------------------------------------------------
>To add or remove yourself from this mailing list, use the 'notifyme'
>command on any BGL machine. To remove: notifyme -n, to add: notifyme -y.

William Gropp
http://www.mcs.anl.gov/~gropp 


- --------------------------------------------------------------------
To add or remove yourself from this mailing list, use the 'notifyme'
command on any BGL machine. To remove: notifyme -n, to add: notifyme -y.