LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-08-08 17:07:14


Arrgh. That's a real bummer. What is mex -- is it a wrapper compiler
like mpicc?

It looks like mex doesn't want to accept the -pthread switch.

Well, I was really hoping to avoid a manual assembly of flags, but you
may need to do that. We have automated ways of getting the flags out
of mpicc (and you could filter out -pthread), but that may or may not
be sufficient. That is, if the bottom-level compiler does not link in
the pthreads library, LAM may not link properly.

Specifically, you can run your mpicc command line below and add
"-showme" to see what mpicc is actually invoking underneath. Try
simply eliminating -pthread from the underlying command and see if it
links properly (I suspect that it won't).

Let me know what happens and let's go from there.

On Aug 5, 2005, at 2:07 PM, Lei_at_ICS wrote:

> Thanks! This sounds like a simple solution.
>
> I tried it and got some errors:
>
> /home/packages/LAM-MPI/intel/bin/mpicc -f ../mexopts_linux.sh -V5 -v
> -D_LINUX_ -I/usr/local/matlab/extern/include -DMATLAB View.o Viewx.o
> BuildCavityLists.o BuildCombinedLists.o BuildRadMatrixIndexVectors.o
> ComputeElementGeometryProperties.o CreateParticipatingInternalChbdys.o
> DetermineViewUpdateMode.o GenerateRadList.o
> InitRadMatrixCavityPartition.o InternalChbdysInternalGridPtrLookup.o
> ReorderInternalChbdys.o SetAllUpdateFlags.o UpdateInternalChbdys.o
> Vfact.o View3d.o ../db_/imdb.a ../DataSet/DataSet.a
> ../EnumDefinitions/EnumDefinitions.a ../dbx_/imdbx.a ../shared/utils.a
>
> mex: -pthread not a valid option.
>
> Usage:
> MEX [option1 ... optionN] sourcefile1 [... sourcefileN]
> [objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN]
>
> or (to build an Ada S-function):
> MEX [-v] [-g] -ada <sfcn>.ads
>
> Use the -help option for more information, or consult the MATLAB
> External Interfaces Guide.
>
> /home/packages/LAM-MPI/intel/bin/mpicc: No such file or directory
> gmake: *** [View] Error 1
> ~
>
>
> If I setenv LAMCC mex
>
> I get:
>
> losangeles[24]% mpicc
>
> mex: -pthread not a valid option.
>
> Usage:
> MEX [option1 ... optionN] sourcefile1 [... sourcefileN]
> [objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN]
>
> or (to build an Ada S-function):
> MEX [-v] [-g] -ada <sfcn>.ads
>
> Use the -help option for more information, or consult the MATLAB
> External Interfaces Guide.
>
> mpicc: No such file or directory
> losangeles[25]%
>
> But if I setenv LAMCC gcc
> I get:
>
> losangeles[27]% mpicc
> /usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o: In function
> `_start':
> /usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o(.text+0x18):
> undefined reference to `main'
> collect2: ld returned 1 exit status
> mpicc: No such file or directory
> losangeles[28]%
>
> Yes, mex is a script provided by Matlab. But I am not able to
> modify it yet. Any further suggestions on how to solve it problem?
>
> Thanks a lot,
>
> -Lei
>
>
> Jeff Squyres wrote:
>
>> On Aug 3, 2005, at 9:52 PM, Lei_at_ICS wrote:
>>
>>
>>
>>> I compiled View3d.c using mpicc -c View3d.c,
>>> I then compiled View.c and linked the entire thing
>>> using mex. When it executes, I got an error:
>>> ??? Invalid MEX-file '/home/pan/IMOS/delivery/View.mexglx':
>>> /home/pan/IMOS/delivery/View.mexglx: undefined symbol: MPI_Init.
>>>
>>> This is obvious, because I did not link with the MPI libraries.
>>>
>>> So my question is: How do I modify mex to work with MPI,
>>> or how do I modify mpicc to work with mex? Is there another
>>> option?
>>>
>>>
>>
>> Is mex another wrapper compiler, similar to mpicc?
>>
>> If so, what you might want to do is set mpicc's underlying compiler to
>> be mex, and then link your application with mpicc (i.e., layer the
>> wrapper compilers).
>>
>> You can do this by setting the environment variable LAMCC to "mex" (or
>> whatever the executable name is that you use to compile/link Mex
>> applications).
>>
>>
>>
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/