Skip to content

Commit

Permalink
Merge branch 'fredboudon-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pradal committed Jan 22, 2024
2 parents ffaf378 + d63d795 commit d6e137d
Show file tree
Hide file tree
Showing 194 changed files with 7,876 additions and 3,423 deletions.
74 changes: 11 additions & 63 deletions .github/workflows/conda-package-build.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,18 @@
name: build_publish_anaconda
name: Building Package

on:
push:
branches:
- '**'
tags:
- 'v*'
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch: # allows you to trigger manually

jobs:
build-and-publish:
name: ${{ matrix.os }}, Python 3.${{ matrix.python-minor-version }} for conda deployment
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ ubuntu-latest , macos-latest , windows-latest]
python-minor-version: [7, 8, 9]
isMaster:
- ${{ github.ref == 'refs/heads/master' }}
exclude:
- isMaster: false
os: ubuntu-latest
python-minor-version: 7
- isMaster: false
os: ubuntu-latest
python-minor-version: 8
- isMaster: false
os: macos-latest
python-minor-version: 7
- isMaster: false
os: macos-latest
python-minor-version: 8
- isMaster: false
os: macos-latest
python-minor-version: 9
- isMaster: false
os: windows-latest
python-minor-version: 7
- isMaster: false
os: windows-latest
python-minor-version: 8
- isMaster: false
os: windows-latest
python-minor-version: 9
branches:
- '**'


steps:
- name: Chekout
uses: actions/checkout@v3
- name: Determine publish
uses: haya14busa/action-cond@v1
id: publish
with:
cond: ${{ startsWith(github.ref, 'refs/tags/v') }}
if_true: 'true'
if_false: 'false'
- name: Build and Publish
uses: openalea/action-build-publish-anaconda@v0.1.3
with:
conda: conda
mamba: true
numpy: '20.0'
python: ${{ matrix.python-minor-version }}
channels: openalea3, conda-forge
token: ${{ secrets.ANACONDA_TOKEN }}
publish: true
label: main
jobs:
build:
uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main
secrets:
token: ${{ secrets.ANACONDA_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ src/openalea/plantgl/config.py
# C extensions
build-scons
build-scons_noqt
build-scons_qt4
build-scons_qt6
build-scons_qt5
*.so
*.dll
Expand Down Expand Up @@ -89,3 +89,4 @@ _pgl*.dylib

.vscode
test/geomprinteroutput.geom
examples/povray
38 changes: 28 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ project(plantgl CXX)

# --- Build setup

set(CMAKE_INCLUDE_PATH "$ENV{CONDA_PREFIX}/include" ${CMAKE_INCLUDE_PATH})
set(CMAKE_LIBRARY_PATH "$ENV{CONDA_PREFIX}/lib" ${CMAKE_LIBRARY_PATH})
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
Expand Down Expand Up @@ -63,30 +65,42 @@ define_cpp_macro(PGL_USE_DOUBLE 1)
## ###################################################################

# --- Python
set(Python3_FIND_VIRTUALENV FIRST)
if (WIN32)
# needed when we run cmake in a conda environment
set(Python3_FIND_REGISTRY LAST)
endif()


find_package (Python3 COMPONENTS Interpreter Development REQUIRED)
find_package (Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
include_directories(${Python3_INCLUDE_DIRS})
message(STATUS "Python version : " ${Python3_VERSION})
message(STATUS "Python lib : " ${Python3_LIBRARIES})

# --- Libraries

find_package(Threads REQUIRED)
find_package(Qt)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Network OpenGL PrintSupport)

if(Qt6_FOUND)
find_package(Qt6 REQUIRED COMPONENTS Gui OpenGLWidgets Test)
endif()

find_library(METAL Metal)

define_cpp_macro(PGL_QT_VERSION ${QT_VERSION_MAJOR})
define_py_macro(PGL_WITHOUT_QT "False")
define_py_macro(PGL_QT_VERSION ${QT_VERSION_MAJOR})


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)
# set(boost_numpy numpy)
#else()
set(boost_python python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
set(boost_numpy numpy${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
#endif()

find_package(ZLIB REQUIRED)
find_package(OpenGL REQUIRED)
Expand All @@ -98,6 +112,7 @@ find_package(ANN)
find_package(BISON)
find_package(Eigen)
find_package(FLEX)
find_library(QHULL_LIBRARY NAMES "libqhullstatic.a" PATHS $ENV{CONDA_PREFIX}/lib)
find_package(Qhull)

#if (USE_CONDA_BUILD)
Expand All @@ -109,21 +124,24 @@ find_package(Qhull)



find_package(Boost COMPONENTS thread system chrono ${boost_python} ${boost_numpy})
find_package(Boost 1.69 COMPONENTS thread system chrono ${boost_python} ${boost_numpy})

if (Boost_FOUND)
# Build with Boost
define_cpp_macro(PGL_WITH_BOOST 1)

if(DEFINED Boost_NUMPY_LIBRARY_RELEASE)
if(DEFINED Boost_NUMPY_FOUND)
define_macro(PGL_WITH_BOOST_NUMPY 1)
set(USE_BOOST_NUMPY ON)
elseif(DEFINED Boost_NUMPY${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_LIBRARY_RELEASE)
message(STATUS "Building with Boost.Numpy")
elseif(DEFINED Boost_NUMPY${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_FOUND)
define_macro(PGL_WITH_BOOST_NUMPY 1)
set(USE_BOOST_NUMPY ON)
message(STATUS "Building with Boost.Numpy")
else()
define_macro(PGL_WITH_BOOST_NUMPY 0)
set(USE_BOOST_NUMPY OFF)
message(STATUS "Building without Boost.Numpy - Library not found.")
endif()

set(USE_BOOST ON)
Expand Down
55 changes: 0 additions & 55 deletions appveyor.yml

This file was deleted.

12 changes: 6 additions & 6 deletions build-util/compile-osx.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cd build
export SDKPATH=`xcrun --show-sdk-path`
export SDKPATH=/Users/fboudon/Develop/SDK/MacOSX10.9.sdk

#export SDKPATH=/Users/fboudon/Develop/SDK/MacOSX10.13.sdk
if [ -z "${SDKPATH}" ]; then
export SDKPATH=`xcrun --show-sdk-path`
fi

cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \
Expand All @@ -14,12 +17,9 @@ cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
-LAH ..

#cmake -DCMAKE_BUILD_TYPE=Release -DBoost_INCLUDE_DIR=/opt/local/include ..
#cmake -DCMAKE_BUILD_TYPE=Release -DBoost_INCLUDE_DIR=`readlink /opt/local/include/boost`/.. ..

make
make install
cd ..
python setup.py install

{

}
2 changes: 1 addition & 1 deletion build-util/plantgl-devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- cmake
- numpy
- boost
- qt
- qt-main
- pyqt
- libpng
- zlib
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindQhull.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ if (WIN32)
endif()
else()
if (DEFINED ENV{CONDA_PREFIX})
find_library(QHULL_LIBRARY NAMES "qhull" "libqhull" PATHS $ENV{CONDA_PREFIX}/lib)
find_library(QHULL_LIBRARY NAMES "qhull" "libqhull" "qhullstatic" PATHS $ENV{CONDA_PREFIX}/lib)
else()
find_library(QHULL_LIBRARY NAMES "qhull" "libqhull" PATHS $ENV{PATH})
find_library(QHULL_LIBRARY NAMES "qhull" "libqhull" "qhullstatic" PATHS $ENV{PATH})
endif()
endif()

Expand Down
14 changes: 7 additions & 7 deletions cmake/PglWrapper.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@


function(pglwrapper_link_python libwrapname)
if(NOT APPLE OR NOT USE_CONDA)
if (Python3_FOUND)
target_link_libraries(${libwrapname} Python3::Python)
elseif (Python2_FOUND)
target_link_libraries(${libwrapname} Python2::Python)
if (Python3_FOUND)
if (APPLE)
target_link_libraries(${libwrapname} "-undefined dynamic_lookup")
else()
target_link_libraries(${libwrapname} Python3::Python)
endif()
else()
message(STATUS "Do not link with Python directly : " ${libwrapname})
elseif (Python2_FOUND)
target_link_libraries(${libwrapname} Python2::Python)
endif()
endfunction()

Expand Down
4 changes: 2 additions & 2 deletions cmake/detectPlantGL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
function(detect_plantgl_version pgldir)
message(STATUS ${pgldir}/plantgl/version.h)
file(STRINGS "${pgldir}/plantgl/version.h" PGL_VERSION
REGEX "#define[ ]+PGL_VERSION[ ]+0x[0-9]+")
string(REGEX MATCH "0x[0-9]+" PGL_VERSION ${PGL_VERSION})
REGEX "#define[ ]+PGL_VERSION[ ]+0x[0-9A-F]+")
string(REGEX MATCH "0x[0-9A-F]+" PGL_VERSION ${PGL_VERSION})
set(PGL_VERSION ${PGL_VERSION} PARENT_SCOPE)

if (PGL_VERSION)
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindQt.cmake → cmake/old.FindQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ find_package(Qt5PrintSupport CONFIG)

if (Qt5Core_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND AND Qt5Widgets_FOUND AND Qt5PrintSupport_FOUND)
# Build with Qt5
set(QT5_FOUND ON)
set(Qt6_FOUND ON)
message(STATUS "Found Qt5: Version ${Qt5Core_VERSION}")

define_cpp_macro(PGL_QT_VERSION 5)
Expand All @@ -31,7 +31,7 @@ if (Qt5Core_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND AND Qt5Widgets_FOUND
endif()

else()
set(QT5_FOUND OFF)
set(Qt6_FOUND OFF)
message(STATUS "Building without Qt - Library not found.")

define_cpp_macro(PGL_WITHOUT_QT 1)
Expand Down
9 changes: 5 additions & 4 deletions conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cd build
if [ `uname` = "Darwin" ]; then
SYSTEM_DEPENDENT_ARGS=(
"-DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT}"
# -DQHULL_LIBRARY=${CONDA_PREFIX}/lib/libqhull_r${SHLIB_EXT}"
)
export LDFLAGS="-undefined dynamic_lookup ${LDFLAGS}"

Expand Down Expand Up @@ -119,9 +120,9 @@ else
export LDD='ldd'
fi

${LDD} `${PYTHON} -c "import openalea.plantgl.math._pglmath as pm ; print(pm.__file__)"`
${LDD} `${PYTHON} -c "import openalea.plantgl.scenegraph._pglsg as pm ; print(pm.__file__)"`
${LDD} `${PYTHON} -c "import openalea.plantgl.algo._pglalgo as pm ; print(pm.__file__)"`
${LDD} `${PYTHON} -c "import openalea.plantgl.gui._pglgui as pm ; print(pm.__file__)"`
echo `${PYTHON} -c "import openalea.plantgl.math._pglmath as pm ; print(pm.__file__)"`
echo `${PYTHON} -c "import openalea.plantgl.scenegraph._pglsg as pm ; print(pm.__file__)"`
echo `${PYTHON} -c "import openalea.plantgl.algo._pglalgo as pm ; print(pm.__file__)"`
echo `${PYTHON} -c "import openalea.plantgl.gui._pglgui as pm ; print(pm.__file__)"`

echo "****** END OF BUILD PROCESS"
Loading

0 comments on commit d6e137d

Please sign in to comment.