Skip to content

Commit 017e024

Browse files
committed
new web section on pixi install; more work on installation docs planned
1 parent 9719927 commit 017e024

File tree

4 files changed

+165
-130
lines changed

4 files changed

+165
-130
lines changed

MDhelp/docs/commontreeitems.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Subsequent lines should contain:
210210
Note that quantity ``"Weight factor" * (obs-calc) / esd`` determines the impact of the restraint,
211211
so the esd values are on an arbitrary scale.
212212

213+
If the columns are reorganized and the header changed to match, the code should be able to change to match, but this has not been tested.
213214
Spacing between columns does not matter and columns do not need to be aligned.
214215
With a file such as the one below, that contains both distances and angles, the file must be
215216
read in twice, using the **Add MOGUL restraints** menu command from both the Bond tab and

webdocs/install.rst

Lines changed: 87 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ For Windows download file https://github.com/AdvancedPhotonSource/GSAS-II-buildt
2525
After the installer is started
2626
You will have a choice for where to install the software (the default is usually OK, but something like ``c:\software`` might be better, if your computer security allows that.)
2727

28-
More complete installation instructions `are here <install-g2f-win.html>`_.
28+
More complete installation instructions on the GSAS2MAIN
29+
installation process on windows are linked below.
30+
31+
.. index:: gsas2main windows details
32+
.. toctree::
33+
:maxdepth: 1
34+
35+
install-g2f-win.rst
36+
2937

3038
MacOS
3139
--------------------
@@ -47,7 +55,14 @@ where:
4755

4856
<install-loc> is where you want to install the software. (Use of ``~/g2main``, a subdirectory named ``g2main`` in your home directory is a good choice.) After installation is complete, you will be given a chance to place a shortcut for GSAS-II into the MacOS dock.
4957

50-
More complete installation instructions are provided for `MacOS separately <install-g2f-mac.html>`_.
58+
More complete installation instructions on the GSAS2MAIN
59+
installation process on MacOS are linked below.
60+
61+
.. index:: gsas2main MacOS details
62+
.. toctree::
63+
:maxdepth: 3
64+
65+
install-g2f-mac.rst
5166

5267
Linux
5368
--------------------
@@ -63,6 +78,19 @@ former is built on an APS Redhat Enterprise server, while the latter
6378
is built on an Ubuntu GitHub runner (24.04.2 LTS, last I
6479
checked). Neither may be compatible with other Linux versions.
6580

81+
Binary compatibility between Linux systems is not all that
82+
good. If the above do not work, or if you prefer to use code packages
83+
distributed for your Linux platform, you are encouraged to use
84+
apt-get, yum,... to install Python (see the
85+
`GSAS-II Python package requirements
86+
<https://gsas-ii.readthedocs.io/en/latest/packages.html#gui-requirements>`_,
87+
and then use the ``gitcompile.py`` routine, discussed in the
88+
:ref:`gitcompile` section below to download, compile and install GSAS-II.
89+
Another easy-to-use option is to use pixi, (see :ref:`pixi
90+
installation`). The disadvantage of pixi, at least with the standard
91+
install, is that you will need to
92+
update GSAS-II manually with git commands and then rerun pixi.
93+
6694
To install GSAS2MAIN in Linux using the GitHub runner version, use a command such as::
6795
6896
g2="https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/releases/download/v1.0.1/gsas2main-Latest-Linux-x86_64.sh"
@@ -78,51 +106,34 @@ where:
78106

79107
<install-loc> is where you want to install the software. (Use of
80108
``~/g2main``, a subdirectory named ``g2main`` in your home directory
81-
is a good choice.) More details on use of the `GSAS2MAIN installer on
82-
Linux is here <install-g2f-linux.html>`_.
109+
is a good choice.)
83110

84-
As note above, binary compatibility between Linux systems is not all that
85-
good. If the above do not work, or if you prefer to use code packages
86-
distributed for your Linux platform, you are encouraged to use
87-
apt-get, yum,... to install Python (see the
88-
`GSAS-II Python package requirements
89-
<https://gsas-ii.readthedocs.io/en/latest/packages.html#gui-requirements>`_,
90-
and then use the ``gitcompile.py`` routine, discussed in the
91-
:ref:`gitcompile` section below to download, compile and install GSAS-II.
92-
Another easy-to-use option is to use pixi, (see :ref:`pixi
93-
installation`). The disadvantage of pixi is that you will need to
94-
update GSAS-II manually with git commands and then rerun pixi.
95-
96-
GSAS2MAIN Additional Details
97-
----------------------------------------
98-
99-
The pages listed below go through the GSAS2MAIN installation process on each identified platform in much greater detail.
111+
More complete installation instructions on the GSAS2MAIN
112+
installation process on linux are below.
100113

101-
.. index:: gsas2pkg installer
114+
.. index:: gsas2main MacOS details
102115
.. toctree::
103116
:maxdepth: 3
104117

105-
install-g2f-win.rst
106-
install-g2f-mac.rst
107118
install-g2f-linux.rst
108-
109-
110-
GSAS2PKG Conda Package
111-
=======================
112119

113-
Users who work extensively with Python and use the conda Python installer may prefer to utilize their existing conda installation to obtain GSAS-II along with the Python configuration that GSAS-II prefers. This can be done with this command (on all platforms)::
114-
115-
conda create -n GSASII briantoby::gsas2pkg -c conda-forge
116-
117-
This creates a conda virtual environment named ``GSASII`` (this can be changed) for use by GSAS-II. While it is also possible to install GSAS-II into the conda base environment, this is not recommended as it can create conflicts between Python and package versions needed by GSAS-II and those required by other packages. (If you choose to do this anyway, be sure to specify ``conda install python=3.13 briantoby::gsas2pkg`` as Python is likely to be pinned to a different version.)
118-
119-
After this command is run, use command ``conda activate GSASII`` to access the
120-
conda environment that has been created. On Linux and MacOS computers, two shortcut commands will then be available in the path, The first command, ``gsasII.sh``, which will start GSAS-II. This can optionally be used as ``gsasII.sh project.gpx`` to open existing project file ``project.gpx`` in GSAS-II. The second command, ``reset-gsasII.sh`` will rarely be used. This command will download the latest version of GSAS-II and update to that version, replacing any locally modified files with the original versions. This can be used to update GSAS-II when the program will not start, so the normal Help->Update menu command cannot be accessed. (Shortcuts available with gsas2pkg v5.1+.)
120+
Installing GSAS-II via pixi
121+
======================================================
121122

122-
Note that on MacOS, a Mac app is also created and is displayed in the Finder
123-
`see steps 5 & 6 here <install.html#macos-gsas2main-installation-details>`_. This app can be used to start GSAS-II from the dock or desktop.
123+
Due to royalty issues with use of Anaconda, Inc. conda packages (which
124+
GSAS-II does not use; GSAS-II only uses conda-forge which is
125+
non-proprietary), some sites are encouraging use of pixi rather than
126+
conda. The pixi installer can be used directly after downloading
127+
GSAS-II from the GitHub site. It installs Python and all packages
128+
needed for GSAS-II and it also compiles GSAS-II locally, rather than
129+
downloading pre-built binaries, which is of particular value for
130+
Linux. It interferes with GSAS-II's self-updating process, however.
124131

125-
.. index:: Installing GSAS-II with gitstrap.py
132+
.. index:: pixi installation
133+
.. toctree::
134+
:maxdepth: 3
135+
136+
install_pixi.rst
126137

127138
Installing GSAS-II with a Separate Python Installation
128139
======================================================
@@ -238,11 +249,35 @@ start due to changes that have been made locally, the ``--reset``
238249
option might be needed.
239250

240251
.. index:: Installing GSAS-II from GitHub
252+
253+
254+
GSAS2PKG Conda Package
255+
=======================
256+
257+
Users who work extensively with Python and use the conda Python installer may prefer to utilize their existing conda installation to obtain GSAS-II along with the Python configuration that GSAS-II prefers. This can be done with this command (on all platforms)::
258+
259+
conda create -n GSASII briantoby::gsas2pkg -c conda-forge
260+
261+
This creates a conda virtual environment named ``GSASII`` (this can be changed) for use by GSAS-II. While it is also possible to install GSAS-II into the conda base environment, this is not recommended as it can create conflicts between Python and package versions needed by GSAS-II and those required by other packages. (If you choose to do this anyway, be sure to specify ``conda install python=3.13 briantoby::gsas2pkg`` as Python is likely to be pinned to a different version.)
262+
263+
After this command is run, use command ``conda activate GSASII`` to access the
264+
conda environment that has been created. On Linux and MacOS computers, two shortcut commands will then be available in the path, The first command, ``gsasII.sh``, which will start GSAS-II. This can optionally be used as ``gsasII.sh project.gpx`` to open existing project file ``project.gpx`` in GSAS-II. The second command, ``reset-gsasII.sh`` will rarely be used. This command will download the latest version of GSAS-II and update to that version, replacing any locally modified files with the original versions. This can be used to update GSAS-II when the program will not start, so the normal Help->Update menu command cannot be accessed. (Shortcuts available with gsas2pkg v5.1+.)
265+
266+
Note that on MacOS, a Mac app is also created and is displayed in the Finder
267+
`see steps 5 & 6 here <install.html#macos-gsas2main-installation-details>`_. This app can be used to start GSAS-II from the dock or desktop.
268+
269+
.. index:: Installing GSAS-II with gitstrap.py
270+
241271

242272
Installation Info for Developers
243273
==============================================
244274

245-
While all of the above approaches will clone a copy of the GSAS-II repository from GitHub, software developers may find it more convenient to clone the repo themselves. This will typically be done as part of a process where a copy of GSAS-II is forked on GitHub. This is described in a `separate page <install_dev.html>`_ (outline below).
275+
While all of the above approaches will clone a copy of the GSAS-II
276+
repository from GitHub, software developers may find it more
277+
convenient to clone the repo themselves. This will typically be done
278+
as part of a process where a copy of GSAS-II is forked on GitHub. This
279+
is described in a `separate page <install_dev.html>`_ (outline
280+
below).
246281

247282
.. index:: Installing for development
248283
.. toctree::
@@ -251,20 +286,6 @@ While all of the above approaches will clone a copy of the GSAS-II repository fr
251286
install_dev.rst
252287

253288

254-
Older Installers
255-
=================================
256-
257-
Previously GSAS-II was provided via an Advanced Photon Source-maintained subversion (svn) server, with differing installation processes. The subversion server is not longer being updated, so those installers should not be used because if GSAS-II is installed from subversion, you will not be able to update to the current GSAS-II version.
258-
If you previously installed GSAS-II from that server, you will be
259-
shown a message when trying to update that you should reinstall
260-
GSAS-II as described above.
261-
262-
Likewise, the gsas2full installer was used to install GSAS-II from the
263-
older ``master`` branch. Use of this installer is discouraged. If you
264-
install GSAS-II from that branch, you will be
265-
be offered the opportunity to add needed Python packages and switch to
266-
the ``main`` branch when trying to update GSAS-II from the help menu.
267-
268289
Installation Details
269290
====================================
270291

@@ -280,3 +301,16 @@ if the distributed binaries cannot be used.
280301
install-pip.rst
281302
proxy.rst
282303

304+
Older Installers
305+
=================================
306+
307+
Previously GSAS-II was provided via an Advanced Photon Source-maintained subversion (svn) server, with differing installation processes. The subversion server is not longer being updated, so those installers should not be used because if GSAS-II is installed from subversion, you will not be able to update to the current GSAS-II version.
308+
If you previously installed GSAS-II from that server, you will be
309+
shown a message when trying to update that you should reinstall
310+
GSAS-II as described above.
311+
312+
Likewise, the gsas2full installer was used to install GSAS-II from the
313+
older ``master`` branch. Use of this installer is discouraged. If you
314+
install GSAS-II from that branch, you will be
315+
be offered the opportunity to add needed Python packages and switch to
316+
the ``main`` branch when trying to update GSAS-II from the help menu.

webdocs/install_dev.rst

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -128,80 +128,3 @@ You are strongly encouraged to create a separate branch for each development pro
128128

129129
When your changes are complete and you are ready to communicate them back, you will commit them locally and use ``git push`` to upload them to GitHub. From the web interface to GitHub you can then submit that branch as a pull request to the main GSAS-II repository. Once you have submiited your pull request, you likely will want to switch to a different branch to do any further development work, as if changes are uploaded for the branch used for the pull request, those changes will be added to the code in the pull request.
130130

131-
.. index:: Installing with pixi
132-
133-
.. _pixi installation:
134-
135-
==============================================
136-
Using Pixi to install GSAS-II
137-
==============================================
138-
139-
The code in the ``main`` includes setup files for `Pixi <https://pixi.sh>`_, which is a package management tool for developers. If one uses Git to install the GSAS-II files and installs the Pixi software, GSAS-II can be configured and installed very simply.
140-
It is particularly convenient for GSAS-II software development.
141-
There are many ways to install Pixi, as listed `here <https://pixi.sh>`_, or by using the ``conda install pixi`` command, or homebrew, etc.
142-
143-
Once pixi is installed, it can be used to setup and run GSAS-II, with commands as described below. These commands download GSAS-II from GitHub, install it, including compiling the files locally, then runs the self-tests and then finally starts the GSAS-II GUI::
144-
145-
cd <install-location>
146-
git clone --depth 1 [email protected]:AdvancedPhotonSource/GSAS-II.git
147-
cd GSAS-II/pixi
148-
pixi run install
149-
pixi run test
150-
pixi run ui
151-
152-
The pixi program makes all this very easy. Developers will likely want to clone from their own fork of the repo (see above) and may want to use variants on these commands, such as add `--no-single-branch` so that all branches are available and/or change the `--depth` value or even omit that option. (Any of these increase the download time significantly.)
153-
Also note the `install-editable` or `install-editable-win` options below. This allows that git-installed code is used to run GSAS-II rather than copies. With this "`editable" option you can make changes to GSAS-II and then restart it and see the impact of your changes immediately [with a bit of tampering, sometimes one can use `importlib.reload()` and see changes as soon as they are saved]. If the normal install process is used, the changes will be seen only after repeating the `pixi run install` step.
154-
155-
---------------------------------------------------
156-
GSAS-II pixi commands
157-
---------------------------------------------------
158-
159-
Details on commonly-used commands with pixi follow:
160-
161-
``pixi run install``
162-
163-
This will install GSAS-II into the ``pixi/.pixi`` directory where it will be
164-
used by exclusively by pixi. The GSAS-II Fortran, etc. files will be compiled
165-
and will be placed with other executable files used by Python.
166-
167-
``pixi run install-editable`` (Linux/MacOS)
168-
169-
``pixi run install-editable-win`` (on Windows)
170-
171-
This will set up to run GSAS-II in the directory where the files are originally
172-
located. This is ideal for code development as changes in Python code will
173-
immediately be seen as soon as GSAS-II is restarted and git commands can
174-
be used to upload changes to GitHub. Note the slightly different version of
175-
this command for Windows.
176-
177-
After one of the above install commands is used, the following commands can be used:
178-
179-
``pixi run test``
180-
181-
Runs the GSAS-II self-test suite (takes 1-2 minutes typically to complete.)
182-
See :ref:`example output here<example_pytest_output>`.
183-
184-
``pixi run ui``
185-
186-
Starts the GSAS-II GUI.
187-
188-
``pixi run python``
189-
190-
Starts Python with the GSAS-II environment established.
191-
192-
``pixi shell``
193-
194-
Starts a shell (bash, cmd.exe,...) where conda, python, etc. are available to run.
195-
The GSAS-II environment is setup. This is a useful command for developing
196-
or running GSASIIscriptable scripts.
197-
198-
---------------------------------------------------
199-
Use of non-default pixi environments
200-
---------------------------------------------------
201-
202-
By default, the commands above will install and run GSAS-II with Python 3.13 (at the time this is written), but pixi can also setup GSAS-II to run with alternate Python versions. Available options are ``py310``, ``py311``, and ``py312``. To use an alternate environment, it should be added to every command, such as
203-
``pixi run -e py311 install-editable-win``,
204-
``pixi run -e py311 test``,
205-
``pixi run -e py311 ui`` or
206-
``pixi shell -e py311``.
207-

0 commit comments

Comments
 (0)