Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Open MPI and Objective C
From: Beatty, Daniel D CIV NAVAIR, 474300D (daniel.beatty_at_[hidden])
Date: 2011-09-19 11:26:29


Greetings Scott,
The NSLog call should be no big deal since it is provided by the Cocoa frameworks and is inherent to Objective C.

The mpicc compiler may be a different thing. It may not recognize that it supposed to be calling gcc to compile in Objective-C mode and not in pure ISO C-99. I will have look up in my notes to recall the instructions necessary to make regular gcc or clang to compile properly with MPI.

The extension is fine, so I would think that gcc should go into Objective-C mode. I think MacResearch has an example on their site that could help.

Good luck,

Daniel D. Beatty
Computer Scientist, 474300D
Detonation Sciences Branch
On detail for Land Range Data Systems Branch
At Exodus: (760)939-4040 MTTh 0800 to 1800
At Pearson: (760)939-7097 WF 0800 to 1600
iPhone: (806)438-6620

-----Original Message-----
From: users-bounces_at_[hidden] [mailto:users-bounces_at_[hidden]] On Behalf Of Ralph Castain
Sent: Monday, September 19, 2011 5:35
To: Open MPI Users
Subject: Re: [OMPI users] Open MPI and Objective C

Nothing to do with us - you call a function "NSLog" that Objective C doesn't recognize. That isn't an MPI function.

On Sep 18, 2011, at 8:20 PM, Scott Wilcox wrote:

        I have been asked to convert some C++ code using Open MPI to Objective C and I am having problems getting a simple Obj C program to compile. I have searched through the FAQs and have not found anything specific. Is it an incorrect assumption that the C interfaces work with Obj C, or am I missing something?

        Thanks in advance for your help!
        Scott
          

        open MPI version: 1.4.3
        OSX 10.5.1

        file: main.m

        #import <Foundation/Foundation.h>
        #import "mpi.h"

        int main (int argc, char** argv)

        {
           //***
           // Variable Declaration
           //***
           int theRank;
           int theSize;
           
        
           //***
           // Initializing Message Passing Interface
           //***
           MPI_Init(&argc,&argv);
           MPI_Comm_size(MPI_COMM_WORLD,&theSize);
           MPI_Comm_rank(MPI_COMM_WORLD,&theRank);
           //*** end
           
        
           NSLog(@"Executing open MPI Objective C");

        }

        Compile:

        [87]UNC ONLY: SAW>mpicc main.m -o test
        Undefined symbols:
          "___CFConstantStringClassReference", referenced from:
              cfstring=Executing open MPI Objective C in ccj1AlL9.o
          "_NSLog", referenced from:
              _main in ccj1AlL9.o
        ld: symbol(s) not found
        collect2: ld returned 1 exit status
        _______________________________________________
        users mailing list
        users_at_[hidden]
        http://www.open-mpi.org/mailman/listinfo.cgi/users



  • application/x-pkcs7-signature attachment: smime.p7s