[Ifeffit] ifeffit module for perl
Bruce Ravel
bravel at anl.gov
Mon Jun 6 10:42:05 CDT 2005
On Monday 06 June 2005 08:44, Satyender Goel wrote:
> Hi,
>
>
> I am developing algorithms for Automation of "DATA MINING FOR HIGH
> THROUGHPUT SYNCROTRON SPECTROSCOPIES" with Dr. S L M Schroeder group.
>
> I have come across a problem in accessing IFEFFIT libraries through Perl on
> WINDOWS Platform. I have installed latest version of IFEFFIT as well as
> PERL. Evertime i try accessing IFEFFIT Through Perl it gives the error
> like:
>
> c:\work>perl -w trial.pl
> Can't locate loadable object for module ifeffitin @INC <@INC contains:
> C:/Perl/lib c:/Perl/site/lib .> at trial.pl line 2.
> Compilation failed in require at trial.pl line 2.
> BEGIN failed--conpliation aborted at trial.pl line 2.
>
> I have trying putting 'Perl folder from wrappers of IFEFFIT' to
> Perl/site/lib, but no success so far.
>
> I am stuck with my work.
> Any solution to get Access of IFEFFIT libraries through Perl?
>
> Cheers!!!
>
Satyender,
To explain why you are stuck, I need to explain a bit how the Ifeffit
package works on Windows. If you look at the properties for the
desktop icons for Athena, Artemis, and Hephaestus, you will see that
they point at the .bat files rather than at the .exe files. Indeed,
if you try double clicking on the .exe files you will find that the
programs will not launch.
The reason for this is that the perl programs need to have some
environment variables set correctly in order to run. This could have
been done by making modifications to the registry, but I am of the
opinion that neither Matt nor I understand Windows well enough to be
mucking around with peoples' registries! The solution we came up with
was to set some environment variables in the .bat files then lauynch
the executables from the batch files.
Among the environemnt variables that get set in the .bat files is the
one that Ifeffit.pm uses to figure out the location of the Ifeffit
DLL. Without that environment variable set, Ifeffit.pm cannot find
the DLL and spits up an error message.
Take a look at the .bat files -- it should be clear to your how that
scheme works.
To solve your problem, there are many possible solutions. You'll
have to decide which one works best for you. Here are some
suggestions:
1. Modify your registry so that the environment variables are set in
some global sense. (Note that I have no idea how that is done.)
2. Wrap all you perl scripts inside of batch files like the ones we
use for my GUI codes.
3. Try putting something like this at the beginning of your perl
scripts:
BEGIN {
$ENV{IFEFFIT_DIR} = 'C:\Program Files\Ifeffit\';
}
You'll probably want to set all the environemnt variables from the
batch files in the BEGIN block. Note that I am suggesting this
without actually testing it. YMMV.
Let us know how if any of these things work. If not, send me a copy
of your script and I'll take a more direct look at the problem.
B
--
Bruce Ravel ----------------------------------- bravel at anl.gov -or-
ravel at phys.washington.edu
Environmental Research Division, Building 203, Room E-165
Argonne National Laboratory phone and voice mail: (1) 630 252 5033
Argonne IL 60439, USA fax: (1) 630 252 9793
My homepage: http://feff.phys.washington.edu/~ravel
EXAFS software: http://feff.phys.washington.edu/~ravel/software/exafs/
More information about the Ifeffit
mailing list