google / google/s2geometry

Building S2 against anaconda Python in custom directory

Open
#126 13 comments 0 reactions 0 assignees View on GitHub
python
Dominant language
C++
Stars
2.7k
Forks
357
Avg merge
11h 4m
Merged PRs (30d)
1

Description

Hi,

Has anyone succeeded in compiling S2 against an Anaconda Python environment?

When I tried I got:
```
>>> import pywraps2
Fatal Python error: _PyInterpreterState_Get(): no current thread state
Python runtime state: unknown

[1] 99346 abort python
```

I created my environment and tried to build S2 using anaconda tools with:
```
export S2_ENV_DIR="$(realpath ./s2env/)"
mkdir -p $S2_ENV_DIR

conda create -y --prefix $S2_ENV_DIR python=3.8
conda activate $S2_ENV_DIR
conda install -y cmake swig gflags glog gtest make openssl conda-build pkgconfig

git clone https://github.com/google/s2geometry.git
cd s2geometry

export S2GEO_DIR=`pwd`

mkdir -p "${S2GEO_DIR}/build"
cd "${S2GEO_DIR}/build"

export PATH=$PATH:"$S2_ENV_DIR/bin"
cmake \
-D WITH_GFLAGS=ON \
-D WITH_GLOG=ON \
-D CMAKE_INSTALL_PREFIX="${S2_ENV_DIR}" \
-D PYTHON_EXECUTABLE:FILEPATH="$(which python)" \
-D OPENSSL_INCLUDE_DIR="${S2_ENV_DIR}/include" \
-D OPENSSL_SSL_LIBRARY="${S2_ENV_DIR}/lib/libssl.dylib" \
-D OPENSSL_CRYPTO_LIBRARY="${S2_ENV_DIR}/lib/libcrypto.dylib" \
..
make
make install
```

I'm building in an OSX environment.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.