forked from openalea/lpy
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from fredboudon/master
Update LPy to the new fresh Py3 version
- Loading branch information
Showing
439 changed files
with
61,113 additions
and
7,148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Building Package using Conda | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
#max-parallel: 5 | ||
matrix: | ||
os: [ macos-latest, ubuntu-latest] | ||
env: | ||
- CONDA_PY: "37" | ||
CONDA_NPY: "111" | ||
- CONDA_PY: "38" | ||
CONDA_NPY: "116" | ||
- CONDA_PY: "39" | ||
CONDA_NPY: "119" | ||
|
||
environment: anaconda_build | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Add conda to system path | ||
run: | | ||
# Add conda to system path | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Setup conda | ||
run: | | ||
# Setup conda | ||
sudo conda config --add channels conda-forge | ||
sudo conda config --add channels fredboudon | ||
sudo conda config --set always_yes yes | ||
sudo conda config --set remote_read_timeout_secs 600 | ||
sudo conda config --set auto_update_conda False | ||
sudo conda install conda-build anaconda-client | ||
- name: Build | ||
env: | ||
CONDA_PY: ${{ matrix.env.CONDA_PY }} | ||
CONDA_NPY: ${{ matrix.env.CONDA_NPY }} | ||
run: | | ||
# Build | ||
if [[ "$CONDA_PY" = "" ]]; then | ||
echo "CONDA_PY is not defined" | ||
exit -1 | ||
fi | ||
if [[ "$CONDA_NPY" = "" ]]; then | ||
echo "CONDA_NPY is not defined" | ||
exit -1 | ||
fi | ||
export PYTHON_VERSION=${CONDA_PY:0:1}.${CONDA_PY:1:1} | ||
export NUMPY_VERSION=${CONDA_NPY:0:1}.${CONDA_NPY:1:2} | ||
export BUILD_CMD="sudo conda build . --python=$PYTHON_VERSION" | ||
export BUILD_OUTPUT=`$BUILD_CMD --output` | ||
if [[ "$BUILD_OUTPUT" = "" ]]; then | ||
echo "PACKAGE NAME is not defined" | ||
exit -1 | ||
fi | ||
echo "BUILD_OUTPUT=$BUILD_OUTPUT" >> $GITHUB_ENV | ||
$BUILD_CMD | ||
- name: Login | ||
env: | ||
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }} | ||
ANACONDA_PASSWORD: ${{ secrets.ANACONDA_PASSWORD }} | ||
run: | | ||
# Login | ||
if [[ "$ANACONDA_LOGIN" = "" ]]; then | ||
echo "ANACONDA_LOGIN is not defined" | ||
exit -1 | ||
fi | ||
SESSION_UID=$(uuidgen) | ||
anaconda login --username $ANACONDA_LOGIN --password $ANACONDA_PASSWORD --hostname $SESSION_UID | ||
- name: Deploy | ||
env: | ||
ANACONDA_OWNER: ${{ secrets.ANACONDA_OWNER }} | ||
BUILD_OUTPUT: ${{ env.BUILD_OUTPUT }} | ||
run: | | ||
# Deploy | ||
if [[ "$ANACONDA_OWNER" = "" ]]; then | ||
echo "ANACONDA_OWNER is not defined" | ||
exit -1 | ||
fi | ||
echo "PACKAGE NAME:" $BUILD_OUTPUT | ||
if [[ "$BUILD_OUTPUT" = "" ]]; then | ||
echo "PACKAGE NAME is not defined" | ||
exit -1 | ||
fi | ||
anaconda upload --skip-existing $BUILD_OUTPUT -u $ANACONDA_OWNER --no-progress | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# --- CMake Modules | ||
|
||
cmake_minimum_required(VERSION 3.12) | ||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
include("Anaconda") | ||
include("pywrapper") | ||
|
||
# --- L-Py Project | ||
|
||
project(lpy_project CXX) | ||
|
||
# --- Build setup | ||
|
||
set(CMAKE_SKIP_BUILD_RPATH FALSE) | ||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) | ||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") | ||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | ||
|
||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) | ||
|
||
if("${isSystemDir}" STREQUAL "-1") | ||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") | ||
endif("${isSystemDir}" STREQUAL "-1") | ||
|
||
|
||
|
||
# --- CXX11 Compilation | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") | ||
|
||
# --- (Win32) Multithreaded Compilation | ||
|
||
if (MSVC) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") | ||
endif() | ||
|
||
## When linking, Python libs are required, so I advised I could use: "target_library_link(targetname ${Python3_LIBRARIES})" | ||
## But AppleClang has difficulties linking with Python3_LIBRARIES, I don't know why. | ||
## It DOES link with it, but when running it crashes mysteriously on a Python Malloc (what???) | ||
## instead, I use this undefined dynamic_lookup flag to let the dynamic libraries be found when run. | ||
if (APPLE) | ||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup") | ||
endif() | ||
|
||
## ################################################################### | ||
## Dependencies | ||
## ################################################################### | ||
|
||
# --- Python | ||
|
||
find_package (Python3 COMPONENTS Interpreter Development REQUIRED) | ||
include_directories(${Python3_INCLUDE_DIRS}) | ||
|
||
# --- Libraries | ||
|
||
find_package(Threads REQUIRED) | ||
find_package(Qt5Core CONFIG REQUIRED) | ||
find_package(Qt5Concurrent CONFIG REQUIRED) | ||
find_package(PlantGL REQUIRED) | ||
|
||
set(Boost_NO_SYSTEM_PATHS ON) | ||
set(Boost_USE_MULTITHREAD ON) | ||
set(Boost_USE_STATIC_LIBS OFF) | ||
set(BUILD_SHARED_LIBS ON) | ||
|
||
if (USE_CONDA) | ||
set(boost_python python) | ||
else() | ||
set(boost_python python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}) | ||
endif() | ||
|
||
find_package(Boost COMPONENTS system ${boost_python} REQUIRED) | ||
|
||
# --- Include Directories | ||
|
||
include_directories("src/cpp") | ||
|
||
include_directories(${Boost_INCLUDE_DIR}) | ||
|
||
# --- Library Directory | ||
|
||
if (DEFINED CONDA_ENV) | ||
link_directories("${CONDA_ENV}/lib") | ||
endif() | ||
|
||
# --- Source Directories | ||
|
||
add_subdirectory("src/cpp") | ||
add_subdirectory("src/wrapper") | ||
|
||
install_share("share" "lpy") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.