[MOAB-dev] Fortran interface to MOAB

Vijay S. Mahadevan vijay.m at gmail.com
Tue Oct 22 17:56:38 CDT 2013


True. The linker needs both the C++ MPI and runtime libraries. Else
the build fails.

-lmpi -lmpi_cxx  -lstdc++

Should we create a IMESH_FLIBS variable that combines IMESH_LIBS and
these extra runtime libraries ?

Vijay

On Tue, Oct 22, 2013 at 5:01 PM, Tim Tautges <tautges at mcs.anl.gov> wrote:
> 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