Author Topic: first time use - tutorial doesn't work?  (Read 607874 times)

Olivier

  • Newbie
  • *
  • Posts: 5
    • View Profile
first time use - tutorial doesn't work?
« on: March 27, 2011, 06:13:06 am »
Hi - I am a first time user with no background in programation. I don't even know what perl is... I use windows

I downloaded windows_adiabat_1ph_2-0 and updated it with the latest adiabat_1ph

I downloaded strawberry perl. (should i open command prompt or strawberry perl command lone?)

I set the path in windows control panel as is described here

I read the manual.pdf

I read the forum for help to first time user, downloaded frac_xtal_tutorial.txt and Morb.melts

I have all these files in the same directory c:\users\Olivier\windows_adiabat_1ph_2-0

I type run_adiabat.pl -f frac_xtal_tutorial.txt but the program still reads the environment variables from the by default file adiabat"env.dat!!!

what am I doing wrong?


Paula

  • Administrator
  • Hero Member
  • *****
  • Posts: 261
    • View Profile
    • My GPS Division profile
Re: first time use - tutorial doesn't work?
« Reply #1 on: March 31, 2011, 12:20:25 pm »
Hi Olivier (and Jim and others),

It sounds like you are doing everything right but there is a known problem with some unidentified security feature in Windows 7, Vista, and also clean installs of XP that include the later service packs. This somewhat cripples Perl so that command line options are not recognised. For anyone who's interested, there is more information here:

http://win32.perl.org/wiki/index.php?title=Talk:Main_Page#Fun_with_File_Associations

For adiabat_1ph / run_adiabat.pl this has the effect of forcing run_adiabat.pl to always use adiabat_env.dat as its input and so, unless you edit that file, adiabat_1ph will always run with the default settings (isentropic mode etc.).

There is a workaround on XP but it requires an Administrator password and as far a I can tell it doesn't work on Windows 7. A better solution is to edit the Registry. For Adiabat_1ph 3 I have been working on an install script that 'fixes' Perl on Windows for the user that runs the script, whether or not they have Administrator privileges.  The install script tries to set things up so that the scripts and program(s) are in the user's path, which makes it much easier to run Adiabat_1ph.  It also makes sure that the line endings in the scripts and example files are correct for the operating system it is being run on (Windows, Linux or Mac).

Adiabat_1ph 3 is still being tested and documented etc. (mostly in spare moments between other things). In any case, the interface to Adiabat_1ph 3 has changed somewhat from Adiabat_1ph 2 and some input files will not be backwards compatible. So we intend to continue supporting Adiabat_1ph 2 to give people lots of time for the transition. To that end, I have been writing a version of the install script for Adiabat_1ph 2 and in the future it will be possible to install Adiabat_1ph 2 and 3 simultaneously. Both scripts are now finished (at last!) and for Windows they have been tested on 7, various XP set-ups and, to a lesser extent, on Vista.

The install script is attached at the bottom of this post but you will need to rename the '.txt' extension to '.pl'. Alternatively, or should there be any edits in future, you will always be able to get the latest version from the Adiabat_1ph repository. Likewise, you will need the updated version of run_adiabat.pl given there or below. Note that as of October 7th, updated versions of install.pl and run_adiabat.pl are available. The main difference is that the user can now choose where to install the program. The strategy described in this post should still work but you will probably want to check out the links and instructions on the Adiabat_1ph alternative download site too.

Before installing Adiabat_1ph, Windows users will need to make sure that the Perl program is assigned to the '.pl' extension. Right-click on a .pl file and choose 'Open with...'. If Perl is not listed as a recommended program then browse to the perl.exe file. If you have Strawberry Perl installed this will usually be at "C:\strawberry\perl\bin\perl.exe". Also, Olivier or anyone else who has set the path in a permanent way will find it easiest to undo this before running the script... sorry.

To install Adiabat_1ph, on any operating system, put the two scripts in the yourOS_adiabat_1ph-2-0 folder (or whatever it's called on your computer). Open the appropriate terminal program (e.g. cmd.exe) and navigate down into the folder. Type 'install.pl', on Windows, or './install.pl', on other systems, and then type 'y' to continue. On Windows, the script will back up any registry entries it alters as '.reg' files. On any system, certain environment variables or files will not be altered, just to be cautious; instead the script will tell you how to modify them manually (and please feel free to contact me if you need more details or help with a particular set-up).

When you are done, shut the command prompt window and open it again. Windows users may actually need to log out and in again. Repeat the instructions above to run install.pl again as a check and, assuming all's well, choose 'n' to abort another installation. The installer will have put links or, on Windows, batch files in a folder called 'bin' in your home space. You can verify that Perl is fixed and that the path is set correctly by navigating away from the yourOS_adiabat_1ph-2-0 folder (anywhere that doesn't have run_adiabat.pl or adiabat_env.dat files will do) and typing:

Quote
run_adiabat.pl -h
     ... you should get a brief help message about run_adiabat.pl
     ... if the adiabat_1ph program runs then command line switches are still being ignored

run_adiabat.pl
     ... you should get a run_adiabat.pl error about it not being able to find adiabat_env.dat
     ... if the adiabat_1ph program runs then you probably have another entry in your path that needs to be deleted

Note that there should be no './', even on Mac or Linux. You can delete the logfile.txt file it generates

Do not delete yourOS_adiabat_1ph-2-0! It is fine to move or rename that folder but you will need to rerun install.pl afterwards. Also, please do not edit the original adiabat_env.dat file or other examples files in place - instead make a new folder with copies of the various input files and call run_adiabat.pl from there.

I hope this helps. If there are any problems, please let me know.

Paula
« Last Edit: October 10, 2011, 02:42:21 pm by Paula »

Olivier

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: first time use - tutorial doesn't work?
« Reply #2 on: April 01, 2011, 07:48:38 am »
thanks Paula. the first time I read this it was like Chinese to me. The second time I read it I followed the steps closely: it worked!

Oli

JMungall

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: first time use - tutorial doesn't work?
« Reply #3 on: July 23, 2011, 11:18:00 am »
Hi Paula.  this works like a charm.  thanks for helping us windoze users!
Jim

thewall

  • Guest
Re: first time use - tutorial doesn't work?
« Reply #4 on: September 02, 2011, 01:42:52 am »
Hi Paula, thank you for this help

:)

I know I know,should be better change OS...
;D
« Last Edit: September 02, 2011, 01:45:37 am by thewall »