Fedora Linux Support Community & Resources Center
  #1  
Old 25th June 2012, 08:13 PM
ablen Offline
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 51
windows_7ie
Troubleshooting a path problem

Hello all,

I am trying to test pvm on my FC16 system and as a part of this testing I need to compile a test file. It seems it should be simple, but when I do so I get this error:

Code:
[theuser@mysrv examples]$ /$PVM_ROOT/lib/aimk master1 slave1
making in LINUX64/ for LINUX64
mkdir ../../bin
mkdir ../../bin/LINUX64
cc -g -I../../include -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DHASSTDLIB -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DSYSVSTR -DUSESTRERROR  -o master1 ../../examples/master1.c  -L../../lib/LINUX64 -lpvm3 
../../examples/master1.c:37:18: fatal error: pvm3.h: No such file or directory
compilation terminated.
make: *** [master1] Error 1
So I figure what I need to do is alter the path in order to provide access to the pvm3.h file. So I issue these commands:

Code:
[theuser@mysrv examples]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/theuser/.local/bin:/home/theuser/bin
[theuser@mysrv examples]$ export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/theuser/.local/bin:/home/theuser/bin:/usr/share/pvm3/bin:/usr/share/pvm3/include/
[theuser@mysrv examples]$
When I tried again I unexpectedly had the same issue:

Code:
[theuser@mysrv examples]$ /$PVM_ROOT/lib/aimk master1 slave1
making in LINUX64/ for LINUX64
cc -g -I../../include -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DHASSTDLIB -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DSYSVSTR -DUSESTRERROR  -o master1 ../../examples/master1.c  -L../../lib/LINUX64 -lpvm3 
../../examples/master1.c:37:18: fatal error: pvm3.h: No such file or directory
compilation terminated.
make: *** [master1] Error 1
But if I do the following the file seems to be there:

Code:
[theuser@mysrv examples]$ cd /usr/share/pvm3/include/
[theuser@mysrv include]$ ls
fpvm3.h  fpvm3_watcom.h  pvm3.h  pvmproto.h  pvmtev.h
[theuser@mysrv include]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/theuser/.local/bin:/home/theuser/bin:/usr/share/pvm3/bin:/usr/share/pvm3/include/
[theuser@mysrv include]$
Am I making a mistake with the path commands? I must be missing something fundamental I think.
Reply With Quote
  #2  
Old 26th June 2012, 03:19 PM
tashirosgt Online
Registered User
 
Join Date: Aug 2004
Posts: 3,963
linuxfirefox
Re: Troubleshooting a path problem

The error messages state a relative path "../../examples/master1.c" instead of a full path. Could that be relevant?
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #3  
Old 26th June 2012, 08:33 PM
ablen Offline
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 51
windows_7ie
Re: Troubleshooting a path problem

Quote:
Originally Posted by tashirosgt View Post
The error messages state a relative path "../../examples/master1.c" instead of a full path. Could that be relevant?
Hmmm, thanks for the comment, tashirosgt. I am not sure how it could be. Maybe? I am focused on the idea that it can't find pvm3.h anywhere - and I expect it should be able to since that's in the path.

Additional ideas?
Reply With Quote
  #4  
Old 26th June 2012, 11:24 PM
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 6,053
linuxfirefox
Re: Troubleshooting a path problem

The PATH has nothing to do with this problem, the problem is with the -I../../include

You need to check that the make is being done in a directory such that ../../include is the directory where the pvm3.h file is contained.

So in the directory where you do the make, this should list the pvm3.h file:

ls -l ../../include/pvm3.h


If it says "no such file" then you need to modify the makefile so the -I includes the directory for that file. If you have to have multiple "-I" directories, you need to add them in this format:

-I../../include -I../include -I/usr/local/include

where I'm hypothetically adding ../include and /usr/local/include

Last edited by marko; 26th June 2012 at 11:28 PM.
Reply With Quote
  #5  
Old 27th June 2012, 01:31 AM
tashirosgt Online
Registered User
 
Join Date: Aug 2004
Posts: 3,963
linuxfirefox
Re: Troubleshooting a path problem

As Marko said, if the make command is executing in the directory /big/tall/wally/smith then it will look for the file "../../exalmples/master1.c" as /big/tall/examples/master1.c.

You also have to keep in mind that makefiles can contain cd commands, so the make process can change directories as it runs.

---
If you understand the syntax of makefiles (which are sensitive to things like the placement of tabs) then you can insert pwd commands in the makefile to show where it is operating.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."

Last edited by tashirosgt; 27th June 2012 at 01:41 AM.
Reply With Quote
  #6  
Old 27th June 2012, 07:17 PM
george_toolan Offline
Registered User
 
Join Date: Dec 2006
Posts: 2,078
linuxfirefox
Re: Troubleshooting a path problem

Your fundamental mistake was to believe it would use the PATH environment variable ;-)

PATH is only for binaries and nothing else.

Where exactly is the examples directory located and wouldn't it be a lot easier if master1.c and pvm3.h were in the same directory?

For include files you use the -I option like marko explained

Code:
       -I dir
           Add the directory dir to the list of directories to be searched for
           header files.  Directories named by -I are searched before the
           standard system include directories.  If the directory dir is a
           standard system include directory, the option is ignored to ensure
           that the default search order for system directories and the
           special treatment of system headers are not defeated .  If dir
           begins with "=", then the "=" will be replaced by the sysroot
           prefix; see --sysroot and -isysroot.
I have the feeling "-I../../include" was supposed to take care of that, but somehow misses.

What exactly does line 37 of master1.c say?

Last edited by george_toolan; 27th June 2012 at 07:25 PM.
Reply With Quote
  #7  
Old 28th June 2012, 06:22 PM
ablen Offline
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 51
windows_7ie
Re: Troubleshooting a path problem

Firstly, thank you all for the assistance on this. I very much appreciate it.

Quote:
Originally Posted by george_toolan View Post
Your fundamental mistake was to believe it would use the PATH environment variable ;-)

PATH is only for binaries and nothing else.
Ah - I didn't know that. That must be the problem, then.

Okay, let's see - this is where the .h file is located:

Code:
[theuser@mysrv examples]$ cd /usr/share/pvm3/include/
[theuser@mysrv include]$ ls
fpvm3.h  fpvm3_watcom.h  pvm3.h  pvmproto.h  pvmtev.h
[theuser@mysrv include]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/theuser/.local/bin:/home/theuser/bin:/usr/share/pvm3/bin:/usr/share/pvm3/include/
[theuser@mysrv include]$
Here is the examples directory:

Code:
[theuser@mysrv examples]$ cd /home/theuser/pvm3/examples/
[theuser@mysrv examples]$ ls
AIX4SP2     gmbi.c         inherit1.c  LINUX64        master1.f     PGON      slave1.f   task0.c     timing_slave.c
bwtest.c    hello.c        inherit2.c  lmbi.c         mbox.c        ptest.c   SP2MPI     task1.c
cygwin.mak  hello_other.c  inherit3.c  Makefile.aimk  mhf_server.c  Readme    spmd.c     task_end.c
gexample.c  hitc.f         inherita.c  Makefile.mak   mhf_tickle.c  rme.c     spmd.f     taskf.c
gexample.f  hitc_slave.f   inheritb.c  master1.c      OS2           slave1.c  starter.c  timing.c
[theuser@mysrv examples]$
Line 37, BTW, looks like this. Commented out:

Code:
#include "pvm3.h"
The whole file, BTW, looks like this:

Code:
[theuser@mysrv examples]$ cat master1.c

static char rcsid[] =
        "$Id: master1.c,v 1.5 2009/01/23 01:12:52 pvmsrc Exp $";

/*
 *         PVM version 3.4:  Parallel Virtual Machine System
 *               University of Tennessee, Knoxville TN.
 *           Oak Ridge National Laboratory, Oak Ridge TN.
 *                   Emory University, Atlanta GA.
 *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer
 *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
 *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
 *                   (C) 1997 All Rights Reserved
 *
 *                              NOTICE
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for any purpose and without fee is hereby granted
 * provided that the above copyright notice appear in all copies and
 * that both the copyright notice and this permission notice appear in
 * supporting documentation.
 *
 * Neither the Institutions (Emory University, Oak Ridge National
 * Laboratory, and University of Tennessee) nor the Authors make any
 * representations about the suitability of this software for any
 * purpose.  This software is provided ``as is'' without express or
 * implied warranty.
 *
 * PVM version 3 was funded in part by the U.S. Department of Energy,
 * the National Science Foundation and the State of Tennessee.
 */

#include <stdio.h>
#ifdef HASSTDLIB
#include <stdlib.h>
#endif
#include "pvm3.h"
#define SLAVENAME "slave1"

main()
{
    int mytid;                  /* my task id */
        int tids[32];                           /* slave task ids */
    int n, nproc, numt, i, who, msgtype, nhost, narch;
    float data[100], result[32];
    struct pvmhostinfo *hostp;

    /* enroll in pvm */
    mytid = pvm_mytid();

    /* Set number of slaves to start */
    pvm_config( &nhost, &narch, &hostp );
    nproc = nhost * 3;
    if( nproc > 32 ) nproc = 32 ;
        printf("Spawning %d worker tasks ... " , nproc);

    /* start up slave tasks */
    numt=pvm_spawn(SLAVENAME, (char**)0, 0, "", nproc, tids);
    if( numt < nproc ){
       printf("\n Trouble spawning slaves. Aborting. Error codes are:\n");
       for( i=numt ; i<nproc ; i++ ) {
          printf("TID %d %d\n",i,tids[i]);
       }
       for( i=0 ; i<numt ; i++ ){
          pvm_kill( tids[i] );
       }
       pvm_exit();
       exit(1);
    }
        printf("SUCCESSFUL\n");
    

    /* Begin User Program */
    n = 100;
    /* initialize_data( data, n ); */
    for( i=0 ; i<n ; i++ ){
       data[i] = 1.0;
    }

    /* Broadcast initial data to slave tasks */
        pvm_initsend(PvmDataDefault);
        pvm_pkint(&nproc, 1, 1);
        pvm_pkint(tids, nproc, 1);
        pvm_pkint(&n, 1, 1);
        pvm_pkfloat(data, n, 1);
    pvm_mcast(tids, nproc, 0);

    /* Wait for results from slaves */
    msgtype = 5;
    for( i=0 ; i<nproc ; i++ ){
       pvm_recv( -1, msgtype );
       pvm_upkint( &who, 1, 1 );
       pvm_upkfloat( &result[who], 1, 1 );
       printf("I got %f from %d; ",result[who],who);
       if (who == 0)
                        printf( "(expecting %f)\n", (nproc - 1) * 100.0);
       else
                        printf( "(expecting %f)\n", (2 * who - 1) * 100.0);

    }
    /* Program Finished exit PVM before stopping */
    pvm_exit();
}

Last edited by ablen; 28th June 2012 at 07:09 PM.
Reply With Quote
Reply

Tags
path, problem, troubleshooting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add path /usr/local/bin/lftp to user path nix4me Using Fedora 6 18th August 2010 12:31 AM
c++ path problem daviddoria Using Fedora 1 8th March 2010 07:59 AM
Need help troubleshooting DNS server problem Mango85 Using Fedora 0 2nd May 2007 03:43 AM
troubleshooting hardware problem diggy Hardware & Laptops 1 26th September 2006 12:07 PM
Path problem Error403 Installation, Upgrades and Live Media 2 15th January 2005 03:07 AM


Current GMT-time: 15:51 (Tuesday, 30-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat