[MOAB-dev] Fortran interface to MOAB

Tim Tautges tautges at mcs.anl.gov
Tue Oct 22 17:01:33 CDT 2013


One caveat, on other systems/compilers than Mac/Linux + Gnu, sometimes linking with the Fortran compiler, as is done 
below, fails to include the C++ runtime, leading to all sorts of errors about missing externals, usually from the C++ 
std library.  You can fix this either by specifying the C++ runtime libs on the end of the link line below, or by 
linking with C++ linker and specifying the Fortran runtime libs on the end of the link line.  Either can be simpler than 
the other, depending on the system.

- tim

On 10/22/2013 04:18 PM, Vijay S. Mahadevan wrote:
> A simple makefile along the lines of the one in the examples folder
> should work. Here's one that I tested on some fortran code. Let me
> know if that helps.
>
> -------------------
> # MOAB_DIR points to top-level install dir, below which MOAB's lib/
> and include/ are located
> include ${MOAB_DIR}/lib/moab.make
> include ${MOAB_DIR}/lib/iMesh-Defs.inc
>
> .SUFFIXES: .o .F90 .F
>
> EXAMPLES = ScdMeshF77
>
> default: ${EXAMPLES}
>
> ScdMeshF77: ScdMeshF77.o
>    ${MOAB_FC} -o $@ $< ${IMESH_LIBS}
>
> clean:
>    rm -rf *.o ${EXAMPLES}
>
> .F90.o :
>    ${IMESH_FC} ${IMESH_FCFLAGS} ${IMESH_INCLUDES} ${IMESH_FCDEFS} -c $<
>
> .F.o :
>    ${IMESH_FC} ${IMESH_FCFLAGS} ${IMESH_INCLUDES} ${IMESH_FCDEFS} -c $<
> -------------------
>
> Vijay
>
> On Tue, Oct 22, 2013 at 4:03 PM,  <kanaev at ibrae.ac.ru> wrote:
>>
>>
>> so some examples are in itaps/imesh/ScdMeshF77
>>
>>
>>
>> How do i build ScdMeshF77.F from scratch?
>>
>>
>>
>> Thanks,
>>
>> Anton Kanaev
>>
>> The Nuclear Safety Institute (IBRAE)
>

-- 
================================================================
"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