Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if (APPLE)
endif()

## ###################################################################
## Dependencies
## Dependencies
## ###################################################################

# --- Python
Expand All @@ -59,7 +59,7 @@ if (WIN32)
set(Python3_FIND_REGISTRY LAST)
endif()

find_package (Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
find_package (Python3 3.9 EXACT COMPONENTS Interpreter Development NumPy REQUIRED)
include_directories(${Python3_INCLUDE_DIRS})

# --- Libraries
Expand Down Expand Up @@ -102,4 +102,4 @@ endif()
add_subdirectory("src/cpp")
add_subdirectory("src/wrapper")

install_share("share" "lpy")
install_share("share" "lpy")
2 changes: 1 addition & 1 deletion conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ MACOSX_SDK_VERSION: # [osx and x86_64]
- '10.12' # [osx and x86_64]
pin_run_as_build:
boost: x.x
openalea.plantgl: x.x
openalea.plantgl: x.x
7 changes: 3 additions & 4 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,20 @@ requirements:
- binutils_impl_linux-64 # [linux]
- {{ compiler('cxx') }}
- python x.x
- cmake
- cmake
- pkg-config # [linux]
- make # [unix]
- menuinst # [win]
run:
- python x.x
- setuptools
- {{ pin_compatible('openalea.plantgl', max_pin='x.x') }}
- {{ pin_compatible('openalea.plantgl', max_pin='x.x') }}
- boost x.x
- pyqt
- ipython
- qtconsole
- qtconsole-base
- jupyter_client # <6
- pyopengl
- pyqglviewer >=1.3
- jsonschema

app:
Expand Down
2 changes: 2 additions & 0 deletions conda_qt6/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
to build do:
`mamba build -c gnomon -c dtk-forge6 -c conda-forge conda_qt6/ `
16 changes: 16 additions & 0 deletions conda_qt6/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
:: Working Dir
mkdir build
cd build

:: Build
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE=%PYTHON% -LAH ..
if errorlevel 1 exit 1
nmake
if errorlevel 1 exit 1
nmake install
if errorlevel 1 exit 1

:: Install Python Files
cd ..
%PYTHON% setup.py install
if errorlevel 1 exit 1
75 changes: 75 additions & 0 deletions conda_qt6/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

if [[ -d build ]]; then
rm -rf build
fi
mkdir build
cd build

if [ `uname` = "Darwin" ]; then
SYSTEM_DEPENDENT_ARGS=(
"-DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT}"
)
export LDFLAGS="-undefined dynamic_lookup ${LDFLAGS}"
else
SYSTEM_DEPENDENT_ARGS=(
"-DOPENGL_opengl_LIBRARY=${BUILD_PREFIX}/${HOST}/sysroot/usr/lib64/libGL.so"
"-DOPENGL_glx_LIBRARY=${BUILD_PREFIX}/${HOST}/sysroot/usr/lib64/libGL.so"
)
fi

export SYSTEM_DEPENDENT_ARGS

echo
echo "****** CMAKE"
which cmake
echo 'CONDA_BUILD_SYSROOT:' $CONDA_BUILD_SYSROOT
echo
echo "****** ENV"
env

echo
echo "****** CMAKE CONFIG"

cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_PREFIX_PATH=${PREFIX} \
-DCMAKE_BUILD_TYPE=Release \
-DPython3_EXECUTABLE=${PYTHON} \
${SYSTEM_DEPENDENT_ARGS[@]} \
-LAH ..

echo
echo "****** LPY CONFIG"
cat $SRC_DIR/src/openalea/lpy/__version__.py

echo
echo "****** COMPILE"
make -j${CPU_COUNT}
echo "****** INSTALL CXX LIB"
make install

echo
echo "****** INSTALL PYTHON LIB"
cd ..
echo "PYTHON:" ${PYTHON}

#echo "** PYTHON CALL"
#export PYTHONPATH=${PREFIX}/lib/python${PY_VER}/site-packages/
${PYTHON} setup.py install --prefix=${PREFIX}

#cp -r share `${PYTHON} -c "import os, openalea.lpy as lpy ; print(os.path.dirname(lpy.__file__))"`/..

echo
echo "****** CHECK PYTHON LIB"

# To check if Python lib is not in the dependencies with conda-forge distribution.
# See https://github.com/conda-forge/boost-feedstock/issues/81
if [ `uname` = "Darwin" ]; then
export LDD='otool -L'
else
export LDD='ldd'
fi

echo `${PYTHON} -c "import openalea.lpy.__lpy_kernel__ as lpy ; print(lpy.__file__)"`

echo "****** END OF BUILD PROCESS"
21 changes: 21 additions & 0 deletions conda_qt6/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cdt_name: cos7 # [linux]
python:
- 3.9
numpy:
- 1.22
cxx_compiler:
- gxx # [linux]
- clangxx # [osx]
- vs2019 # [win]
compiler_version:
- 11 # [osx]
- 11.2.0 # [linux]
cxx_compiler_version:
- 11 # [osx]
- 11.2.0 # [linux]
MACOSX_DEPLOYMENT_TARGET: # [osx]
- '10.14' # [osx]
MACOSX_SDK_VERSION: # [osx and x86_64]
- '10.14' # [osx and x86_64]
CONDA_BUILD_SYSROOT: # [osx]
- /Users/ci/Desktop/MacOSX-SDKs/MacOSX10.12.sdk # [osx]
Binary file added conda_qt6/icon_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions conda_qt6/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#{% set version = "2.7.2" %}
{% set data = load_setup_py_data() %}

package:
name: openalea.lpy
version: {{ data.get('version') }}

source:
path: ..

about:
home: https://github.com/openalea/lpy
license: Cecill-C
summary: L-Py is a simulation software that mixes L-systems construction with the Python high-level modeling language.

build:
preserve_egg_dir: True
number: 2
requirements:
host:
- python
- setuptools
- openalea.plantgl>=3.20
- qt6-main=6.5
build:
- {{ compiler('cxx') }}
- cmake >=3.20.0
- pkg-config # [linux]
- make # [unix]
- menuinst # [win]
run:
- python
- setuptools
- {{ pin_compatible('numpy', max_pin='x.x') }}
- {{ pin_compatible('openalea.plantgl', max_pin='x.x') }}
- {{ pin_compatible('boost', max_pin='x.x.x') }}
- pyside6
- ipython
- qtconsole-base
- jupyter_client # <6
- pyopengl
- jsonschema

app:
entry: lpy
summary: Plant simulation software
icon: icon_64x64.png

test:
requires:
- nose
imports:
- openalea.lpy
source_files:
- test/
- share/
commands:
- nosetests -v -I test_predecessor_at_scale.py -I test_ui.py [unix]
- nosetests -v -I test_predecessor_at_scale.py -I test_ui.py -I test_axialtree.py -I test_successor_at_scale.py [win]
8 changes: 7 additions & 1 deletion src/openalea/lpy/gui/lpyview3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
ParentClass = QGLViewer
hasPyQGLViewer = True
except ImportError as e:
ParentClass = qt.QtWidgets.QOpenGLWidget
try:
from openalea.plantgl.gui.qt.QtWidgets import QOpenGLWidget
ParentClass = QOpenGLWidget
pass
except:
from openalea.plantgl.gui.qt.QtOpenGL import QOpenGLWidget
ParentClass = QOpenGLWidget
print('Missing PyQGLViewer !!!!!! Unstable Lpy !!!!!!!!!')
hasPyQGLViewer = False

Expand Down
4 changes: 2 additions & 2 deletions src/openalea/lpy/gui/objectpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
NewOpenGLClass = True
pass
except:
from openalea.plantgl.gui.qt.QtOpenGL import QGLWidget
QGLParentClass = QGLWidget
from openalea.plantgl.gui.qt.QtOpenGL import QOpenGLWidget
QGLParentClass = QOpenGLWidget
NewOpenGLClass = False


Expand Down