Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » mpiJava not building in eclipse - noob(mpiJava not building in eclipse)
mpiJava not building in eclipse - noob [message #819204] Mon, 12 March 2012 16:17 Go to next message
Rudolf Hoehler is currently offline Rudolf HoehlerFriend
Messages: 1
Registered: March 2012
Junior Member
Hey guys,

I'm rather new to Java, so please bare with me! Smile

I have downloaded and installed mpiJava, and I can compile and run java code that imports mpi routines in a bash terminal using the javac and java commands.

In order to get this to work I had to set some environmental paths for bash.
Quote:

CLASSPATH=$CLASSPATH:/mirror/mpiJava/lib/classes/
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mirror/mpiJava/lib/
PATH=/mirror/mpich2/bin:$PATH
LD_LIBRARY_PATH=/mirror/mpich2/lib:$LD_LIBRARY_PATH



I cannot do the same in Eclipse.

Eclipse underlines import mpi.* with a red line. I then add an external class folder that points to the mpiJava classes folder, and the red lines go away. Now the IDE will allow me to build and run.

When I press play I get errors. I have edited the eclipse.ini file and made sure that eclipse uses the correct java vm. I don't get any errors when using the command line and emacs so I know at the very least the system is working.

The erros I get:
Quote:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no savesignals in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at mpi.MPI.<clinit>(MPI.java:46)
at Hello.main(Hello.java:21)

I work on Ubuntu 11.10 with eclipse downloaded from the Ubuntu Repo's.

Any help or pointer will greatly be appreciated.

Thanks for taking the time to help me out - you're time is really appreciated! Smile

Regards,

Rudolf

The code for what it is worth:

  /*
   * Author of revised version: Franklyn Pinedo
   *
   * Adapted from Source Code in C of Tutorial/User's Guide for MPI by
   * Peter Pacheco.
   */

import java.util.*;
import java.lang.*;
import java.net.*;
import mpi.* ;
 

class Hello
{
    
    static public void main(String[] args) throws MPIException
    {
      

	MPI.Init(args) ;

	int my_rank = 0; // Rank of process
	int source = 0;  // Rank of sender
	int dest = 0;    // Rank of receiver 
	int tag=50;  // Tag for messages	
	int myrank = MPI.COMM_WORLD.Rank() ;
	int p = MPI.COMM_WORLD.Size() ;

	if(myrank != 0) // is another node!
	{
	    dest=0;
	    char[] message = null;
	    try
	    {
		message = ( "Greetings from computer: " + InetAddress.getLocalHost().getHostName()  ).toCharArray();	   
	    }
	    catch ( Exception error )
	    {

	    }
	    MPI.COMM_WORLD.Send( message, 0, message.length, MPI.CHAR,dest, tag );
	}
	else
	{  // my_rank == 0
	    for ( source =1;source != p;source++)
	    {
		char[] message = new char[60];
		MPI.COMM_WORLD.Recv( message, 0, 60, MPI.CHAR, source, tag );
		System.out.println( message );
	    }
	}
 
	MPI.Finalize();
    }
}

[Updated on: Mon, 12 March 2012 16:18]

Report message to a moderator

Re: mpiJava not building in eclipse - noob [message #906150 is a reply to message #819204] Fri, 31 August 2012 18:12 Go to previous message
Telles Nobrega is currently offline Telles NobregaFriend
Messages: 1
Registered: August 2012
Junior Member
I couldn't run the Hello example with mpirun, i installed mpijava and mpich2, keeps saying that it cant find the main class. How did you do it?
Previous Topic:how to synchronize files in eclipse
Next Topic:Eclipse failse to start after updating plugins
Goto Forum:
  


Current Time: Sat Apr 20 04:16:29 GMT 2024

Powered by FUDForum. Page generated in 0.02927 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top