Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT allow to set environment variable at install #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,13 @@ The output generated by the above example should look like the following:
- Cython (only for building and installing, not for everyday use)
- Pillow (friendly fork of PIL, used here for file I/O with the example and during unit tests)
- CharLS (source included as subfolder)

## Installing

Under Linux, you need to set the environment variable `MSCV` to be able to install:

```
export MSCV=False
pip install .
```

13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@


import numpy as np
import os
import setuptools

from setuptools import setup, find_packages
from setuptools.extension import Extension

import numpy as np
from Cython.Distutils import build_ext

# Cython extension.
Expand All @@ -20,8 +18,11 @@

extra_link_args = []

flag_MSVC = True # Set this flag to True if using Visual Studio.
if flag_MSVC:
if 'MSCV' in os.environ and os.environ['MSCV'] == 'False':
flag_MSCV = False
else:
flag_MSCV = True
if flag_MSCV:
extra_compile_args = ['/EHsc']
else:
extra_compile_args = []
Expand Down