Unverified Commit a8fa85c7 authored by Gan Quan's avatar Gan Quan Committed by GitHub
Browse files

Conda builds (#187)

* conda recipe

* switching to source build

* trying windows build

* wip

* windows build works
parent a0d0b1ea
conda recipe
===
Build the package with `conda build .`
git submodule init
git submodule update
md build
cd build
cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DTVM_EXPORTS" -DCMAKE_MAKE_PROGRAM=mingw32-make .. -G "MSYS Makefiles"
if errorlevel 1 exit 1
mingw32-make
if errorlevel 1 exit 1
cd ..\python
"%PYTHON%" setup.py install --single-version-externally-managed --record=record.txt
if errorlevel 1 exit 1
git submodule init
git submodule update
mkdir build
cd build
cmake ..
make
cd ../python
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
python:
- 3.5
- 3.6
- 3.7
package:
name: dgl
version: "0.0.1"
source:
git_rev: conda
git_url: https://github.com/jermainewang/dgl.git
requirements:
build:
- python {{ python }}
- setuptools
- cmake
- m2w64-gcc # [win]
- m2w64-make # [win]
run:
- python
- numpy
- scipy
- networkx
about:
home: https://github.com/jermainewang/dgl.git
license_file: ../../LICENSE
set DGLBACKEND=numpy
%PYTHON% -c "import dgl"
DGLBACKEND=numpy $PYTHON -c 'import dgl'
......@@ -89,6 +89,6 @@ In the command line prompt, run:
md build
cd build
cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DTVM_EXPORTS" .. -G "MinGW Makefiles"
cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DTVM_EXPORTS" -DCMAKE_MAKE_PROGRAM=mingw32-make .. -G "MSYS Makefiles"
mingw32-make
set DGL_LIBRARY_PATH=%CD%
......@@ -29,22 +29,20 @@ def get_lib_path():
libinfo = {'__file__': libinfo_py}
exec(compile(open(libinfo_py, "rb").read(), libinfo_py, 'exec'), libinfo, libinfo)
version = libinfo['__version__']
if not os.getenv('CONDA_BUILD'):
lib_path = libinfo['find_lib_path']()
libs = [lib_path[0]]
else:
libs = None
lib_path = libinfo['find_lib_path']()
libs = [lib_path[0]]
return libs, version
LIBS, VERSION = get_lib_path()
include_libs = False
wheel_include_libs = False
if not os.getenv('CONDA_BUILD'):
if "bdist_wheel" in sys.argv:
wheel_include_libs = True
else:
include_libs = True
if "bdist_wheel" in sys.argv or os.getenv('CONDA_BUILD'):
wheel_include_libs = True
else:
include_libs = True
setup_kwargs = {}
......@@ -60,6 +58,7 @@ if wheel_include_libs:
}
# For source tree setup
# Conda build also includes the binary library
if include_libs:
rpath = [os.path.relpath(path, CURRENT_DIR) for path in LIBS]
setup_kwargs = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment