Skip to content

MAC installation update #392

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

Open
wants to merge 1 commit into
base: dev
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
__pycache__
build/
typed_python.egg-info
*.swp

# Ignore node modules
# and evironments EVERYWHERE
Expand Down
27 changes: 13 additions & 14 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Installation #
## OSX ##
(as of writing tested on both Apple Intel and Silicon Macs, OSX Big Sur+, and Python 3.6 & 3.7 only!)

### Steps ###
1. Install [Anaconda](https://www.anaconda.com/products/distribution). We'll be using their Conda package and environment manager.
2. Clone the repo: `git clone https://github.com/APrioriInvestments/typed_python`
3. Create and activate conda environmet (we'll use python 3.7 here): `conda create --name pyenv37 python=3.7 && conda activate pyenv37` (see this [cheatsheet](https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf) for other conda environment relate commands).
4. Install typed python: `pip install -e .` (assuming you are in the root of the directory)
5. Test it out: `pytest -v` (note a few performance tests could fail, but the majority should pass)

## Linux ##

## Development ##
There are several methods for building and setting up a development environment.

Expand All @@ -20,21 +33,7 @@ The included Makefile in this repository contains recipes for building, installi
You can also customize the name and location of any built virtual environments with the `VIRTUAL_ENV` variable.


## Installation ##

### OSX ###

#### Prerequisites ####
* Python 3.6 (recommended installed with homebrew)
* Currently build is tested against `clang`, not `gcc`. For more information about installing `clang` and configuring your environment see [here](https://embeddedartistry.com/blog/2017/2/20/installing-clangllvm-on-osx)
* It is recommended you use Pipenv ([see this link](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv)) to manage the application.
* You can also use virtualenv.
* install Redis (`brew install redis`)




### Linux ###
(These instructions are only for Ubuntu for the moment)

#### Prerequisites ####
Expand Down
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ pytest-cov = "*"

[packages]
sortedcontainers = "*"
llvmlite = "==0.36.0"
llvmlite = "*"
lz4 = "*"
numpy = "<1.20"
numpy = "*"
psutil = "*"
pytz = "*"
typed_python = {editable = true, path = "."}
313 changes: 147 additions & 166 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ hedge fund in New York. If you're interested in working with us, drop us a line
You can read the [introductory tutorial](docs/introduction.md) for using `typed_python` or
check out the documentation [typed_python](docs/typed_python.md).

For installation instruction see [here](INSTALLATION.md).

## Where did this come from?

Every time I (Braxton) find myself writing a lot of Python code, I eventually
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
requires = [
"setuptools",
"wheel",
"numpy < 1.20",
"numpy",
]
# build-backend = "setuptools.build_meta:__legacy__"
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
llvmlite
numpy < 1.20
numpy
psutil
pytz
sortedcontainers
pytest
flaky
lz4

5 changes: 4 additions & 1 deletion typed_python/compiler/llvm_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@

# we need to load the appropriate libstdc++ so that we can get __cxa_begin_catch and friends
if sys.platform == "darwin":
ctypes.CDLL("libstdc++.dylib", mode=ctypes.RTLD_GLOBAL)
try:
ctypes.CDLL("libstdc++.dylib", mode=ctypes.RTLD_GLOBAL)
except Exception:
ctypes.CDLL("libc++.dylib", mode=ctypes.RTLD_GLOBAL)
else:
ctypes.CDLL("libstdc++.so.6", mode=ctypes.RTLD_GLOBAL)

Expand Down