Commit 34c27fd2 authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: fix setup_python (add check for numpy)

parent 00f279f3
......@@ -151,7 +151,6 @@ include(install_translation_files)
include(install_cmake_files)
include(install_mvd_files)
include(install_qtdev_files)
include(install_script_files)
include(install_vstudio_files)
include(installer_files)
include(create_package)
......@@ -211,8 +210,6 @@ install_mvd_files()
install_qtdev_files()
install_script_files()
install_vstudio_files()
installer_files()
......
......@@ -19,10 +19,8 @@
# limitations under the License.
#
@CODE_FOR_PYTHON_SETUP_SH@
if [ ! -f "$OTB_PYTHON_EXE" ] ; then
OTB_PYTHON_EXE=$(which python)
OTB_PYTHON_EXE=$(which python2.7)
fi
python_major_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[0])")
......@@ -61,9 +59,18 @@ do
done
if [ "$found_python_lib" -eq "1" ]; then
numpy_import_result="$($OTB_PYTHON_EXE -c 'import numpyx' 2>&1)"
if [ ! -z "$numpy_import_result" ]; then
printf %s\\n "*****Error occurred during installation******"
printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )"
printf %s\\n "numpy not installed with '$OTB_PYTHON_EXE'"
printf %s\\n "Check failed with result:"
printf %s\\n "$numpy_import_result"
exit 1;
fi;
printf %s\\n "OTB python bindings will be configured for $OTB_PYTHON_EXE ( version: $python_version )"
printf %s\\n "Found python library: $python_lib_file_path"
ln -sf "$python_lib_file_path" "OUT_DIR/lib/$python_INSTALLED_SONAME"
#ln -sf "$python_lib_file_path" "OUT_DIR/lib/$python_INSTALLED_SONAME"
else
printf %s\\n "*****Error occurred during installation******"
printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )"
......@@ -71,5 +78,5 @@ else
printf %s\\n "We had searched following directories $python_lib_dirs"
printf %s\\n "If you don't have python-dev package installed, install it and make a symlink"
printf %s\\n "If you don't have python headers and so installed on a custom location, then make a symlink"
printf %s\\n "eg: ln -s /usr/lib/x86_64-linux-gnu/$python_INSTSONAME OUT_DIR/lib/$python_INSTALLED_SONAME"
printf %s\\n "eg: ln -s /usr/lib/x86_64-linux-gnu/$python_INSTSONAME OUT_DIR/lib/$python_INSTSONAME"
fi
function(install_script_files)
#For GNU/Linux & Mac OSX, we write them in the *pkgsetup.in
if(WIN32)
install(
PROGRAMS
Files/otbenv.bat
Files/otbenv.bash
DESTINATION ${PKG_STAGE_DIR}
)
else()
configure_file(Files/setup_python.sh.in setup_python.sh @ONLY)
install(PROGRAMS
${CMAKE_BINARY_DIR}/setup_python.sh
Files/otbenv.profile
DESTINATION "${PKG_STAGE_DIR}")
endif()
# We also need wrapper script to start mapla & monteverdi
if(NOT HAVE_MVD)
message(FATAL_ERROR "not have mvd")
endif()
if(HAVE_MVD)
install(PROGRAMS
Files/mapla${SCRIPT_EXT}
Files/monteverdi${SCRIPT_EXT}
DESTINATION "${PKG_STAGE_DIR}"
)
endif()
set(my_file_ext "")
if(WIN32)
set(my_file_ext ".bat")
endif()
install(PROGRAMS
Files/selftester${SCRIPT_EXT}
"${SUPERBUILD_INSTALL_DIR}/bin/otbcli${my_file_ext}"
"${SUPERBUILD_INSTALL_DIR}/bin/otbgui${my_file_ext}"
DESTINATION ${PKG_STAGE_DIR}/bin)
endfunction()
......@@ -26,13 +26,47 @@ macro(installer_files)
endif()
if(UNIX)
install( PROGRAMS "${CMAKE_BINARY_DIR}/pkgsetup" DESTINATION ${PKG_STAGE_DIR})
install( PROGRAMS "${CMAKE_BINARY_DIR}/make_symlinks" DESTINATION ${PKG_STAGE_DIR})
install( PROGRAMS
${CMAKE_BINARY_DIR}/pkgsetup
${CMAKE_BINARY_DIR}/make_symlinks
Files/setup_python.sh
Files/otbenv.profile
DESTINATION ${PKG_STAGE_DIR}
)
endif()
set(my_file_ext "")
#For GNU/Linux & Mac OSX, we write them in the *pkgsetup.in
if(WIN32)
set(my_file_ext ".bat")
install( PROGRAMS
Files/otbenv.bat
Files/otbenv.bash
DESTINATION ${PKG_STAGE_DIR}
)
endif()
# We also need wrapper script to start mapla & monteverdi
if(NOT HAVE_MVD)
message(FATAL_ERROR "not have mvd")
endif()
if(HAVE_MVD)
install(PROGRAMS
Files/mapla${SCRIPT_EXT}
Files/monteverdi${SCRIPT_EXT}
DESTINATION "${PKG_STAGE_DIR}"
)
endif()
install(PROGRAMS
Files/selftester${SCRIPT_EXT}
"${SUPERBUILD_INSTALL_DIR}/bin/otbcli${my_file_ext}"
"${SUPERBUILD_INSTALL_DIR}/bin/otbgui${my_file_ext}"
DESTINATION ${PKG_STAGE_DIR}/bin)
if(LINUX)
install( PROGRAMS "${PATCHELF_PROGRAM}" DESTINATION ${PKG_STAGE_DIR})
install( PROGRAMS "${PATCHELF_PROGRAM}"
DESTINATION ${PKG_STAGE_DIR})
endif()
file(READ "${OTB_BINARY_DIR}/install_manifest.txt" mfile_lines)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment