From 25b2e2c348c04c57535a0f154b7f262357836fa6 Mon Sep 17 00:00:00 2001 From: Pere Mato <pere.mato@cern.ch> Date: Fri, 21 Feb 2020 16:57:03 +0100 Subject: [PATCH] Added Jupyterlab and itkwidgets with dependencies --- cmake/scripts/create_lcg_view_setup_csh.in | 5 + cmake/scripts/create_lcg_view_setup_sh.in | 4 + cmake/toolchain/heptools-dev-base.cmake | 17 +- documentation/packages.json | 41 ++++ externals/CMakeLists.txt | 9 + pyexternals/CMakeLists.txt | 228 ++++++++++++++++++++- 6 files changed, 301 insertions(+), 3 deletions(-) diff --git a/cmake/scripts/create_lcg_view_setup_csh.in b/cmake/scripts/create_lcg_view_setup_csh.in index 3a3459de8e..ea160a9baa 100644 --- a/cmake/scripts/create_lcg_view_setup_csh.in +++ b/cmake/scripts/create_lcg_view_setup_csh.in @@ -220,6 +220,11 @@ if ( -e $thisdir/bin/jupyter ) then endif endif +#---then JupyterLab +if ( -d $thisdir/share/jupyter/lab ) then + setenv JUPYTERLAB_DIR $thisdir/share/jupyter/lab +endif + #---then R if ( -e $thisdir/bin/R ) then unsetenv R_HOME diff --git a/cmake/scripts/create_lcg_view_setup_sh.in b/cmake/scripts/create_lcg_view_setup_sh.in index 61a83bdc71..44a9836220 100644 --- a/cmake/scripts/create_lcg_view_setup_sh.in +++ b/cmake/scripts/create_lcg_view_setup_sh.in @@ -190,6 +190,10 @@ if [ -x $thisdir/bin/jupyter ]; then JUPYTER_PATH=${thisdir}/share/jupyter:$JUPYTER_PATH; export JUPYTER_PATH fi fi +#---then JupyterLab +if [ -d $thisdir/share/jupyter/lab ]; then + JUPYTERLAB_DIR=$thisdir/share/jupyter/lab; export JUPYTERLAB_DIR +fi #---then R if [ -x $thisdir/bin/R ]; then diff --git a/cmake/toolchain/heptools-dev-base.cmake b/cmake/toolchain/heptools-dev-base.cmake index 9eaf994ed6..4cbe5b1ae3 100644 --- a/cmake/toolchain/heptools-dev-base.cmake +++ b/cmake/toolchain/heptools-dev-base.cmake @@ -30,7 +30,11 @@ if(LCG_PYTHON_VERSION EQUAL 3) LCG_external_package(redis 3.2.1 ) LCG_external_package(typed_ast 1.4.0 ) LCG_external_package(typeguard 2.7.0 ) + LCG_external_package(ipydatawidgets 4.0.1 ) + LCG_external_package(itkwidgets 0.25.3 ) LCG_external_package(jupyter_console 6.0.0 ) + LCG_external_package(jupyterlab 1.2.6 ) + LCG_external_package(jupyterlab_server 1.0.6 ) LCG_external_package(scikitlearn 0.21.2 ) LCG_external_package(scipy 1.3.0 ) LCG_External_package(more_itertools 7.0.0 ) @@ -145,6 +149,7 @@ LCG_external_package(cmaketools 1.8 LCG_external_package(cmmnbuild 2.1.3 ) LCG_external_package(cmt v1r20p20090520 ) LCG_external_package(coin3d 3.1.3p2 ) +LCG_external_package(colorcet 2.0.2 ) LCG_external_package(configparser 3.7.4 ) LCG_external_package(CouchDB 1.2 ) LCG_external_package(coverage 4.5.3 ) @@ -259,10 +264,15 @@ LCG_external_package(iminuit 1.3.6 LCG_external_package(importlib_metadata 0.18 ) LCG_external_package(importlib_resources 1.0.2 ) LCG_external_package(ipaddress 1.0.22 ) +LCG_external_package(ipympl 0.4.1 ) LCG_external_package(ipyparallel 6.2.4 ) LCG_external_package(ipython_genutils 0.2.0 ) LCG_external_package(ipywidgets 7.4.2 ) LCG_external_package(isort 4.3.20 ) +LCG_external_package(itk_core 5.0.1 ) +LCG_external_package(itk_io 5.0.1 ) +LCG_external_package(itk_filtering 5.0.1 ) +LCG_external_package(itk_meshtopolydata 0.5.1 ) LCG_external_package(java 8u222 ) LCG_external_package(jedi 0.13.3 ) LCG_external_package(jemalloc 5.2.1 ) @@ -274,6 +284,7 @@ LCG_external_package(jsonc 0.12 LCG_external_package(jsoncpp 1.8.4 ) LCG_external_package(jsonmcpp 3.6.1 ) LCG_external_package(jsonschema 3.0.1 ) +LCG_external_package(json5 0.9.1 ) LCG_external_package(jupyter 1.0.0 ) LCG_external_package(jupyter_client 5.2.4 ) LCG_external_package(jupyter_contrib_core 0.3.3 ) @@ -341,6 +352,7 @@ LCG_external_package(nbconvert 5.5.0 LCG_external_package(nbformat 4.4.0 ) LCG_external_package(netcdfc 4.7.0 ) LCG_external_package(ninja 1.9.0 ) +LCG_external_package(node.js 12.16.1 ) LCG_external_package(nose 1.3.7 ) LCG_external_package(notebook 5.7.8 ) LCG_external_package(numexpr 2.6.9 ) @@ -371,6 +383,7 @@ LCG_external_package(pandocfilters 1.4.2 if(NOT ${LCG_OS} MATCHES mac) LCG_external_package(pango 1.40.13 ) endif() +LCG_external_package(param 1.9.3 ) LCG_external_package(parso 0.4.0 ) LCG_external_package(pathlib2 2.3.3 ) LCG_external_package(pathos 0.2.3 ) @@ -414,6 +427,7 @@ LCG_external_package(pyasn1_modules 0.2.5 LCG_external_package(pycairo 1.18.1 ) LCG_external_package(pycodestyle 2.5.0 ) LCG_external_package(pycparser 2.19 ) +LCG_external_package(pyct 0.4.6 ) LCG_external_package(pydot 1.4.1 ) LCG_external_package(pydot_ng 2.0.0 ) LCG_external_package(pyflakes 2.1.1 ) @@ -507,6 +521,7 @@ if(NOT ${LCG_OS}${LCG_OSVERS} STREQUAL slc6) endif() LCG_external_package(tornado 5.1.1 ) LCG_external_package(traitlets 4.3.2 ) +LCG_external_package(traittypes 0.2.1 ) LCG_external_package(tricktrack 1.0.8 ) LCG_external_package(tzlocal 2.0.0 ) LCG_external_package(umesimd 0.8.1 ) @@ -546,7 +561,7 @@ LCG_external_package(zeromq 4.3.2 LCG_external_package(zict 0.1.4 ) LCG_external_package(zipp 0.5.1 ) LCG_external_package(zlib 1.2.11 ) - +LCG_external_package(zstandard 0.13.0 ) LCG_external_package(OWSLib 0.17.1 ) LCG_external_package(pyproj 2.1.3 ) diff --git a/documentation/packages.json b/documentation/packages.json index 9866317184..cb918e1026 100644 --- a/documentation/packages.json +++ b/documentation/packages.json @@ -4582,6 +4582,16 @@ "license": "MIT", "name": "jsonschema" }, + { + "category": "Tool", + "contacts": [], + "description": "A Python implementation of the JSON5 data format", + "fullname": "json5", + "homepage": "https://github.com/nlohmann/json", + "language": "Python", + "license": "Apache", + "name": "json5" + }, { "category": "Other", "contacts": [ @@ -4747,6 +4757,27 @@ "license": "BSD 3-clause", "name": "jupyter_nbextensions_configurator" }, + { + "category": "IDE", + "contacts": [], + "description": "The JupyterLab notebook server extension.", + "fullname": "JupyterLab", + "homepage": "http://jupyter.org/", + "language": "Python", + "license": "BSD License", + "name": "jupyterlab" + }, + { + "category": "Other", + "contacts": [], + "description": "A set of server components for JupyterLab and JupyterLab like applications", + "fullname": "JupyterLab Server", + "homepage": "https://github.com/jupyterlab/jupyterlab_server", + "language": "Python", + "license": "BSD License", + "name": "jupyterlab_server" + }, + { "category": "Machine Learning", "contacts": [ @@ -5476,6 +5507,16 @@ "license": "GPL", "name": "njet" }, + { + "category": "Tool", + "contacts": [], + "description": "JavaScript runtime built on Chrome's V8 JavaScript engine", + "fullname": "nose", + "homepage": "https://nodejs.org", + "language": "C++", + "license": "node.js license", + "name": "node.js" + }, { "category": "Tool", "contacts": [ diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 1fefd451df..286a4f5e6d 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -2609,3 +2609,12 @@ LCGPackage_Add( -DBoost_NO_BOOST_CMAKE=ON DEPENDS pkg_config Boost bison flex ) + +#---node.js---------------------------------------------------------------------------------------------------- +LCGPackage_Add( + node.js + URL ${GenURL}/node-v<VERSION>.tar.gz + CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python +) diff --git a/pyexternals/CMakeLists.txt b/pyexternals/CMakeLists.txt index 1db83eea86..3d53da9b4f 100644 --- a/pyexternals/CMakeLists.txt +++ b/pyexternals/CMakeLists.txt @@ -2145,8 +2145,7 @@ LCGPackage_Add( DEPENDS Python setuptools ipython widgetsnbextension traitlets ipykernel nbformat ) - -#---Jupyter------------------------------------------------------------------------------------------------------------- +#---jupyter------------------------------------------------------------------------------------------------------------- LCGPackage_Add( jupyter URL ${GenURL}/jupyter-${jupyter_native_version}.tar.gz @@ -2161,6 +2160,45 @@ LCGPackage_Add( jupyter_client jupyter_console jupyter_core notebook qtconsole widgetsnbextension entrypoints ) +#---json5------------------------------------------------------------------------------------------------------------- +LCGPackage_Add( + json5 + URL ${GenURL}/json5-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools +) + +#---jupyterlab_server------------------------------------------------------------------------------------------------------------- +LCGPackage_Add( + jupyterlab_server + URL ${GenURL}/jupyterlab_server-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS jupyter json5 +) + +#---jupyterlab------------------------------------------------------------------------------------------------------------- +LCGPackage_Add( + jupyterlab + URL ${GenURL}/jupyterlab-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS jupyterlab_server +) + #---psutil-------------------------------------------------------------------------------------------------------------- LCGPackage_Add( psutil @@ -3964,3 +4002,189 @@ LCGPackage_Add( BUILD_IN_SOURCE 1 DEPENDS pandas uncertainties ) + +#---param------------------------------------------------------------------------------- +LCGPackage_Add( + param + URL ${GenURL}/param-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools +) + +#---pyct------------------------------------------------------------------------------- +LCGPackage_Add( + pyct + URL ${GenURL}/pyct-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools param +) + +#---colorcet------------------------------------------------------------------------------- +LCGPackage_Add( + colorcet + URL ${GenURL}/colorcet-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools pyct +) + +#---traittypes------------------------------------------------------------------------------- +LCGPackage_Add( + traittypes + URL ${GenURL}/traittypes-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools +) + +#---ipydatawidgets------------------------------------------------------------------------------------------------------ +LCGPackage_Add( + ipydatawidgets + URL ${GenURL}/ipydatawidgets-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools traittypes +) + +#---ipympl------------------------------------------------------------------------------------------------------ +LCGPackage_Add( + ipympl + URL ${GenURL}/ipympl-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools +) + +#---zstandard------------------------------------------------------------------------------------------------------ +LCGPackage_Add( + zstandard + URL ${GenURL}/zstandard-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS Python setuptools +) + +#---itk------------------------------------------------------------------------------------------------------------ +LCGPackage_Add( + itk + URL ${GenURL}/InsightToolkit-<VERSION>.tar.gz + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DITK_BUILD_DEFAULT_MODULES=OFF + -DITK_WRAP_PYTHON=ON + -DITKGroup_IO=ON + -DBUILD_EXAMPLES=OFF + DEPENDS pkg_config Python numpy +) + +#---itk_core-------------------------------------------------------------------------------------------------------- +string(REPLACE "." "" pyversion cp${Python_config_version_twodigit}) +if(LCG_TARGET MATCHES "mac") + set(pyarch macosx_10_9_x86_64) +else() + set(pyarch manylinux1_x86_64) +endif() + +LCGPackage_Add( + itk_core + DOWNLOAD_COMMAND <VOID> + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} ${pip_home}/bin/pip install ${PySetupOptions} + ${GenURL}/itk_core-<VERSION>-${pyversion}-${pyversion}m-${pyarch}.whl + DEPENDS Python pip +) + +#---itk_io-------------------------------------------------------------------------------------------------------- +LCGPackage_Add( + itk_io + DOWNLOAD_COMMAND <VOID> + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} ${pip_home}/bin/pip install ${PySetupOptions} + ${GenURL}/itk_io-<VERSION>-${pyversion}-${pyversion}m-${pyarch}.whl + DEPENDS Python pip +) + +#---itk_filtering-------------------------------------------------------------------------------------------------------- +LCGPackage_Add( + itk_filtering + DOWNLOAD_COMMAND <VOID> + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} ${pip_home}/bin/pip install ${PySetupOptions} + ${GenURL}/itk_filtering-<VERSION>-${pyversion}-${pyversion}m-${pyarch}.whl + DEPENDS Python pip +) + +#---itk_meshtopolydata-------------------------------------------------------------------------------------------------------- +LCGPackage_Add( + itk_meshtopolydata + DOWNLOAD_COMMAND <VOID> + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} ${pip_home}/bin/pip install ${PySetupOptions} + ${GenURL}/itk_meshtopolydata-<VERSION>-${pyversion}-${pyversion}m-${pyarch}.whl + DEPENDS Python pip +) + +#---itkwidgets------------------------------------------------------------------------------------------------------ +LCGPackage_Add( + itkwidgets + URL ${GenURL}/itkwidgets-<VERSION>.tar.gz + CONFIGURE_COMMAND <VOID> + BUILD_COMMAND <VOID> + INSTALL_COMMAND ${MakeSitePackagesDir} + COMMAND ${PYTHON} setup.py install ${PySetupOptions} + COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR> + BUILD_IN_SOURCE 1 + DEPENDS colorcet itk_core itk_io itk_filtering itk_meshtopolydata ipydatawidgets ipywidgets ipympl zstandard matplotlib numpy scipy six +) + +#colorcet +#itk-core>=5.0.1 +#itk-filtering>=5.0.1 +#itk-meshtopolydata>=0.5.0 +#ipydatawidgets>=3.2.0 +#ipywidgets>=7.5.1 +#ipympl>=0.4.1 +#matplotlib +#numpy +#scipy +#six +#zstandard \ No newline at end of file -- GitLab