Skip to content

Commit 90a7410

Browse files
committed
document gitcompile as per #174
1 parent 10c8345 commit 90a7410

File tree

3 files changed

+119
-7
lines changed

3 files changed

+119
-7
lines changed

MDhelp/docs/phaseoverview.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ Phases are placed in their own section of the [GSAS-II data tree](./applicationw
77

88
Phases are either created with the Data/"Add new phase" menu item (manual input) or are read in using the Import/Phase menu items. After a phase is imported, if there are histograms (datasets) present in the project, you will be offered a chance to link the imported phase to the previously imported histogram(s). Likewise, if histograms(s) are imported when phase(s) are already present, you will also be asked to link the new data to existing phases. It is also possible to link histograms to a phase later by selecting that phase in the data tree and then selecting the "Data" tab and finally using the "Edit Phase"/"Add powder histograms" menu command.
99

10-
When a phase is selected from the data tree, parameters are shown for that selected phase in a tabbed window. Clicking on each tab raises the windows as documented in subsequent sections of the help documentation. The tabs are:
10+
When a phase is selected from the data tree, parameters are shown for
11+
that selected phase in a tabbed window. Clicking on each tab raises
12+
the windows as documented in subsequent sections of the help
13+
documentation.
1114

1215
<a name="PhaseTabList"></a>
16+
The tabs are:
17+
1318
- [General](./phasegeneral.md)
1419
- [Data](./phasedata.md)
1520
- [Atoms](./phaseatoms.md)

webdocs/compile.rst

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,40 @@ Create shortcuts::
380380
conda install pytest
381381
python -m pytest G2\tests
382382

383-
See above for an example of what to expect from the self tests.
383+
See above for an example of what to expect from the self tests.
384+
385+
386+
A script to Install & Compile GSAS-II
387+
======================================================
388+
389+
A simple way to install and compile GSAS-II uses the supplied
390+
``gitcompile.py`` script. Use these commands (on any platform) to
391+
install with local compilation::
392+
393+
cd ~/G2
394+
curl -L -O https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/raw/main/install/gitcompile.py
395+
python gitcompile.py
396+
397+
This will place the install script in directory ``~/G2`` (which you
398+
may wish to change above) and will use git to clone the
399+
AdvancedPhotonSource/GSAS-II repo placing all files in subdirectory
400+
``~/G2/GSAS-II``. The script does the following things:
401+
402+
* it checks that the Python installation has the packages that GSAS-II
403+
needs to run (`see here for details
404+
<https://gsas-ii.readthedocs.io/en/latest/packages.html#python-requirements>`_)
405+
and for compilation.
406+
* It installs or updates the GSAS-II files from the GitHub repo
407+
* It creates the and installs the appropriate binary files from the
408+
Fortran, C and Cython sources.
409+
* It does a byte-compile on all ``.py`` files
410+
* it creates shortcuts/icons for starting GSAS-II (OS specific)
411+
412+
Note that there are a number of options that can be used with the
413+
script, for example ``python gitcompile.py --reset`` overwrites any
414+
changes that have been made to GSAS-II files locally with the original
415+
versions of the files. The other options are not likely to be needed,
416+
but can be seen with ``python gitcompile.py --help``
384417

385418
Compiling with Scons
386419
---------------------------

webdocs/install.rst

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Note that on MacOS, a Mac app is also created and is displayed in the Finder
104104

105105
.. index:: Installing GSAS-II with gitstrap.py
106106

107-
Installing GSAS-II with Separate Python Installation
107+
Installing GSAS-II with a Separate Python Installation
108108
======================================================
109109

110110
A small number of users or sites prefer to use Python distributions supplied via other routes (such as Debian packages) or using `PyPi <https://pypi.org>`_, etc. or prefer to handle use of conda on their own. Some discussion on Python installation is
@@ -120,13 +120,87 @@ A simple way to install GSAS-II with a supplied Python environment uses the ``gi
120120
curl -L -O https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/raw/main/install/gitstrap.py
121121
python gitstrap.py
122122

123-
This will place the install script in directory ``~/G2`` (which you may wish to change) and will place all GSAS-II files in subdirectory ``~/G2/GSAS-II``
123+
This will place the install script in directory ``~/G2`` (which you
124+
may wish to change above) and will use git to clone the
125+
AdvancedPhotonSource/GSAS-II repo placing all files in subdirectory
126+
``~/G2/GSAS-II``. The script does the following things:
127+
128+
* it checks that the Python installation has the packages that GSAS-II
129+
needs to run (`see here for details
130+
<https://gsas-ii.readthedocs.io/en/latest/packages.html#python-requirements>`_)
131+
* It installs or updates the GSAS-II files from the GitHub repo
132+
* It downloads and installs the appropriate binary files from the
133+
`GSAS-II releases
134+
<https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/releases>`_
135+
* It does a byte-compile on all ``.py`` files
136+
* it creates shortcuts/icons for starting GSAS-II (OS specific)
137+
138+
Note that there are a number of options that can be used with the
139+
script, for example ``python gitstrap.py --reset`` overwrites any
140+
changes that have been made to GSAS-II files locally with the original
141+
versions of the files. The other options are not likely to be needed,
142+
but can be seen with ``python gitstrap.py --help``
143+
144+
This script is also useful because it can be run to update GSAS-II as
145+
an alternative to the Help/Update command (which will cannot be used
146+
when GSAS-II will not start after a bad update.) If GSAS-II will not
147+
start due to changes that have been made locally, the ``--reset``
148+
option might be needed.
149+
150+
.. index:: Installing & Compiling GSAS-II
151+
152+
Installing & Compiling GSAS-II
153+
======================================================
124154

125-
Note that you can also clone the GitHub repo. If you do this, the GSAS-II binary files
126-
will not be installed. However, when GSAS-II is first run, it will provide an opportunity to do this.
155+
If using GSAS-II on some Linux dists, or with versions of Python/numpy other than
156+
what we support, it may be necessary (or a site policy) to compile the
157+
GSAS-II binaries locally rather than download them. A script is
158+
supplied that works similarly to the above, but compiles the GSAS-II
159+
source files. This requires that in addition to the GSAS-II run-time
160+
Python packages are needed (see the
161+
`discussion on Python package requirements
162+
<https://gsas-ii.readthedocs.io/en/latest/packages.html#gui-requirements>`_,
163+
for compilation the Python cython and meson packages are required, as
164+
well as gfortran and gcc, which can be installed via conda, but are
165+
frequently intalled in other ways.
166+
167+
A simple way to install and compile GSAS-II uses the supplied
168+
``gitcompile.py`` script. Use these commands (on any platform) to
169+
install with local compilation::
127170

128-
.. index:: Installing GSAS-II from GitHub
171+
cd ~/G2
172+
curl -L -O https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/raw/main/install/gitcompile.py
173+
python gitcompile.py
174+
175+
This will place the install script in directory ``~/G2`` (which you
176+
may wish to change above) and will use git to clone the
177+
AdvancedPhotonSource/GSAS-II repo placing all files in subdirectory
178+
``~/G2/GSAS-II``. The script does the following things:
179+
180+
* it checks that the Python installation has the packages that GSAS-II
181+
needs to run (`see here for details
182+
<https://gsas-ii.readthedocs.io/en/latest/packages.html#python-requirements>`_)
183+
and for compilation.
184+
* It installs or updates the GSAS-II files from the GitHub repo
185+
* It creates the and installs the appropriate binary files from the
186+
Fortran, C and Cython sources.
187+
* It does a byte-compile on all ``.py`` files
188+
* it creates shortcuts/icons for starting GSAS-II (OS specific)
189+
190+
Note that there are a number of options that can be used with the
191+
script, for example ``python gitcompile.py --reset`` overwrites any
192+
changes that have been made to GSAS-II files locally with the original
193+
versions of the files. The other options are not likely to be needed,
194+
but can be seen with ``python gitcompile.py --help``
195+
196+
This script is also useful because it can be run to update GSAS-II as
197+
an alternative to the Help/Update command (which will cannot be used
198+
when GSAS-II will not start after a bad update.) If GSAS-II will not
199+
start due to changes that have been made locally, the ``--reset``
200+
option might be needed.
129201

202+
.. index:: Installing GSAS-II from GitHub
203+
130204
Installation Info for Developers
131205
==============================================
132206

0 commit comments

Comments
 (0)