-
Notifications
You must be signed in to change notification settings - Fork 28
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 #9 from fredboudon/upcoming
Upcoming
- Loading branch information
Showing
18 changed files
with
303 additions
and
161 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
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 @@ | ||
conda build . -c conda-forge -c fredboudon -c defaults --python=3.7 |
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
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,35 @@ | ||
|
||
|
||
function(pgllib_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) | ||
endif() | ||
else() | ||
message(STATUS "Do not link with Python directly : " ${libwrapname}) | ||
endif() | ||
|
||
# Disable Boost Auto-Link | ||
#target_compile_definitions(${libwrapname} PRIVATE BOOST_ALL_NO_LIB) | ||
|
||
#target_link_libraries(${libwrapname} Boost::system Boost::thread Boost::python ) | ||
|
||
endfunction() | ||
|
||
|
||
|
||
function(pglwrapper_install libwrapname) | ||
set_target_properties(${libwrapname} PROPERTIES PREFIX "") | ||
|
||
if (WIN32) | ||
set_target_properties(${libwrapname} PROPERTIES SUFFIX ".pyd") | ||
endif() | ||
|
||
if (APPLE) | ||
set_target_properties(${libwrapname} PROPERTIES SUFFIX ".so") | ||
endif() | ||
|
||
install(TARGETS ${libwrapname} DESTINATION "${CMAKE_SOURCE_DIR}/src/openalea/lpy") | ||
endfunction() |
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 |
---|---|---|
@@ -1,14 +1,73 @@ | ||
#!/bin/bash | ||
|
||
# Working Dir | ||
if [[ -d build ]]; then | ||
rm -rf build | ||
fi | ||
mkdir build | ||
cd build | ||
|
||
# Build | ||
cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_PREFIX_PATH=${PREFIX} -DCMAKE_BUILD_TYPE=Release .. | ||
make -j${CPU_COUNT} | ||
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 \ | ||
${SYSTEM_DEPENDENT_ARGS[@]} \ | ||
-LAH .. | ||
|
||
echo | ||
echo "****** LPY CONFIG" | ||
cat $SRC_DIR/src/openalea/lpy/__version__.py | ||
|
||
echo | ||
echo "****** COMPILE" | ||
export VERBOSE=1 | ||
make -j${CPU_COUNT} | ||
echo "****** INSTALL CXX LIB" | ||
make install | ||
|
||
# Install Python Files | ||
echo | ||
echo "****** INSTALL PYTHON LIB" | ||
cd .. | ||
$PYTHON setup.py install --prefix=${PREFIX} | ||
echo "PYTHON:" ${PYTHON} | ||
|
||
#echo "** PYTHON CALL" | ||
#export PYTHONPATH=${PREFIX}/lib/python${PY_VER}/site-packages/ | ||
${PYTHON} setup.py install --prefix=${PREFIX} | ||
|
||
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 | ||
|
||
${LDD} `${PYTHON} -c "import openalea.lpy.__lpy_kernel__ as lpy ; print(lpy.__file__)"` | ||
|
||
echo "****** END OF BUILD PROCESS" |
Oops, something went wrong.