[Thread Prev][Thread Next][Index]

Re: hack to run ferret on RO FS. (Was Re: Ferret open .jnl file rw ?)




Forwarded message for the benefit of the Ferret archives.....


-------- Original Message --------
Subject: Re: hack to run ferret on RO FS. (Was Re: Ferret open .jnl file rw ?)
Date: Wed, 07 May 2003 09:14:57 -0700
From: Kevin O'Brien <Kevin.M.O'Brien@noaa.gov>
To: Olivier ARCHER <olivier.archer@ifremer.fr>
CC: contact_ferret@pmel.noaa.gov
References: <3EA9009C.4020902@ifremer.fr> <3EAFE2C2.90908@ifremer.fr> <3EB237FD.7090705@ifremer.fr> <3EB92EA0.5070407@ifremer.fr>


Hi Olivier -

I have also been looking a this problem.  It turns out that the problem is caused by
the NAG f95 compiler not having a "READONLY" file open specifier.  I myself am looking
into solving this problem.

However, the g77 version of Ferret for linux does not have the same problem.  Perhaps
this would solve the issue for you?  If you have built your own external functions
using f95, you'd have to recompile them with g77 in order to use them with this
version of Ferret, but I believe that is the only complication.

You can get the g77 version of Ferret at:

    http://www.ferret.noaa.gov/Ferret/Downloads/beta_releases.html

Although it's listed as a beta, it has passed all the testing benchmarks......

Let me know if you have any questions or problems -

Thanks -

Kevin


Olivier ARCHER wrote:

> Hi,
>                 I really would like to have access to ferret source code to try to
> handle the EROFS error corectly. Ferret sources are not avialable at
> http://ferret.pmel.noaa.gov/Ferret/Downloads/linux_downloads.html and I
> have no more mail adresses than contact_ferret@pmel.noaa.gov and
> ferret_users@ferret.wrc.noaa.gov.
>
> Can someone tell me someone to contact to send me the source so I can
> patch it ?
>
> --
> Olivier
>
> Olivier Archer wrote:
> > Hi,
> >    I've *temporary* solved my problem, with a so ugly hack:
> > I've overload the fopen libc function to set errno whith EACCES when it
> > is EROFS...
> >
> > #include 
> > #include 
> > #include 
> > #include 
> >
> >
> > FILE *fopen(const char *path, const char *mode){
> >        static FILE *(*RealFopen)(const char *path, const char *mode)=0;
> >        FILE *fid;
> >
> >
> >  // set it up only once
> >  if (!RealFopen){
> >    RealFopen=dlsym(((void *) -1l), "fopen");
> >    if (!RealFopen){
> >      fprintf(stderr, "Fatal error - cannot find fopen()\n");
> >      abort();
> >    }
> >  }
> >
> >  fid= RealFopen(path,mode);
> >    /* force errno to be EACCES if it is EROFS */
> >  if( (fid == NULL) && ( errno == EROFS ) ){ errno=EACCES; }
> >  return fid;
> > }
> >
> > %gcc -o fopen.so -shared fopen.c
> > %setenv LD_PRELOAD fopen.so
> > %ferret
> >
> > This hack permit me go ahead with LAS, but I think something is doable
> > source side...
> >

--
Kevin O'Brien                   UW/JISAO
Research Scientist              NOAA/PMEL/TMAP
206-526-6751                    http://tmap.pmel.noaa.gov



 
-- 
Kevin O'Brien                   UW/JISAO	
Research Scientist              NOAA/PMEL/TMAP
206-526-6751                    http://tmap.pmel.noaa.gov


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement