Skip to content

Commit

Permalink
cleanup, use conda compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
k-dominik committed Feb 14, 2019
1 parent 7306b38 commit 6e30bee
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif()
find_package(OpenMP)


find_package(Boost REQUIRED)
find_package(Boost REQUIRED container)
include_directories(${Boost_INCLUDE_DIRS})


Expand Down
25 changes: 0 additions & 25 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,18 @@
export CXXFLAGS=""
export CFLAGS=""
export LDFLAGS=""

PY_VER=$(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
PY_ABIFLAGS=$(python -c "import sys; print('' if sys.version_info.major == 2 else sys.abiflags)")
PY_ABI=${PY_VER}${PY_ABIFLAGS}

# Depending on our platform, shared libraries end with either .so or .dylib
if [[ $(uname) == 'Darwin' ]]; then
DYLIB_EXT=dylib
CC=clang
CXX=clang++
CXXFLAGS="${CFLAGS} -std=c++11 -stdlib=libc++"
else
DYLIB_EXT=so
CC=gcc
CXX=g++
CXXFLAGS="${CFLAGS} -std=c++11"
# enable compilation without CXX abi to stay compatible with gcc < 5 built packages
if [[ ${DO_NOT_BUILD_WITH_CXX11_ABI} == '1' ]]; then
CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 ${CXXFLAGS}"
fi
fi

mkdir build
cd build
cmake ..\
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_PREFIX_PATH=${PREFIX} \
-DPYTHON_EXECUTABLE=${PYTHON} \
-DPYTHON_LIBRARY=${PREFIX}/lib/libpython${PY_ABI}.${DYLIB_EXT} \
-DPYTHON_INCLUDE_DIR=${PREFIX}/include/python${PY_ABI} \
##

make -j${CPU_COUNT}

make install

#cp ${SRC_DIR}/build/marching_cubes*.so ${PREFIX}/lib/python${PY_VER}/site-packages/
4 changes: 1 addition & 3 deletions conda-recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
boost:
- 1.63.0
libstdcxxng:
- 5.4.0
- 1.68.0
python:
- 3.6

Expand Down
8 changes: 2 additions & 6 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@ source:
build:
number: 0
string: py{{CONDA_PY}}_{{PKG_BUILDNUM}}_h{{PKG_HASH}}_g{{GIT_FULL_HASH[:7]}}
script_env:
# Control building with CXX11 abi
- DO_NOT_BUILD_WITH_CXX11_ABI # [linux]

requirements:
build:
- cmake
- python >=2.7
- {{ compiler("cxx") }}
host:
- python {{ python }}
- boost {{ boost }}
- pybind11
run:
- python
- boost
# in order to suppor older linux distros after gcc5 switch:
- libstdcxx-ng >={{ libstdcxxng }} # [linux]
- numpy

test:
Expand Down

0 comments on commit 6e30bee

Please sign in to comment.