[MOAB-dev] Fortran interface to MOAB

Tim Tautges tautges at mcs.anl.gov
Wed Oct 30 11:12:10 CDT 2013


This looks to me like either you didn't configure MOAB with a fortran compiler (config option F77=... and FC=...) or you 
didn't enable iMesh on the configure (--enable-imesh).  iMesh is enabled by default, though, so I'm guessing it's the 
fortran.  Can you send the configure line you used, and the output configure.log file?

- tim

On 10/30/2013 09:41 AM, kanaev at ibrae.ac.ru wrote:
>
>> What fortran compiler are you using ? Try mpif77 -show.
>
> On my PC:
> anton at ThinkPadX230:~$ mpif77 -showgfortran -Wl,-Bsymbolic-functions
> -Wl,-z,relro -I/usr/include/mpich2 -L/usr/lib -lmpich -lopa -lmpl -lrt -lcr
> -lpthread
>
> On Mira:
> [akanaev at miralac1 moab-f77]$ mpif77 -show
> bgxlf_r -I/bgsys/drivers/V1R2M0/ppc64
> -I/bgsys/drivers/V1R2M0/ppc64/comm/sys/include
> -I/bgsys/drivers/V1R2M0/ppc64/spi/include
> -I/bgsys/drivers/V1R2M0/ppc64/spi/include/kernel/cnk
> -L/bgsys/drivers/V1R2M0/ppc64/spi/lib
> -L/bgsys/drivers/V1R2M0/ppc64/comm/sys/lib
> -L/bgsys/drivers/V1R2M0/ppc64/spi/lib
> -L/bgsys/drivers/V1R2M0/ppc64/comm/sys/lib
> -L/bgsys/drivers/V1R2M0/ppc64/spi/lib
> -I/bgsys/drivers/V1R2M0/ppc64/comm/xl/include
> -L/bgsys/drivers/V1R2M0/ppc64/comm/xl/lib -lmpich -lopa -lmpl -lpami -lSPI
> -lSPI_cnk -lrt -lpthread -lstdc++ -lpthread -lmpichf90
>
>> I dont know whether this is specifically a BG/Q quirk but it is
>> possible that the pre-processor is screwing up something for the
>> fortran compiler. It compiles/links/runs cleanly on my Macbook with
>> gfortran. Without more output, it would be hard to figure out why this
>> is happening.
>>
>> Can you split that up in to a compilation and link phase separately so
>> that we can take a look at the pre-processed file here.
>>
>> FPP_FLAG="-d" # for BG/Q
>> FPP_FLAG="-save_temps" # for Intel fortran compilers
>> FPP_FLAG="-save-temps" # for GFortran
>>
>> mpif77 -g $(FPP_FLAG) -fcray-pointer -I$(MOAB_DIR)/include
>> -DHAVE_CONFIG_H  -c FindConnectF.F
>> mpif77 -o FindConnectF FindConnectF.o -L$(MPI_DIR)/lib
>> -L$(MOAB_DIR)/lib -liMesh -lMOAB  -lhdf5  -lm  -lmpi_cxx -lstdc++
>>
>> Modify the above correctly for your configuration, compile and send
>> the output again along with the pre-processed files.
>
> I've tried to compile FindConnectF.F with MOAB both on my PC (Ubuntu
> 12.04.3) and on Mira
>
> Here's the makefile i use on PC:
>
> ZLIB_DIR=/home/anton/FATHOM_DIR/zlib/zlib-1.2.8/gcc
> HDF5_DIR=/home/anton/FATHOM_DIR/hdf5/hdf5-1.8.11/gcc
> MOAB_DIR=/home/anton/FATHOM_DIR/moab
>
> F77 = mpif77
> F77LD = $(F77)
> INCLUDES = -I$(MOAB_DIR)/include
>
> DEFS = -DHAVE_CONFIG_H
> FFLAGS = -g -save-temps -fcray-pointer
>
> LDADD = -liMesh -lMOAB ${MOAB_CXX_LIBS}
> LDFLAGS =   -L$(ZLIB_DIR)/lib  -L$(HDF5_DIR)/lib -L$(MOAB_DIR)/lib
> LIBS =  -lm
>
> MOAB_CXX_LIBS =  -lmpichcxx -lmpich -lopa -lmpl -lrt -lcr -lpthread
> -lstdc++
> MOAB_CXX_LINKFLAGS =
>
> FindConnectF: FindConnectF.o
> 	@rm -f FindConnectF
> 	$(F77LD) $(FFLAGS) $(LDFLAGS) $(MOAB_CXX_LINKFLAGS) FindConnectF.o -o
> FindConnectF $(LDADD) $(LIBS)
>
> FindConnectF.o:
> 	$(F77) $(DEFS) $(FFLAGS) $(INCLUDES) -c FindConnectF.F
>
>
> The output is:
>
> anton at ThinkPadX230:~/FATHOM_DIR/moab/moab-4.6.0/examples/itaps$ make -f
> Makefile_FindConnect
> mpif77 -g -save-temps -fcray-pointer
> -L/home/anton/FATHOM_DIR/zlib/zlib-1.2.8/gcc/lib
> -L/home/anton/FATHOM_DIR/hdf5/hdf5-1.8.11/gcc/lib
> -L/home/anton/FATHOM_DIR/moab/lib   FindConnectF.o -o FindConnectF -liMesh
> -lMOAB -lmpichcxx -lmpich -lopa -lmpl -lrt -lcr -lpthread -lstdc++ -lm
> FindConnectF.o: In function `MAIN__':
> FindConnectF.F:(.text+0x2b): undefined reference to `imesh_newmesh_'
> FindConnectF.F:(.text+0x56): undefined reference to `imesh_load_'
> FindConnectF.F:(.text+0x9d): undefined reference to `imesh_getentities_'
> FindConnectF.F:(.text+0x104): undefined reference to `imesh_getentadj_'
> FindConnectF.F:(.text+0x1ab): undefined reference to `imesh_getentarradj_'
> FindConnectF.F:(.text+0x243): undefined reference to `imesh_dtor_'
> collect2: ld returned 1 exit status
> make: *** [FindConnectF] Error 1
>
>
>
> ____________________________________________________________________________
> Here's the makefile i use on Mira:
>
> ZLIB_DIR=/soft/libraries/alcf/current/xl/ZLIB
> HDF5_DIR=/soft/libraries/hdf5/1.8.10/cnk-xl/V1R2M0-20130405
> MOAB_DIR=/soft/applications/moab/4.6.0/cnk-xl/V1R2M0-20130419
>
> F77 = mpif77
> F77LD = $(F77)
> INCLUDES = -I$(MOAB_DIR)/include
>
> CPPFLAGS =
> DEFS = -DHAVE_CONFIG_H
> FFLAGS = -d -fcray-pointer
>
> LDADD = -liMesh -lMOAB ${MOAB_CXX_LIBS}
> LDFLAGS =   -L$(ZLIB_DIR)/lib  -L$(HDF5_DIR)/lib -L$(MOAB_DIR)/lib
> LIBS =  -lm
>
> MOAB_CXX_LIBS =  -lmpichcxx -lmpich -lopa -lmpl -lrt -lcr -lpthread
> -lstdc++
> MOAB_CXX_LINKFLAGS = -L/usr/lib
> -L/soft/apps/ibmcmp-feb2013/vacpp/bg/12.1/bglib64/
> -L/soft/apps/ibmcmp-feb2013/vac/bg/12.1/bglib64/
>
> FindConnectF: FindConnectF.o
> 	@rm -f FindConnectF
> 	$(F77LD) $(FFLAGS) $(LDFLAGS) $(MOAB_CXX_LINKFLAGS) FindConnectF.o -o
> FindConnectF $(LDADD) $(LIBS)
>
> FindConnectF.o:
> 	$(F77) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(FFLAGS) -c FindConnectF.F
>
>
> The output is:
>
> [akanaev at miralac1 moab-f77]$ make -f Makefile_FindConnect
> mpif77 -DHAVE_CONFIG_H
> -I/soft/applications/moab/4.6.0/cnk-xl/V1R2M0-20130419/include  -d
> -fcray-pointer -c FindConnectF.F
> "FFindConnectF.f", line 164.16: 1515-019 (S) Syntax is incorrect.
> "FFindConnectF.f", line 165.17: 1515-019 (S) Syntax is incorrect.
> "FFindConnectF.f", line 166.20: 1515-019 (S) Syntax is incorrect.
> "FFindConnectF.f", line 167.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 168.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 169.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 170.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 171.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 172.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 173.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 174.6: 1514-050 (S) Specification statement is out
> of order.  Statement is ignored.
> "FFindConnectF.f", line 180.58: 1515-009 (E) Null literal string is not
> permitted.  A single blank is assumed.
> ** findconnect   === End of Compilation 1 ===
> 1501-511  Compilation failed for file FindConnectF.F.
> make: *** [FindConnectF.o] Error 1
>
>
>
>

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
  phone (gvoice): (608) 354-1459      1500 Engineering Dr.
             fax: (608) 263-4499      Madison, WI 53706



More information about the moab-dev mailing list