diff --git a/create_JupyterLab_kernel.sh b/create_JupyterLab_kernel.sh index 8c0d02062b46bc176d5cd42ed3f4996505d42b1b..851021309a3fb499ae6d85e938a400cf8a073288 100644 --- a/create_JupyterLab_kernel.sh +++ b/create_JupyterLab_kernel.sh @@ -12,67 +12,68 @@ EBRAINS_SPACK_ENV=$2 RELEASE_NAME=$3 LAB_KERNEL_ROOT=$4 -# enable modules -source /usr/share/modules/init/sh - -# capture the empty env -cd ~ -env >> /tmp/before.txt - -# load spack -export SPACK_USER_CACHE_PATH=$INSTALLATION_ROOT/spack/.spack -export SPACK_USER_CONFIG_PATH=$INSTALLATION_ROOT/spack/.spack -source $INSTALLATION_ROOT/spack/share/spack/setup-env.sh -# no need to activate as the env is already activated in the context it is used -# spack env activate $EBRAINS_SPACK_ENV - -# load modules -module use $INSTALLATION_ROOT/spack/share/spack/modules/linux-ubuntu20.04-x86_64/ -source $INSTALLATION_ROOT/spack/var/spack/environments/$EBRAINS_SPACK_ENV/loads -# also add user's .local python3.8 packages to allow package installation at runtime by the user using pip -export PYTHONPATH=$PYTHONPATH:/opt/app-root/src/.local/lib/python3.8/site-packages -export PATH=$PATH:/opt/app-root/src/.local/bin -# and python modules installed in the base docker Collab image -export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/dist-packages - -# capture the env after spack activation -cd ~ -env >> /tmp/after.txt - # kernel name is lowercase release name KERNEL_NAME=$(echo "$RELEASE_NAME" | tr '[:upper:]' '[:lower:]') # kernel dir is a directory inside LAB_KERNEL_ROOT named after the kernel KERNEL_PATH=$LAB_KERNEL_ROOT/$KERNEL_NAME -# prepare the env file required for the JupyterLab kernel +# prepare the base env.sh script required for the JupyterLab kernels: mkdir -p $KERNEL_PATH/bin -# start of env creation +# (1) create env.sh bash script cat <<EOF > $KERNEL_PATH/bin/env.sh #!/usr/bin/env bash set -euxo pipefail EOF -# append the necessary env variables for spack env and tools -diff /tmp/before.txt /tmp/after.txt|grep ">"|cut -c 3- |awk '$0="export "$0' >> $KERNEL_PATH/bin/env.sh +# (2) append the necessary env variables for spack env and tools +cat $INSTALLATION_ROOT/spack/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh >> $KERNEL_PATH/bin/env.sh -# end of env creation -cat <<EOF >>$KERNEL_PATH/bin/env.sh -python -m ipykernel_launcher -f \$@ +# (3) also add the user's .local locations to allow package installation at runtime, +# and the location of python modules installed in the base docker Collab image +cat <<EOF >> $KERNEL_PATH/bin/env.sh +export PATH=\$PATH:/opt/app-root/src/.local/bin +export PYTHONPATH=\$PYTHONPATH:/opt/app-root/src/.local/lib/python3.8/site-packages:/usr/local/lib/python3.8/dist-packages +export R_LIBS_USER=/opt/app-root/src/.local/lib/R/site-library +mkdir -p \$R_LIBS_USER +export R_LIBS=\$R_LIBS_USER:\$R_LIBS EOF -chmod +x $KERNEL_PATH/bin/env.sh -# create the new kernel's configuration file +# (4) create startup script for python kernel +cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_python.sh +echo "python -m ipykernel_launcher -f \$@" >> $KERNEL_PATH/bin/env_python.sh +chmod +x $KERNEL_PATH/bin/env_python.sh + +# ... and the new kernel's configuration file mkdir -p $KERNEL_PATH/$KERNEL_NAME -cat <<EOF >$KERNEL_PATH/$KERNEL_NAME/kernel.json +cat <<EOF > $KERNEL_PATH/$KERNEL_NAME/kernel.json { - "argv": ["$KERNEL_PATH/bin/env.sh", "{connection_file}", "--profile=default"], + "argv": ["$KERNEL_PATH/bin/env_python.sh", "{connection_file}", "--profile=default"], "display_name": "$RELEASE_NAME", - "name": "$KERNEL_NAME", "language": "python", "env": { "LAB_KERNEL_NAME": "$RELEASE_NAME", "LAB_KERNEL_RELEASE_DATE": "$(date +"%Y-%m-%d")" } } EOF -# add EBRAINS logo to kernel -cp $LAB_KERNEL_ROOT/../logo/logo-64x64.png $KERNEL_PATH/$KERNEL_NAME/ +# ... and add EBRAINS logo to kernel +cp $LAB_KERNEL_ROOT/../etc/logo-64x64.png $KERNEL_PATH/$KERNEL_NAME/ + +# (5) create startup script for R kernel +cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_r.sh +echo "R --slave -e \"IRkernel::main()\" --args \$@" >> $KERNEL_PATH/bin/env_r.sh +chmod +x $KERNEL_PATH/bin/env_r.sh + +# ... and the new R kernel's configuration file +mkdir -p $KERNEL_PATH/${KERNEL_NAME}-R +cat <<EOF > $KERNEL_PATH/${KERNEL_NAME}-R/kernel.json +{ + "argv": ["$KERNEL_PATH/bin/env_r.sh", "{connection_file}"], + "display_name": "R-$RELEASE_NAME", + "language": "R", + "env": { "LAB_KERNEL_NAME": "R-$RELEASE_NAME", "LAB_KERNEL_RELEASE_DATE": "$(date +"%Y-%m-%d")" } +} +EOF + +# ... and add EBRAINS logo and kernel.js to kernel +cp $LAB_KERNEL_ROOT/../etc/logo-64x64.png $KERNEL_PATH/${KERNEL_NAME}-R/ +cp $LAB_KERNEL_ROOT/../etc/kernel.js $KERNEL_PATH/${KERNEL_NAME}-R/ diff --git a/install_spack_env.sh b/install_spack_env.sh index 5c91bb32b05532d65328494e7cb30b8729069436..081b04d6496e7b3e2ddffd263aa0615585277098 100644 --- a/install_spack_env.sh +++ b/install_spack_env.sh @@ -16,17 +16,17 @@ EBRAINS_SPACK_ENV=$4 export SPACK_USER_CACHE_PATH=$INSTALLATION_ROOT/spack/.spack export SPACK_USER_CONFIG_PATH=$INSTALLATION_ROOT/spack/.spack -# initial setup: if spack dir doesn't already exist, clone it and install gcc and python +# initial setup: clone spack if spack dir doesn't already exist and activate if [ ! -d $INSTALLATION_ROOT/spack ] then - # clone spack repo, import packages.yaml config file and activate git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch $SPACK_VERSION https://github.com/spack/spack $INSTALLATION_ROOT/spack fi cp $EBRAINS_REPO/packages.yaml $INSTALLATION_ROOT/spack/etc/spack/packages.yaml source $INSTALLATION_ROOT/spack/share/spack/setup-env.sh + # install platform compiler and python (extract versions from packages.yaml) EBRAINS_SPACK_COMPILER=$(grep 'compiler' $EBRAINS_REPO/packages.yaml | awk -F'[][]' '{ print $2 }') -EBRAINS_SPACK_PYTHON=python@$(grep -A1 'python' $EBRAINS_REPO/packages.yaml | tail -n1 | awk -F'[][]' '{ print $2 }') +EBRAINS_SPACK_PYTHON=python@$(grep -A1 'python:$' $EBRAINS_REPO/packages.yaml | tail -n1 | awk -F'[][]' '{ print $2 }') spack compiler find spack install $EBRAINS_SPACK_COMPILER spack load $EBRAINS_SPACK_COMPILER @@ -55,9 +55,16 @@ rm $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.lock || echo "No # install the environment, use 2 jobs to reduce the amount of required RAM spack install -y -j2 --fresh --no-check-signature --test root -# create modules files with spack -spack module tcl refresh -y # rebuild spack's database spack reindex -# create loads script that when sourced activates and loads the installed spack environment -spack env loads -r + +# create load script that when sourced activates and loads the installed spack environment, using views +# this needs deactivating the environment first: +spack env deactivate +unset SPACK_LD_LIBRARY_PATH +spack env activate --sh $EBRAINS_SPACK_ENV > $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh + +# create modules files with spack +# spack module tcl refresh -y +# create loads script that when sourced activates and loads the installed spack environment, using modules +# spack env loads -r diff --git a/packages.yaml b/packages.yaml index 54619e5b7025c457912075ed202c4022b9d27ab0..e7b9ae9064a57c1a5c8bc8537bbb2a07f4286719 100644 --- a/packages.yaml +++ b/packages.yaml @@ -4,6 +4,9 @@ packages: compiler: [gcc@10.3.0] python: version: [3.8.11] + r: + version: [4.1.3] + variants: [+X] py-torch: version: [1.11.0] variants: [~cuda~rocm~valgrind~mkldnn~mpi~gloo+tensorpipe~onnx_ml] diff --git a/packages/nest/package.py b/packages/nest/package.py index 64bf7045589c3f408aa08ec46e038bc2ea1569c4..e0a59d4c89b22347fcc3519203807046d56df9a2 100644 --- a/packages/nest/package.py +++ b/packages/nest/package.py @@ -27,7 +27,7 @@ class Nest(CMakePackage): git = "https://github.com/nest/nest-simulator.git" version('master', branch='master') - version('3.4_rc1',sha256='62558bf545abd5a54e92abd4ce8afaa58b45fe1065e6f47a7da723cd85a7e013') + version('3.4_rc2',sha256='037012200489ad4f800ed5dc6279917e89c831d101a4b852b5c42278923566a3') version('3.3', sha256='179462b966cc61f5785d2fee770bc36f86745598ace9cd97dd620622b62043ed') version('3.2', sha256='583d5725882ad5e8fd4fc7ffab425da97cbbb91fadbc327e940c184e8892b958') patch('nest-simulator-3.2-p1-VersionNumber.patch', when='@3.2') diff --git a/packages/neuron/package.py b/packages/neuron/package.py index dbb9b90b799c06c4bdd773900a042c271f190717..1bc7d7b2d40d3dcdfcbc0fb02fa27a06cbdb3b62 100644 --- a/packages/neuron/package.py +++ b/packages/neuron/package.py @@ -1,13 +1,9 @@ -# this package was adapted from the spack v0.18.1 upstream to fix an issue with -# setting the PYTHONPATH of dependents for installation time tests -# also version 8.1.0 has been added - -# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack import * +from spack.package import * class Neuron(CMakePackage): @@ -20,41 +16,41 @@ class Neuron(CMakePackage): """ homepage = "https://www.neuron.yale.edu/" - url = "https://neuron.yale.edu/ftp/neuron/versions/v7.7/nrn-7.7.tar.gz" - git = "https://github.com/neuronsimulator/nrn" - maintainers = ['pramodk', 'nrnhines', 'iomaganaris', 'alexsavulescu'] + url = "https://github.com/neuronsimulator/nrn/releases/download/8.2.2/full-src-package-8.2.2.tar.gz" + git = "https://github.com/neuronsimulator/nrn" - version('develop', branch='master', submodules='True') - version("8.1.0", tag="8.0.0", submodules='True') - version("8.0.0", tag="8.0.0", submodules='True') - version("7.8.2", tag="7.8.2", submodules='True') - version("7.8.1", tag="7.8.1", submodules='True') + version("develop", branch="master", submodules="True") + version("8.2.2", tag="8.2.2", submodules="True") + version("8.1.0", tag="8.1.0", submodules="True") + version("8.0.0", tag="8.0.0", submodules="True") + version("7.8.2", tag="7.8.2", submodules="True") + version("7.8.1", tag="7.8.1", submodules="True") - variant("coreneuron", default=False, description="Enable CoreNEURON as submodule") + variant("coreneuron", default=True, description="Enable CoreNEURON as submodule") variant("cross-compile", default=False, description="Build for cross-compile environment") - variant("interviews", default=False, description="Enable GUI with INTERVIEWS") - variant("legacy-unit", default=False, description="Enable legacy units") - variant("mpi", default=True, description="Enable MPI parallelism") - variant("python", default=True, description="Enable python") - variant("rx3d", default=False, description="Enable cython translated 3-d rxd") - variant("tests", default=False, description="Enable unit tests") - variant("caliper", default=False, description="Add LLNL/Caliper support") - - depends_on("bison", type="build") - depends_on("flex", type="build") + variant("interviews", default=False, description="Enable GUI with INTERVIEWS") + variant("legacy-unit", default=False, description="Enable legacy units") + variant("mpi", default=True, description="Enable MPI parallelism") + variant("python", default=True, description="Enable python") + variant("rx3d", default=False, description="Enable cython translated 3-d rxd") + variant("tests", default=False, description="Enable unit tests") + variant("caliper", default=False, description="Add LLNL/Caliper support") + + depends_on("bison", type="build") + depends_on("flex", type="build") depends_on("py-cython", when="+rx3d", type="build") depends_on("gettext") - depends_on("mpi", when="+mpi") + depends_on("mpi", when="+mpi") depends_on("ncurses") depends_on("python@2.7:", when="+python") - depends_on("py-pytest", when="+python+tests") - depends_on("py-mpi4py", when="+mpi+python+tests") + depends_on("py-pytest", when="+python+tests") + depends_on("py-mpi4py", when="+mpi+python+tests") depends_on("readline") - depends_on("caliper", when="+caliper") - depends_on("py-numpy", type='run') + depends_on("caliper", when="+caliper") + depends_on("py-numpy", type="run") - conflicts("+rx3d", when="~python") + conflicts("+rx3d", when="~python") patch("patch-v782-git-cmake-avx512.patch", when="@7.8.2") @@ -66,32 +62,36 @@ class Neuron(CMakePackage): cmake_name = spec_options[1:].upper().replace("-", "_") return "-DNRN_ENABLE_" + cmake_name + ":BOOL=" + value - args = [cmake_options(variant) for variant in ["+coreneuron", - "+interviews", - "+mpi", - "+python", - "+rx3d", - "+coreneuron", - "+tests"]] + args = [ + cmake_options(variant) + for variant in [ + "+coreneuron", + "+interviews", + "+mpi", + "+python", + "+rx3d", + "+coreneuron", + "+tests", + ] + ] args.append("-DNRN_ENABLE_BINARY_SPECIAL=ON") - if "~mpi" in spec and '+coreneuron' in spec: + if "~mpi" in spec and "+coreneuron" in spec: args.append("-DCORENRN_ENABLE_MPI=OFF") if "+python" in spec: - args.append("-DPYTHON_EXECUTABLE:FILEPATH=" - + spec["python"].command.path) + args.append("-DPYTHON_EXECUTABLE:FILEPATH=" + spec["python"].command.path) - if spec.variants['build_type'].value == 'Debug': + if spec.variants["build_type"].value == "Debug": args.append("-DCMAKE_C_FLAGS=-g -O0") args.append("-DCMAKE_CXX_FLAGS=-g -O0") args.append("-DCMAKE_BUILD_TYPE=Custom") if "+legacy-unit" in spec: - args.append('-DNRN_DYNAMIC_UNITS_USE_LEGACY=ON') + args.append("-DNRN_DYNAMIC_UNITS_USE_LEGACY=ON") if "+caliper" in spec: - args.append('-DCORENRN_CALIPER_PROFILING=ON') + args.append("-DCORENRN_CALIPER_PROFILING=ON") return args @@ -113,8 +113,7 @@ class Neuron(CMakePackage): cxx_compiler = self.compiler.cxx kwargs = {"backup": False, "string": True} - nrnmech_makefile = join_path(self.prefix, - "./bin/nrnmech_makefile") + nrnmech_makefile = join_path(self.prefix, "./bin/nrnmech_makefile") # assign_operator is changed to fix wheel support if self.spec.satisfies("@:7"): @@ -122,18 +121,21 @@ class Neuron(CMakePackage): else: assign_operator = "=" - filter_file("CC {0} {1}".format(assign_operator, env["CC"]), - "CC = {0}".format(cc_compiler), - nrnmech_makefile, - **kwargs) - filter_file("CXX {0} {1}".format(assign_operator, env["CXX"]), - "CXX = {0}".format(cxx_compiler), - nrnmech_makefile, - **kwargs) + filter_file( + "CC {0} {1}".format(assign_operator, env["CC"]), + "CC = {0}".format(cc_compiler), + nrnmech_makefile, + **kwargs, + ) + filter_file( + "CXX {0} {1}".format(assign_operator, env["CXX"]), + "CXX = {0}".format(cxx_compiler), + nrnmech_makefile, + **kwargs, + ) if spec.satisfies("+coreneuron"): - corenrn_makefile = join_path(self.prefix, - "share/coreneuron/nrnivmodl_core_makefile") + corenrn_makefile = join_path(self.prefix, "share/coreneuron/nrnivmodl_core_makefile") filter_file(env["CXX"], cxx_compiler, corenrn_makefile, **kwargs) def setup_run_environment(self, env): @@ -145,3 +147,4 @@ class Neuron(CMakePackage): # necessary for installation time tests of dependents def setup_dependent_build_environment(self, env, dependent_spec): self.setup_run_environment(env) + diff --git a/packages/neuron/patch-v782-git-cmake-avx512.patch b/packages/neuron/patch-v782-git-cmake-avx512.patch index 34f0f3a6569ed14f7d2fd2ac2228f543eb24a934..dc2a4b8fe49f7fb01b409d0cf923c9ba5b220cd5 100644 --- a/packages/neuron/patch-v782-git-cmake-avx512.patch +++ b/packages/neuron/patch-v782-git-cmake-avx512.patch @@ -137,4 +137,3 @@ index 30024d6e..26f76a98 100644 COMMAND ${CMAKE_COMMAND} -E copy_if_different nrnversion.h.tmp ${NRN_NRNOC_SRC_DIR}/nrnversion.h DEPENDS ${PROJECT_SOURCE_DIR}/git2nrnversion_h.sh) - diff --git a/packages/py-bluepyopt/package.py b/packages/py-bluepyopt/package.py index b42aa7ae008f6ca4abdfafa109316da69bfc72df..3cb09bc83ab214fa2a84160f4376391790d0e59c 100644 --- a/packages/py-bluepyopt/package.py +++ b/packages/py-bluepyopt/package.py @@ -1,8 +1,6 @@ -############################################################################## -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) +# (this package was adapted from https://github.com/BlueBrain/spack/blob/develop/bluebrain/repo-bluebrain/packages/py-bluepyopt/package.py) + + from spack import * @@ -12,34 +10,39 @@ class PyBluepyopt(PythonPackage): homepage = "https://github.com/BlueBrain/BluePyOpt" pypi = "bluepyopt/bluepyopt-1.9.27.tar.gz" + maintainers = ["hjorth", "elmath"] + # NOTE : while adding new release check pmi_rank.patch compatibility - version('1.10.38', sha256='fb1411c6a8fbfac52d36b837225bae882fd6524acfb4d0580189312ef3c1cfcc') - version('1.9.37', sha256='4399af71de48b288832e92f0de73c431bf88d6e76e2c4ea250c3b38fb38a45a8') - version('1.9.27', sha256='4cce15b92b32311c808cae5e005b664deb6e8dc5df4ca13ea7b59252ae346522') - version('1.8.68', sha256='b9d432840aab89d4863c935d3dc604816441eba02d731422b92056cee751ca9c') - version('1.6.56', sha256='1c57c91465ca4b947fe157692e7004a3e6df02e4151e3dc77a8831382a8f1ab9') - version('1.8.68', sha256='b9d432840aab89d4863c935d3dc604816441eba02d731422b92056cee751ca9c') - version('1.9.12', sha256='7b623ab9168f460a85d952719ca5249248fc95e6f7a02658b0673b2baa0a8fc6') + version("1.12.63", sha256="ec33abe2113767420cae0317da4d61554eb934e5447cadb54d66620576b97714") + version("1.11.47", sha256="cffe1698930e3e89544c441674a5f66e310c72db27f8265b17200713d9d16614") + version("1.10.38", sha256="fb1411c6a8fbfac52d36b837225bae882fd6524acfb4d0580189312ef3c1cfcc") + version("1.9.37", sha256="4399af71de48b288832e92f0de73c431bf88d6e76e2c4ea250c3b38fb38a45a8") + version("1.9.27", sha256="4cce15b92b32311c808cae5e005b664deb6e8dc5df4ca13ea7b59252ae346522") + version("1.8.68", sha256="b9d432840aab89d4863c935d3dc604816441eba02d731422b92056cee751ca9c") + version("1.6.56", sha256="1c57c91465ca4b947fe157692e7004a3e6df02e4151e3dc77a8831382a8f1ab9") + version("1.8.68", sha256="b9d432840aab89d4863c935d3dc604816441eba02d731422b92056cee751ca9c") + version("1.9.12", sha256="7b623ab9168f460a85d952719ca5249248fc95e6f7a02658b0673b2baa0a8fc6") # patch required to avoid hpe-mpi linked mechanism library patch("pmi_rank.patch", when="@1.9.27:") - variant('neuron', default=True, description="Use BluePyOpt together with NEURON") - - depends_on("py-setuptools@:57", type="build") #TODO: remove version constraint after update to spack v0.19 (this is actually a py-deap dependency) - depends_on('py-pandas', type='run') - depends_on('py-numpy', type='run') - depends_on('py-efel', type='run') - depends_on('py-deap', type='run') - depends_on('py-scoop@0.7:', type='run', when='@:1.9.37') - depends_on('py-ipyparallel', type='run') - depends_on('py-pickleshare', type='run') - depends_on('py-future', type='run') - depends_on('py-jinja2', type='run') - depends_on('py-pebble@4.3.10:', type='run') - depends_on('neuron', type='run', when='+neuron') + variant("neuron", default=True, description="Use BluePyOpt together with NEURON") + + depends_on("py-setuptools", type=("build")) + depends_on("py-pandas@0.18:", type=("build","run")) + depends_on("py-numpy@1.6:", type=("build","run")) + depends_on("py-efel@2.13:", type=("build","run")) + depends_on("py-deap", type=("build","run")) + depends_on("py-deap@1.3.3:", type=("build","run"), when="@1.12.63:") + depends_on("py-scoop@0.7:", type=("build","run"), when="@:1.9.37") + depends_on("py-ipyparallel", type=("build","run")) + depends_on("py-pickleshare@0.7.3:", type=("build","run")) + depends_on("py-future", type=("build","run")) + depends_on("py-jinja2@2.8:", type=("build","run")) + depends_on("py-pebble@4.3.10:", type=("build","run")) + depends_on("neuron", type=("build","run"), when="+neuron") def setup_run_environment(self, env): - env.unset('PMI_RANK') - env.set('NEURON_INIT_MPI', "0") - env.prepend_path('PATH', self.spec['py-ipyparallel'].prefix.bin) + env.unset("PMI_RANK") + env.set("NEURON_INIT_MPI", "0") + env.prepend_path("PATH", self.spec["py-ipyparallel"].prefix.bin) diff --git a/packages/py-deap/package.py b/packages/py-deap/package.py new file mode 100644 index 0000000000000000000000000000000000000000..1841b020953bde7862d5e147f15c1f16a568a8ca --- /dev/null +++ b/packages/py-deap/package.py @@ -0,0 +1,24 @@ +# (this package was adapted from the spack develop upstream as a dependency of py-bluepyopt) + +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack import * + + +class PyDeap(PythonPackage): + """Distributed Evolutionary Algorithms in Python.""" + + homepage = "https://deap.readthedocs.org/" + pypi = "deap/deap-1.3.1.tar.gz" + + maintainers = ["hjorth", "elmath"] + + version("1.3.3", sha256="8772f1b0fff042d5e516b0aebac2c706243045aa7d0de8e0b8658f380181cf31") + version("1.3.1", sha256="11f54493ceb54aae10dde676577ef59fc52d52f82729d5a12c90b0813c857a2f") + + depends_on("py-setuptools@:57", type=("build")) + depends_on("py-numpy", type=("build", "run")) diff --git a/packages/py-efel/package.py b/packages/py-efel/package.py index cb119c70427c182cb48d2078a52165f1fc62fe1d..091bf110491cfc52f5fb86b70302d26e9ce63dc0 100644 --- a/packages/py-efel/package.py +++ b/packages/py-efel/package.py @@ -14,8 +14,8 @@ class PyEfel(PythonPackage): pypi = "efel/efel-4.0.4.tar.gz" git = "https://github.com/BlueBrain/eFEL.git" - version('4.0.4', sha256='258c506776df609edc799338fd773e78f0f0315fd6f3e2f969478bda401a8894') + version("4.0.4", sha256="258c506776df609edc799338fd773e78f0f0315fd6f3e2f969478bda401a8894") - depends_on('python@3.6.9:') - depends_on('py-numpy@1.6:', type=('build', 'run')) - depends_on('py-six', type=('build', 'run')) \ No newline at end of file + depends_on("python@3.6.9:") + depends_on("py-numpy@1.6:", type=("build", "run")) + depends_on("py-six", type=("build", "run")) diff --git a/packages/py-libsonata/package.py b/packages/py-libsonata/package.py index 4c9ee33b5ec7c51f54dc1d5bdb14546e5cd3a03f..6195654318a64f10b13313ffa4f82661c3a4f008 100644 --- a/packages/py-libsonata/package.py +++ b/packages/py-libsonata/package.py @@ -1,7 +1,5 @@ -# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) +# (this package was adapted from https://github.com/BlueBrain/spack/blob/develop/bluebrain/repo-bluebrain/packages/py-libsonata/package.py) + from spack import * @@ -12,22 +10,23 @@ class PyLibsonata(PythonPackage): homepage = "https://github.com/BlueBrain/libsonata" git = "https://github.com/BlueBrain/libsonata.git" pypi = "libsonata/libsonata-0.1.14.tar.gz" + + maintainers = ["hjorth", "elmath"] submodules = True - version('develop', branch='master') - version('0.1.16', sha256='49ced56992ba8be8aa6638525e8078b7e3ce0d5c05c34ee90746cab02bb5185a') - version('0.1.15', sha256='8c7c509db692b482cba5b0453579747db5a981ce5b3c13da96b14ae0332a6e81') - version('0.1.14', sha256='a5c75df1c3ef6fac10d92fb6781643e0834e5c35debe77693686dab8bfcf221f') - version('0.1.13', sha256='8263938e49b501c477f626b4c25e0c74e91152268830c69aabc96eeb263c6eea') - version('0.1.12', sha256='f0fa0f3b129d28e41b337ce2c39c3604990752de8e485327ec9df3bf0360e9c1') - version('0.1.11', sha256='95f302818971fec3f19ef18febd5c31c580490692138c8e4fe3534104d88b5e0') - version('0.1.10', sha256='7ef9f911f7ea31da5ff5306d8372ec194d223850aede0878ac2a921ce049bbb2') - - depends_on('cmake@3.3:', type='build') - depends_on('hdf5') - depends_on('py-pybind11') - - depends_on('py-numpy@1.17:', type=('build', 'run')) - depends_on('py-setuptools', type='build', when='@0.1:') - depends_on('py-setuptools-scm', type='build', when='@0.1:') + version("develop", branch="master") + version("0.1.16", sha256="49ced56992ba8be8aa6638525e8078b7e3ce0d5c05c34ee90746cab02bb5185a") + version("0.1.15", sha256="8c7c509db692b482cba5b0453579747db5a981ce5b3c13da96b14ae0332a6e81") + version("0.1.14", sha256="a5c75df1c3ef6fac10d92fb6781643e0834e5c35debe77693686dab8bfcf221f") + version("0.1.13", sha256="8263938e49b501c477f626b4c25e0c74e91152268830c69aabc96eeb263c6eea") + version("0.1.12", sha256="f0fa0f3b129d28e41b337ce2c39c3604990752de8e485327ec9df3bf0360e9c1") + version("0.1.11", sha256="95f302818971fec3f19ef18febd5c31c580490692138c8e4fe3534104d88b5e0") + version("0.1.10", sha256="7ef9f911f7ea31da5ff5306d8372ec194d223850aede0878ac2a921ce049bbb2") + + depends_on("hdf5") + depends_on("py-pybind11") + depends_on("cmake@3.3:", type=("build")) + depends_on("py-setuptools", type=("build"), when="@0.1:") + depends_on("py-setuptools-scm", type=("build"), when="@0.1:") + depends_on("py-numpy@1.17:", type=("build", "run")) diff --git a/packages/py-pebble/package.py b/packages/py-pebble/package.py index ab9ef132377410fe695ee9f603df530860e67054..5e17a06cec5be189527ab05b47a7572df3df0db3 100644 --- a/packages/py-pebble/package.py +++ b/packages/py-pebble/package.py @@ -1,21 +1,23 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# (this package was adapted from the spack develop upstream as a dependency of py-bluepyopt) + +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) + from spack import * class PyPebble(PythonPackage): - """Python API to manage threads and processes within an application.""" + """Threading and multiprocessing eye-candy.""" homepage = "https://github.com/noxdafox/pebble" - pypi = "pebble/Pebble-4.5.0.tar.gz" - git = "https://github.com/noxdafox/pebble.git" + pypi = "Pebble/Pebble-5.0.3.tar.gz" - version('4.5.0', sha256='2de3cd11aa068e0c4a4abbaf8d4ecfdac409d8bfb78a4c211a01f6a4fb17a35f') - version('4.4.1', sha256='7c4d68a3479140cba74d7454d8190e2cb1a93213b44b5befe3c53c201beb8317') - version('4.3.10', sha256='c39a7bf99af6525fcf0783a8859fb10a4f20f4f988ddb66fd6fa7588f9c91731') + maintainers = ["hjorth", "elmath"] + + version("5.0.3", sha256="bdcfd9ea7e0aedb895b204177c19e6d6543d9962f4e3402ebab2175004863da8") - depends_on('py-setuptools', type=('build', 'run')) - depends_on('py-futures', type='run', when='^python@:2.9.9') + depends_on("python@3.6:", type=("build", "run")) + depends_on("py-setuptools", type=("build")) diff --git a/packages/py-pyswarms/package.py b/packages/py-pyswarms/package.py index eb83ce579fc31b6af20764bcafaa74ee90e6ba10..15313932920d39578d0584b2bf8ed57adbe919cb 100644 --- a/packages/py-pyswarms/package.py +++ b/packages/py-pyswarms/package.py @@ -6,12 +6,14 @@ class PyPyswarms(PythonPackage): homepage = "https://github.com/ljvmiranda921/pyswarms" pypi = "pyswarms/pyswarms-1.3.0.tar.gz" - version('1.3.0', sha256='1204aa9c332c662113e3c37d1b109906f4a0859b29ded80c1582dc66387ce34b') + maintainers = ["hjorth", "elmath"] - depends_on('py-scipy', type=('build', 'run')) - depends_on('py-numpy', type=('build', 'run')) - depends_on('py-matplotlib@1.3.1:', type=('build', 'run')) - depends_on('py-attrs', type=('build', 'run')) - depends_on('py-tqdm', type=('build', 'run')) - depends_on('py-future', type=('build', 'run')) - depends_on('py-pyyaml', type=('build', 'run')) + version("1.3.0", sha256="1204aa9c332c662113e3c37d1b109906f4a0859b29ded80c1582dc66387ce34b") + + depends_on("py-scipy", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-matplotlib@1.3.1:", type=("build", "run")) + depends_on("py-attrs", type=("build", "run")) + depends_on("py-tqdm", type=("build", "run")) + depends_on("py-future", type=("build", "run")) + depends_on("py-pyyaml", type=("build", "run")) diff --git a/packages/py-quantities/package.py b/packages/py-quantities/package.py index 699a20e1cf2a2a590f9e6f561f6f278476b4be85..2e919c47fcdb3ca9a6312f5da6cef58b6930b942 100644 --- a/packages/py-quantities/package.py +++ b/packages/py-quantities/package.py @@ -14,9 +14,9 @@ class PyQuantities(PythonPackage): maintainers = ['apdavison'] # temporary fix to avoid building with py-setuptools@:61, that doesn't support PEP 621 - version('0.14.0', sha256='abb993ac16817c5303da3bcf866bcfc19a0d797f4d85c06adebb8b6fe2bcb67a', - url= "https://pypi.io/packages/py3/q/quantities/quantities-0.14.0-py3-none-any.whl", expand=False) - # version('0.14.0', sha256='b5cbe363e27dc6d16abeba9fab7a5c98775d81b7d7f16cc691ba00041e02e1d0') + version('0.14.1', sha256='b2edf67b8c2a28aa3bbe096f9fc3ec3ab83fc3192997373641cddab32bea2f72', + url= "https://pypi.io/packages/py3/q/quantities/quantities-0.14.1-py3-none-any.whl", expand=False) + # version('0.14.1', sha256='efeafffc0c0364f891a9327239cd12496bccb55cd037a6d1bf44de706f722877') version('0.13.0', sha256='0fde20115410de21cefa786f3aeae69c1b51bb19ee492190324c1da705e61a81') version('0.12.5', sha256='67546963cb2a519b1a4aa43d132ef754360268e5d551b43dd1716903d99812f0') version('0.12.4', sha256='a33d636d1870c9e1127631185d89b0105a49f827d6aacd44ad9d8f151f331d8b') diff --git a/packages/py-snudda/package.py b/packages/py-snudda/package.py index 333e28a3a41817154d7d2f0f6b510810af4beea5..08fb34bb7370fb752cfa75d35f977bc6c06956bd 100644 --- a/packages/py-snudda/package.py +++ b/packages/py-snudda/package.py @@ -1,34 +1,31 @@ from spack import * -class PySnudda(Package): - homepage = 'https://pypi.org/project/snudda/' - url = 'https://files.pythonhosted.org/packages/py3/s/snudda/snudda-1.2.9-py3-none-any.whl' - list_url = 'https://pypi.org/simple/snudda/' - maintainers = ['hjorth','akarmas'] - - version('1.3.2', '2306ec50acead5fd4f988ec373f19718', expand=False) +class PySnudda(PythonPackage): + """Snudda creates the connectivity for realistic networks of simulated neurons in silico in a bottom up fashion that can then be simulated using the NEURON software.""" + + homepage = "https://pypi.org/project/snudda/" + pypi = "snudda/snudda-1.4.0.tar.gz" + + maintainers = ["hjorth", "elmath"] - depends_on('python@3.8:', type=('build','run')) - depends_on('py-pip', type='build') - depends_on('unzip', type='build') - depends_on('py-bluepyopt', type=('build','run')) # got this from BlueBrainProject https://github.com/BlueBrain/spack/blob/develop/bluebrain/repo-bluebrain/packages/py-bluepyopt/package.py - depends_on('py-h5py', type=('build','run')) - depends_on('py-ipyparallel', type=('build','run')) - depends_on('py-matplotlib', type=('build','run')) - depends_on('py-mpi4py', type=('build','run')) - depends_on('py-numpy', type=('build','run')) - depends_on('py-scipy', type=('build','run')) - depends_on('py-libsonata', type=('build','run')) # got it from from BlueBrainProject https://github.com/BlueBrain/spack/blob/develop/bluebrain/repo-bluebrain/packages/py-libsonata/package.py - depends_on('py-pyzmq', type=('build','run')) - depends_on('py-numexpr', type=('build','run')) - depends_on('neuron', type=('build','run')) - depends_on('py-pyswarms', type=('build','run')) - depends_on('py-setuptools', type=('build')) - depends_on('py-psutil', type=('build','run')) - depends_on('py-cython', type=('build','run')) - depends_on('py-numba', type=('build','run')) + version("1.4.0", "55f9b398b01b34bf3cec28c8a3aebc78") + version("1.3.2", "2306ec50acead5fd4f988ec373f19718", url="https://files.pythonhosted.org/packages/py3/s/snudda/snudda-1.2.9-py3-none-any.whl", expand=False) - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) + depends_on("unzip", type=("build")) + depends_on("py-setuptools", type=("build")) + depends_on("py-bluepyopt@1.11.7:", type=("build","run")) + depends_on("py-h5py@3.2.1:", type=("build","run")) + depends_on("py-ipyparallel@6.3.0:", type=("build","run")) + depends_on("py-matplotlib@3.3.4:", type=("build","run")) + depends_on("py-mpi4py@3.0.3:", type=("build","run")) + depends_on("py-numpy@1.20.2:", type=("build","run")) + depends_on("py-scipy@1.6.3:", type=("build","run")) + depends_on("py-libsonata@0.0.2:", type=("build","run")) + depends_on("py-pyzmq@22.0.3:", type=("build","run")) + depends_on("py-numexpr@2.7.3:", type=("build","run")) + depends_on("neuron@7.8.2:", type=("build","run")) + depends_on("py-pyswarms@1.3.0:", type=("build","run")) + depends_on("py-psutil", type=("build","run")) + depends_on("py-cython", type=("build","run")) + depends_on("py-numba@0.53.1:", type=("build","run")) diff --git a/packages/r-irkernel/package.py b/packages/r-irkernel/package.py new file mode 100644 index 0000000000000000000000000000000000000000..d6dd8db386548c6464be1f016487b9f07246969b --- /dev/null +++ b/packages/r-irkernel/package.py @@ -0,0 +1,39 @@ +# this package was adapted from Spack upstream v0.18.1, to change the dependency on py-jupyter to py-jupyter-client + +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack import * + + +class RIrkernel(RPackage): + """Native R Kernel for the 'Jupyter Notebook'. + The R kernel for the 'Jupyter' environment executes R code which the + front-end ('Jupyter Notebook' or other front-ends) submits to the kernel + via the network.""" + + cran = "IRkernel" + + version('1.3', sha256='5a7fcbfd978dfb3cca6702a68a21c147551995fc400084ae8382ffcbbdae1903') + version('1.2', sha256='5fb4dbdb741d05043120a8be0eb73f054b607d9854f314bd79cfec08d219ff91') + version('0.7', + git="https://github.com/IRkernel/IRkernel.git", + commit='9cdd284e03eb42d03fab18544b81f486852d5fe0', + deprecated=True) + + depends_on('r@3.2.0:', type=('build', 'run')) + depends_on('r-repr@0.4.99:', type=('build', 'run')) + depends_on('r-evaluate@0.10:', type=('build', 'run')) + depends_on('r-irdisplay@0.3.0.9999:', type=('build', 'run')) + depends_on('r-pbdzmq@0.2-1:', type=('build', 'run')) + depends_on('r-crayon', type=('build', 'run')) + depends_on('r-jsonlite@0.9.6:', type=('build', 'run')) + depends_on('r-uuid', type=('build', 'run')) + depends_on('r-digest', type=('build', 'run')) + depends_on('py-jupyter-client', type='run') + + depends_on('r-evaluate@0.5.4:', type=('build', 'run'), when='@0.7') + depends_on('r-devtools', type=('build', 'run'), when='@0.7') diff --git a/packages/r-rgsl/package.py b/packages/r-rgsl/package.py new file mode 100644 index 0000000000000000000000000000000000000000..264ecfe9ae461de88a6c2eae926be24d27f637e1 --- /dev/null +++ b/packages/r-rgsl/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class RRgsl(RPackage): + """This is an interface package to solve ODE systems using gsl_odeiv2 within R. The system to solve has to be defined using C code: a shared library, dynamically loaded by this package when solving.""" + + homepage = "https://github.com/icpm-kth/rgsl" + url = "https://github.com/icpm-kth/rgsl/archive/refs/tags/v0.1.tar.gz" + + version("0.1", sha256="dd6a14dda8731f4cf32149c8a9842e4e2ba424c8404f4d6839108153b20e4c3e") + + # GNU Scientific Library: https://www.gnu.org/software/gsl + # spack: https://spack.readthedocs.io/en/latest/package_list.html#gsl + depends_on("gsl") diff --git a/packages/r-sbtabvfgen/package.py b/packages/r-sbtabvfgen/package.py new file mode 100644 index 0000000000000000000000000000000000000000..c50a7ce8f319e3c1af96dda18edfe44c257c5020 --- /dev/null +++ b/packages/r-sbtabvfgen/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class RSbtabvfgen(RPackage): + """This package converts SBtab files (with one table per tsv file) into three other formats: vfgen, sbml, Neuron's MOD. It also saves its findings in a free form, as text files. SBtab files typically contain a reaction network model (systems biology). The output is more useful for simulations.""" + + homepage = "https://github.com/icpm-kth/SBtabVFGEN" + url = "https://github.com/icpm-kth/SBtabVFGEN/archive/refs/tags/v0.1.tar.gz" + + version("0.1", sha256="499c51abee75ca5961a41608c9fb09ad523e12aae276f5f67bffa313244cff28") + + depends_on("r-pracma") diff --git a/packages/r-uqsa/package.py b/packages/r-uqsa/package.py new file mode 100644 index 0000000000000000000000000000000000000000..5fd65068efbaeb4f950020f23ef58c7a1c1c92e0 --- /dev/null +++ b/packages/r-uqsa/package.py @@ -0,0 +1,30 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class RUqsa(RPackage): + """This package will solve an initial value problem (given an ordinary + differential equation) for a list of simulation experiments. The + simulations will be compared to data, repeatedly. The package can + sample the parameters of the model via ABC (approximate Bayesian + computation) and by doing so quantify the uncertainty that remains + within the model even after considering the data. Experiments are + evaluated in a sequence, intermediate probability densities are + modeled using the VineCopua package.""" + + # FIXME: Add a proper url for your package's homepage here. + homepage = "https://github.com/icpm-kth/uqsa" + url = "https://github.com/icpm-kth/uqsa/archive/refs/tags/v2.2.tar.gz" + + version("2.2", sha256="df15d20c0cd466083181ec8f37cd331f409dcd23838553cd46a7a7305bdcfc7f") + + depends_on("r-vinecopula") + depends_on("r-mass") + depends_on("r-r-utils") + depends_on("r-ks") + diff --git a/packages/r-vinecopula/package.py b/packages/r-vinecopula/package.py new file mode 100644 index 0000000000000000000000000000000000000000..560af0ab057bbe3e35ff35e93cd95bc6ee676f95 --- /dev/null +++ b/packages/r-vinecopula/package.py @@ -0,0 +1,27 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class RVinecopula(RPackage): + """Provides tools for the statistical analysis of regular vine copula + models, see Aas et al. (2009) <doi:10.1016/j.insmatheco.2007.02.001> and + Dissman et al. (2013) <doi:10.1016/j.csda.2012.08.010>. + The package includes tools for parameter estimation, model selection, + simulation, goodness-of-fit tests, and visualization. Tools for estimation, + selection and exploratory data analysis of bivariate copula models are also + provided.""" + + homepage = "https://cran.r-project.org/package=VineCopula" + url = "https://github.com/tnagler/VineCopula/archive/refs/tags/v2.4.5.tar.gz" + + version("2.4.5", sha256="2255a2a0f2644e447f33c7fa3562cb1ad109aa7809ea250fe82b67b35cc2d23d") + + depends_on("r-mass") + depends_on("r-mvtnorm") + depends_on("r-r-methodss3") + depends_on("r-adgoftest") + depends_on("r-lattice") diff --git a/packages/wf-uq-akar4/package.py b/packages/wf-uq-akar4/package.py new file mode 100644 index 0000000000000000000000000000000000000000..2aca38fc52842465afcc58a151765d9fe9bd563d --- /dev/null +++ b/packages/wf-uq-akar4/package.py @@ -0,0 +1,24 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack import * + + +class WfUqAkar4(BundlePackage): + """Meta-package to collect all dependencies of the Uncertainty Quantification demo.""" + + homepage="https://wiki.ebrains.eu/bin/view/Collabs/subcellular-modeling-and-simulation/Lab" + + version("0.1") + + depends_on("r-mass") + depends_on("r-desolve") + depends_on("r-pracma") + depends_on("r-ks") + depends_on("r-reshape2") + depends_on("r-r-utils") + depends_on("r-vinecopula") + depends_on("r-ggplot2") diff --git a/spack.yaml b/spack.yaml index 4ac1b4ee809f7efaa3f620edb7477d9800398f63..b699546d5dd7b0ebdf835f840278f58dd0ad6b73 100644 --- a/spack.yaml +++ b/spack.yaml @@ -1,5 +1,6 @@ spack: specs: + - r-irkernel # Notebook #- py-jupyter - py-ipython @@ -19,7 +20,7 @@ spack: - py-lazyarray #- py-version-query # EBRAINS simulators - - nest@3.4_rc1 + - nest@3.4_rc2 - arbor +python +mpi - neuron +mpi - py-pynn@0.10.1 +mpi @@ -62,7 +63,11 @@ spack: - biobb-gromacs - apbs - py-pdb2pqr + - r-uqsa - sda + - r-rgsl + - r-sbtabvfgen + - wf-uq-akar4 # demo for codejam12 #- funniest1022 concretizer: