[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem with compiling code with oct.h and mpi code
From: |
ortak |
Subject: |
problem with compiling code with oct.h and mpi code |
Date: |
Thu, 9 Apr 2009 10:20:43 -0700 (PDT) |
I have a code which includes "octave.h", "oct.h" and "mpi.h".
Here's my code :
#include<octave/oct.h>
#include<octave/octave.h>
#include<iostream>
#include <octave/parse.h>
#include "mpi.h"
using namespace std;
int main(int argc, char **argv)
{
octave_value fff;
int rank, size;
MPI_Init( &argc, &argv );
MPI_Comm_size( MPI_COMM_WORLD, &size );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
octave_value f_ret;
if(rank==0){
int a[2];
a[0] = 1;
a[1] = 1;
f_ret = feval("sum", octave_value(a));
}else if(rank == 1){
int a[2];
a[0] = 2;
a[1] = 2;
f_ret = feval("sum", octave_value(a));
}
int ans = f_ret.int_value();
//printf( "Hello world from process %d of %d\n", rank, size );
MPI_Finalize();
return 0;
}
When I try to compile code I take an error which starts with these lines :
/tmp/ccgEpTDE.o: In function `main':
dene.cc:(.text+0x8d): undefined reference to `octave_value::octave_value()'
dene.cc:(.text+0xce): undefined reference to `octave_value::octave_value()'
dene.cc:(.text+0x101): undefined reference to
`octave_value::octave_value(bool)'
dene.cc:(.text+0x157): undefined reference to `feval(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, octave_value_list
const&, int)'
I guess my errors is about linking but despite of reading some articles
about that topic i couldn't solve my problem. Any one have any ideas??
--
View this message in context:
http://www.nabble.com/problem-with-compiling-code-with-oct.h-and-mpi-code-tp22975605p22975605.html
Sent from the Octave - General mailing list archive at Nabble.com.
- problem with compiling code with oct.h and mpi code,
ortak <=