Skip to content

Commit

Permalink
Merge pull request #1831 from pypeit/windows_install
Browse files Browse the repository at this point in the history
Fix windows installation problem (Issue #1634)
  • Loading branch information
kbwestfall authored Jul 23, 2024
2 parents 9e19d4c + 46dfe13 commit f048fef
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 95 deletions.
18 changes: 16 additions & 2 deletions bin/pypeit_c_enabled
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,25 @@ else:
print('Successfully imported bspline C utilities.')

try:
from pypeit.bspline.setup_package import extra_compile_args

# Check for whether OpenMP support is enabled, by seeing if the bspline
# extension was compiled with it.
#
# The extension_helpers code that is run to figure out OMP support runs
# multiple tests to determine compiler version, some of which output to stderr.
# To make the output pretty we redirect those to /dev/null (or equivalent)
import os
import sys
devnull_fd = os.open(os.devnull,os.O_WRONLY)
os.dup2(devnull_fd,sys.stderr.fileno())

from pypeit.bspline.setup_package import get_extensions
bspline_extension = get_extensions()[0]
except:
print("Can't check status of OpenMP support")
else:
if '-fopenmp' in extra_compile_args:
# Windows uses -openmp, other environments use -fopenmp
if any(['openmp' in arg for arg in bspline_extension.extra_compile_args]):
print('OpenMP compiler support detected.')
else:
print('OpenMP compiler support not detected. Bspline utilities single-threaded.')
2 changes: 1 addition & 1 deletion doc/help/run_pypeit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
usage: run_pypeit [-h] [-v VERBOSITY] [-r REDUX_PATH] [-m] [-s] [-o] [-c]
pypeit_file
## [1;37;42mPypeIt : The Python Spectroscopic Data Reduction Pipeline v1.16.1.dev97+g2ab5988a9[0m
## [1;37;42mPypeIt : The Python Spectroscopic Data Reduction Pipeline v1.16.1.dev109+g885cb1823[0m
##
## Available spectrographs include:
## bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v,
Expand Down
10 changes: 5 additions & 5 deletions doc/include/keck_deimos.sorted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
filename | frametype | ra | dec | target | dispname | decker | binning | mjd | airmass | exptime | dispangle | amp | filter1 | lampstat01 | dateobs | utc | frameno | calib
DE.20170527.06713.fits | arc,tilt | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.077631 | 1.41291034 | 1.0 | 8099.98291016 | SINGLE:B | OG550 | Kr Xe Ar Ne | 2017-05-27 | 01:51:53.87 | 30 | 0
d0527_0030.fits.gz | arc,tilt | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.077631 | 1.41291034 | 1.0 | 8099.98291016 | SINGLE:B | OG550 | Kr Xe Ar Ne | 2017-05-27 | 01:51:53.87 | 30 | 0
d0527_0031.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.07851 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:53:10.93 | 31 | 0
DE.20170527.06790.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.07851 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:53:10.93 | 31 | 0
DE.20170527.06864.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.079356 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:54:24.03 | 32 | 0
d0527_0031.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.07851 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:53:10.93 | 31 | 0
d0527_0032.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.079356 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:54:24.03 | 32 | 0
d0527_0033.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.080211 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:55:36.93 | 33 | 0
DE.20170527.06864.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.079356 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:54:24.03 | 32 | 0
DE.20170527.06936.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.080211 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:55:36.93 | 33 | 0
d0527_0033.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.080211 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:55:36.93 | 33 | 0
DE.20170527.37601.fits | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.435131 | 1.03078874 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:26:41.61 | 80 | 0
d0527_0081.fits.gz | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.449842 | 1.01267696 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:47:52.92 | 81 | 0
DE.20170527.38872.fits | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.449842 | 1.01267696 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:47:52.92 | 81 | 0
DE.20170527.41775.fits | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.483427 | 1.00093023 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:36:15.35 | 83 | 0
d0527_0081.fits.gz | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.449842 | 1.01267696 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:47:52.92 | 81 | 0
d0527_0083.fits.gz | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.483427 | 1.00093023 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:36:15.35 | 83 | 0
DE.20170527.41775.fits | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.483427 | 1.00093023 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:36:15.35 | 83 | 0
DE.20170527.43045.fits | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.498135 | 1.00838805 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:57:25.35 | 84 | 0
DE.20170527.44316.fits | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.512854 | 1.02377681 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 12:18:36.71 | 85 | 0
DE.20170527.53184.fits | science | 349.99316666666664 | -5.16575 | Feige 110 | 830G | LongMirr | 1,1 | 57900.615484 | 1.42505162 | 45.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 14:46:24.88 | 93 | 0
Expand Down
29 changes: 27 additions & 2 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,30 @@ for x86-64:
Solutions/Recommendations/Feedback for these installation options are welcome;
please `Submit an issue`_.

User Installation on Windows
---------------------------------------------

#. Download `Python for Windows <https://www.python.org/downloads/windows/>`_.

#. Run the installer.

* Make sure "Add python.exe to Path" or "Add Python to environment variables" is selected before installing.
* If you have Admin privileges click "Disable path length limit" after the installation succeeds.

#. Downloand and run the `Visual Studio build tools <https://visualstudio.microsoft.com/visual-cpp-build-tools/>`_ installer.

* Only "Desktop Development with C++" needs to be checked.
* Click install

#. Create a virtual environment as in `Setup a clean python environment <environment_>`__ and install PypeIt as described above.

If running ``python`` on Windows brings up a window for the Microsoft Store you may want to change the application alias.
This is under ``Settings -> Apps -> App execution aliases`` on Windows 10 and ``Settings -> Apps -> Advanced app settings -> App execution aliases``
on Windows 11. Disable the ``App Installer`` options for the ``python.exe`` and ``python3.exe`` executables.

An alternative for running under Windows is to install the `Windows Subsystem for Linux (WSL) <https://learn.microsoft.com/en-us/windows/wsl/install>`_.
This in effect allows you to run PypeIt under Linux under Windows.

----

.. _data_installation:
Expand Down Expand Up @@ -518,11 +542,12 @@ will work single-threaded if OpenMP is not available. GCC supports OpenMP
out of the box, however the ``clang`` compiler that Apple's XCode provides does not. So
for optimal performance on Apple hardware, you will want to install GCC via ``homebrew``
or ``macports`` and specify its use when installing ``pypeit``. For example, if you installed
GCC 12.x via ``homebrew``, you would get ``pypeit`` to use it by doing, for example:
GCC via ``homebrew``, you would get ``pypeit`` to use it by doing, for example:

.. code-block:: console
CC=gcc-12 pip install pypeit
$ export CC=/opt/homebrew/bin/gcc
$ pip install pypeit
Basically, ``pypeit`` checks the ``CC`` environment variable for what compiler to use so configure
that as needed to use your desired compiler. The ``pypeit_c_enabled`` script can be used to check if
Expand Down
Loading

0 comments on commit f048fef

Please sign in to comment.