Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rshimoura/ebrains-spack-builds
  • ziaee/ebrains-spack-builds
  • hl11/ebrains-spack-builds
  • filippomarchetti/ebrains-spack-builds
  • jkaiser/ebrains-spack-builds
  • hjorth/ebrains-spack-builds-sept-2024
  • dsegebarth/ebrains-spack-builds
  • kozlov/ebrains-spack-builds
  • dsegebarth/ebrains-spack-builds-na-3
  • ansimsek/ebrains-spack-builds
  • lupoc/ebrains-spack-builds
  • hartmut/ebrains-spack-builds
  • ri/tech-hub/platform/esd/ebrains-spack-builds
  • lcalori0/ebrains-spack-builds
  • deepu/ebrains-spack-builds
  • noelp/ebrains-spack-builds
16 results
Show changes
Commits on Source (833)
Showing
with 1054 additions and 306 deletions
__pycache__ __pycache__
*.pyc *.pyc
*.err
*.out
.spack-env/
spack.lock
This diff is collapsed.
### Summary
| | |
|---------------|----------------------------------------|
| Package | <!-- Spack package name --> |
| Contact point | <!-- maintainer GitLab handle --> |
| KG entry | <!-- insert link --> |
### Checks
<!-- please download the EBRAINS Software Quality checklist, fill it and replace the file below -->
* [ ] Software Quality Checklist: [SQ-Checklist.pdf](https://drive.ebrains.eu/d/6061531326d048308823/files/?p=%2FSQ-Checklist.pdf) (level: <!-- passing, silver, gold -->)
* [ ] Current maintainer is listed first in `package.py`
* [ ] No pinned dependency versions
* [ ] Post-installation tests are defined
\ No newline at end of file
### Summary
| | |
|---------------|----------------------------------------|
| Package | <!-- Spack package name --> |
| Version added | <!-- version number --> |
| Contact point | <!-- maintainer GitLab handle --> |
| KG entry | <!-- insert link --> |
### Checks
<!-- please download the EBRAINS Software Quality checklist, fill it and replace the file below -->
* [ ] Software Quality Checklist: [SQ-Checklist.pdf](https://drive.ebrains.eu/d/6061531326d048308823/files/?p=%2FSQ-Checklist.pdf) (level: <!-- passing, silver, gold -->)
* [ ] Current maintainer is listed first in `package.py`
* [ ] No pinned dependency versions
* [ ] Post-installation tests are defined
\ No newline at end of file
[submodule "vendor/spack"]
path = vendor/spack
url = https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/spack.git
shallow = true
[submodule "vendor/yashchiki"]
path = vendor/yashchiki
url = https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/dedal
shallow = true
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MIT License
Copyright (c) 2013-2023 LLNS, LLC and other Spack Project Developers.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
...@@ -15,6 +15,7 @@ This repository is where the EBRAINS Spack packages are maintained. It contains: ...@@ -15,6 +15,7 @@ This repository is where the EBRAINS Spack packages are maintained. It contains:
- the latest EBRAINS [Spack environment](https://spack.readthedocs.io/en/latest/environments.html) ([spack.yaml](spack.yaml)), a list of the specific versions of EBRAINS tools that are part of the software release - the latest EBRAINS [Spack environment](https://spack.readthedocs.io/en/latest/environments.html) ([spack.yaml](spack.yaml)), a list of the specific versions of EBRAINS tools that are part of the software release
- a script ([install_spack_env.sh](install_spack_env.sh)) that can be used to install the latest spack environment on any machine (either install from scratch or update an existing installation) - a script ([install_spack_env.sh](install_spack_env.sh)) that can be used to install the latest spack environment on any machine (either install from scratch or update an existing installation)
- CI/CD pipelines configured for (a) testing the installation of new packages and (b) deploying the environment to the EBRAINS Collaboratory Lab. - CI/CD pipelines configured for (a) testing the installation of new packages and (b) deploying the environment to the EBRAINS Collaboratory Lab.
- (WIP) all the site-specific configurations that have been used to install the EBRAINS Spack environment in different systems, such as the EBRAINS Lab and the Fenix HPC systems.
## Contributing ## Contributing
...@@ -34,17 +35,16 @@ To install the EBRAINS Spack environment on a new machine, it is recommended to ...@@ -34,17 +35,16 @@ To install the EBRAINS Spack environment on a new machine, it is recommended to
Clone this repository. You can use the `ebrains-yy-mm` branches to install the EBRAINS official releases, the `experimental-rel` branch for the experimental release, or the `master` branch for the latest state: Clone this repository. You can use the `ebrains-yy-mm` branches to install the EBRAINS official releases, the `experimental-rel` branch for the experimental release, or the `master` branch for the latest state:
``` ```
git clone --branch {branch-name} https://gitlab.ebrains.eu/technical-coordination/project-internal/devops/platform/ebrains-spack-builds.git git clone --branch {branch-name} https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
``` ```
Clone Spack. We currently use version v0.18.1: Clone Spack. We currently use version v0.23.1:
``` ```
git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch v0.18.1 https://github.com/spack/spack git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch v0.23.1 https://github.com/spack/spack
``` ```
Modify (if needed) and copy the package.yaml file (that contains important package settings for Spack) and activate Spack: Activate Spack:
``` ```
cp ebrains-spack-builds/packages.yaml spack/etc/spack/packages.yaml
. spack/share/spack/setup-env.sh . spack/share/spack/setup-env.sh
``` ```
...@@ -53,17 +53,19 @@ Add the project repository to your Spack environment: ...@@ -53,17 +53,19 @@ Add the project repository to your Spack environment:
spack repo add ebrains-spack-builds spack repo add ebrains-spack-builds
``` ```
Create and activate the environment: Define your site-specific configurations:
``` ```
spack env create ebrains-env ebrains-spack-builds/spack.yaml export SYSTEMNAME=<your-system-name>
spack env activate ebrains-env mkdir ebrains-spack-builds/site-config/$SYSTEMNAME
# copy any site-specific .yaml files inside the new dir
``` ```
Install: Activate the environment and install:
``` ```
spack env activate ebrains-spack-builds
spack install --fresh spack install --fresh
``` ```
## Troubleshooting ## Troubleshooting
If you encounter any issues with installing, testing, or using the EBRAINS Spack environment or a specific package, please [open an issue](https://gitlab.ebrains.eu/technical-coordination/project-internal/devops/platform/ebrains-spack-builds/-/issues/new) using the provided templates, or contact the Technical Coordination team directly. If you encounter any issues with installing, testing, or using the EBRAINS Spack environment or a specific package, please [open an issue](https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds/-/issues/new) using the provided templates, or contact the Technical Coordination team directly.
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
# loaded by all users. # loaded by all users.
# =========================================================================================================== # ===========================================================================================================
set -euo pipefail
INSTALLATION_ROOT=$1 INSTALLATION_ROOT=$1
EBRAINS_SPACK_ENV=$2 EBRAINS_SPACK_ENV=$2
RELEASE_NAME=$3 RELEASE_NAME=$3
...@@ -28,6 +30,8 @@ EOF ...@@ -28,6 +30,8 @@ EOF
# (2) append the necessary env variables for spack env and tools # (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 cat $INSTALLATION_ROOT/spack/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh >> $KERNEL_PATH/bin/env.sh
# also copy the script so that it can be used independently:
cp $INSTALLATION_ROOT/spack/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh $KERNEL_PATH/bin/
# (3) also add the user's .local locations to allow package installation at runtime, # (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 # and the location of python modules installed in the base docker Collab image
...@@ -39,6 +43,11 @@ mkdir -p \$R_LIBS_USER ...@@ -39,6 +43,11 @@ mkdir -p \$R_LIBS_USER
export R_LIBS=\$R_LIBS_USER:\$R_LIBS export R_LIBS=\$R_LIBS_USER:\$R_LIBS
EOF EOF
# ... and set the SYSTEMNAME env var, to use Spack commands inside the kernel
cat <<EOF >> $KERNEL_PATH/bin/env.sh
export SYSTEMNAME=ebrainslab
EOF
# (4) create startup script for python kernel # (4) create startup script for python kernel
cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_python.sh cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_python.sh
echo "python -m ipykernel_launcher -f \$@" >> $KERNEL_PATH/bin/env_python.sh echo "python -m ipykernel_launcher -f \$@" >> $KERNEL_PATH/bin/env_python.sh
...@@ -56,7 +65,7 @@ cat <<EOF > $KERNEL_PATH/$KERNEL_NAME/kernel.json ...@@ -56,7 +65,7 @@ cat <<EOF > $KERNEL_PATH/$KERNEL_NAME/kernel.json
EOF EOF
# ... and add EBRAINS logo to kernel # ... and add EBRAINS logo to kernel
cp $LAB_KERNEL_ROOT/../etc/logo-64x64-python.png $KERNEL_PATH/$KERNEL_NAME/logo-64x64.png cp $(dirname ${BASH_SOURCE[0]})/etc/logo-64x64-python.png $KERNEL_PATH/$KERNEL_NAME/logo-64x64.png
# (5) create startup script for R kernel # (5) create startup script for R kernel
cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_r.sh cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_r.sh
...@@ -75,5 +84,5 @@ cat <<EOF > $KERNEL_PATH/${KERNEL_NAME}-R/kernel.json ...@@ -75,5 +84,5 @@ cat <<EOF > $KERNEL_PATH/${KERNEL_NAME}-R/kernel.json
EOF EOF
# ... and add EBRAINS logo and kernel.js to kernel # ... and add EBRAINS logo and kernel.js to kernel
cp $LAB_KERNEL_ROOT/../etc/logo-64x64-R.png $KERNEL_PATH/${KERNEL_NAME}-R/logo-64x64.png cp $(dirname ${BASH_SOURCE[0]})/etc/logo-64x64-R.png $KERNEL_PATH/${KERNEL_NAME}-R/logo-64x64.png
cp $LAB_KERNEL_ROOT/../etc/kernel.js $KERNEL_PATH/${KERNEL_NAME}-R/ cp $(dirname ${BASH_SOURCE[0]})/etc/kernel.js $KERNEL_PATH/${KERNEL_NAME}-R/
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
# =========================================================================================================== # ===========================================================================================================
# title : create_job.sh # title : create_job.sh
# usage : ./create_job.sh $OC_JOB_ID $BUILD_ENV_DOCKER_IMAGE $OP $INSTALLATION_ROOT $SPACK_VERSION # usage : ./create_job.sh $OC_JOB_ID $BUILD_ENV_DOCKER_IMAGE $INSTALLATION_ROOT
# $SPACK_ENV $BRANCH $RELEASE_NAME $LAB_KERNEL_ROOT # $SPACK_ENV $COMMIT_SHA $RELEASE_NAME $LAB_KERNEL_ROOT
# description : creates OKD job yaml file that builds/updates spack environment and creates Lab kernel # description : creates OKD job yaml file that builds/updates spack environment and creates Lab kernel
# =========================================================================================================== # ===========================================================================================================
OC_JOB_ID=$1 OC_JOB_ID=$1
BUILD_ENV_DOCKER_IMAGE=$2 BUILD_ENV_DOCKER_IMAGE=$2
OP=$3 INSTALLATION_ROOT=$3
INSTALLATION_ROOT=$4 EBRAINS_SPACK_ENV=$4
SPACK_VERSION=$5 COMMIT_SHA=$5
SPACK_ENV=$6 RELEASE_NAME=$6
BRANCH=$7 LAB_KERNEL_ROOT=$7
RELEASE_NAME=$8 UPDATE_SPACK_OCI_CACHES=$8
LAB_KERNEL_ROOT=$9 OCI_CACHE_PREFIX=$9
cat <<EOT >> simplejob.yml cat <<EOT >> simplejob.yml
apiVersion: batch/v1 apiVersion: batch/v1
...@@ -34,24 +34,77 @@ spec: ...@@ -34,24 +34,77 @@ spec:
- name: simplejob - name: simplejob
image: ${BUILD_ENV_DOCKER_IMAGE} image: ${BUILD_ENV_DOCKER_IMAGE}
imagePullPolicy: Always imagePullPolicy: Always
resources:
limits:
cpu: '8'
memory: '32Gi'
requests:
cpu: '4'
memory: '20Gi'
volumeMounts: volumeMounts:
- name: sharedbin - name: sharedbin
mountPath: /srv mountPath: /srv
command: ["/usr/local/bin/deploy-build-env.sh", "$OP", "$INSTALLATION_ROOT", "$SPACK_VERSION", "$SPACK_ENV", "$BRANCH", "$RELEASE_NAME", "$LAB_KERNEL_ROOT"] - name: tmp
mountPath: /tmp
command:
- /bin/bash
- -c
- |
# create root dir if it doesn't exist
mkdir -p \$INSTALLATION_ROOT
# reset spack repository dir by cloning the selected version
if [ ! -d \$EBRAINS_REPO_PATH ]; then git clone ${CI_PROJECT_URL} --recurse-submodules \$EBRAINS_REPO_PATH; fi
cd \$EBRAINS_REPO_PATH
git fetch origin
git reset --hard \$COMMIT_SHA
git submodule update --force
# reset build error log dir (delete previous logs to save space)
rm -rf \$BUILD_LOGS_DIR
mkdir -p \$BUILD_LOGS_DIR
cd \$BUILD_LOGS_DIR
# run installation script
bash \$EBRAINS_REPO_PATH/install_spack_env.sh \$SPACK_JOBS \$INSTALLATION_ROOT \$EBRAINS_REPO_PATH \$EBRAINS_SPACK_ENV "" \$UPDATE_SPACK_OCI_CACHES \$OCI_CACHE_PREFIX
if [ \$? -eq 0 ]
then
# build process succeeded - create or update kernel on the NFS based on the current spack environment
bash \$EBRAINS_REPO_PATH/create_JupyterLab_kernel.sh \$INSTALLATION_ROOT \$EBRAINS_SPACK_ENV \$RELEASE_NAME \$LAB_KERNEL_ROOT && exit 0
else
# build process failed - keep spack build logs and fail the pipeline
cp -r /tmp/spack/spack-stage/* \$BUILD_LOGS_DIR
exit 1
fi
env: env:
- name: GITLAB_USER - name: SYSTEMNAME
valueFrom: value: ebrainslab
secretKeyRef: - name: INSTALLATION_ROOT
name: spack-repo-gitlab-token value: $INSTALLATION_ROOT
key: username - name: EBRAINS_SPACK_ENV
- name: GITLAB_TOKEN value: $EBRAINS_SPACK_ENV
valueFrom: - name: UPDATE_SPACK_OCI_CACHES
secretKeyRef: value: '$UPDATE_SPACK_OCI_CACHES'
name: spack-repo-gitlab-token - name: OCI_CACHE_PREFIX
key: password value: $OCI_CACHE_PREFIX
- name: COMMIT_SHA
value: $COMMIT_SHA
- name: RELEASE_NAME
value: $RELEASE_NAME
- name: LAB_KERNEL_ROOT
value: $LAB_KERNEL_ROOT
- name: BUILD_LOGS_DIR
value: /srv/build_logs/$EBRAINS_SPACK_ENV
- name: EBRAINS_REPO_PATH
value: $INSTALLATION_ROOT/ebrains-spack-builds
- name: SPACK_JOBS
value: '6'
volumes: volumes:
- name: sharedbin - name: sharedbin
persistentVolumeClaim: persistentVolumeClaim:
claimName: shared-binaries claimName: shared-binaries
- name: tmp
emptyDir: {}
restartPolicy: Never restartPolicy: Never
EOT EOT
const cmd_key = /Mac/.test(navigator.platform) ? 'Cmd' : 'Ctrl'const edit_actions = [
{
name: 'R Assign',
shortcut: 'Alt--',
icon: 'fa-long-arrow-left',
help: 'R: Inserts the left-assign operator (<-)',
handler(cm) {
cm.replaceSelection(' <- ')
},
},
{
name: 'R Pipe',
shortcut: `Shift-${cmd_key}-M`,
icon: 'fa-angle-right',
help: 'R: Inserts the magrittr pipe operator (%>%)',
handler(cm) {
cm.replaceSelection(' %>% ')
},
},
{
name: 'R Help',
shortcut: 'F1',
icon: 'fa-book',
help: 'R: Shows the manpage for the item under the cursor',
handler(cm, cell) {
const {anchor, head} = cm.findWordAt(cm.getCursor())
const word = cm.getRange(anchor, head)
const callbacks = cell.get_callbacks()
const options = {silent: false, store_history: false, stop_on_error: true}
cell.last_msg_id = cell.notebook.kernel.execute(`help(\`${word}\`)`, callbacks, options)
},
},
]
const prefix = 'irkernel'
function add_edit_shortcut(notebook, actions, keyboard_manager, edit_action) {
const {name, shortcut, icon, help, handler} = edit_action
const action = {
icon, help,
help_index : 'zz',
handler: () => {
const cell = notebook.get_selected_cell()
handler(cell.code_mirror, cell)
},
}
const full_name = actions.register(action, name, prefix)
Jupyter.keyboard_manager.edit_shortcuts.add_shortcut(shortcut, full_name)
}
function render_math(pager, html) {
if (!html) return
const $container = pager.pager_element.find('#pager-container')
$container.find('p[style="text-align: center;"]').map((i, e) =>
e.outerHTML = `\\[${e.querySelector('i').innerHTML}\\]`)
$container.find('i').map((i, e) =>
e.outerHTML = `\\(${e.innerHTML}\\)`)
MathJax.Hub.Queue(['Typeset', MathJax.Hub, $container[0]])
}
define(['base/js/namespace'], ({
notebook,
actions,
keyboard_manager,
pager,
}) => ({
onload() {
edit_actions.forEach(a => add_edit_shortcut(notebook, actions, keyboard_manager, a))
pager.events.on('open_with_text.Pager', (event, {data: {'text/html': html}}) =>
render_math(pager, html))
},
}))
etc/logo-64x64-R.png

14.4 KiB

etc/logo-64x64-python.png

14 KiB

etc/logo-64x64.png

12.3 KiB

#!/bin/bash #!/bin/bash
# =========================================================================================================== # =========================================================================================================================================
# title : install_spack_env.sh # title : install_spack_env.sh
# usage : ./install_spack_env.sh $INSTALLATION_ROOT $SPACK_VERSION $EBRAINS_REPO $EBRAINS_SPACK_ENV # usage : ./install_spack_env.sh $SPACK_JOBS $INSTALLATION_ROOT $EBRAINS_REPO $EBRAINS_SPACK_ENV $UPSTREAM_INSTANCE \
# $UPDATE_SPACK_OCI_CACHES $OCI_CACHE_PREFIX
# description : installs or updates the spack environment defined in the EBRAINS spack repo # description : installs or updates the spack environment defined in the EBRAINS spack repo
# (if the specified spack instance doesn't exist, it also creates it) # (if the specified spack instance doesn't exist, it also creates it)
# =========================================================================================================== # =========================================================================================================================================
INSTALLATION_ROOT=$1 # where to set up the installation set -eo pipefail
SPACK_VERSION=$2 # which spack version to use
SPACK_JOBS=$1 # number of jobs
INSTALLATION_ROOT=$2 # where to set up the installation
EBRAINS_REPO=$3 # location of ebrains-spack-builds repository EBRAINS_REPO=$3 # location of ebrains-spack-builds repository
EBRAINS_SPACK_ENV=$4 # name of EBRAINS Spack environment to be created/updated EBRAINS_SPACK_ENV=$4 # name of EBRAINS Spack environment to be created/updated
UPSTREAM_INSTANCE=$5 # path to Spack instance to use as upstream (optional)
UPDATE_SPACK_OCI_CACHES=$6 # "true" enables updating the OCI cache for spack sources and build results
export OCI_CACHE_PREFIX=$7
# specify location of .spack dir (by default in ~) # make sure spack uses the symlinked folder as path
# this is where cache and configuration settings are stored export CI_SPACK_ROOT=${INSTALLATION_ROOT}/spack
export SPACK_USER_CACHE_PATH=$INSTALLATION_ROOT/spack/.spack
export SPACK_USER_CONFIG_PATH=$INSTALLATION_ROOT/spack/.spack
# initial setup: clone spack if spack dir doesn't already exist # disable local configuration and cache directories
if [ ! -d $INSTALLATION_ROOT/spack ] export SPACK_DISABLE_LOCAL_CONFIG=true
then export SPACK_USER_CACHE_PATH=/tmp/spack
git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch $SPACK_VERSION https://github.com/spack/spack $INSTALLATION_ROOT/spack
# define SYSTEMNAME variable in sites where it's not already defined
export SYSTEMNAME=${SYSTEMNAME:-${HPC_SYSTEM:-$BSC_MACHINE}}
# cache related variables
export CACHE_SPECFILE=${CACHE_SPECFILE:-"env_specfile.yaml"}
export YASHCHIKI_HOME=${EBRAINS_REPO}/vendor/yashchiki
export SPACK_CACHE_SOURCE=${SPACK_CACHE_SOURCE:-${CI_SPACK_ROOT}/var/spack/cache}
export SPACK_CACHE_BUILD=${SPACK_CACHE_BUILD:-${CI_SPACK_ROOT}/var/spack/cache}
if [ ! -d ${INSTALLATION_ROOT} ]; then
mkdir -p ${INSTALLATION_ROOT}
fi fi
# SPACK PATCH: see https://github.com/spack/spack/pull/35290
sed -i 's/solver.solve(abstract_specs)/solver.solve(abstract_specs, tests=kwargs.get("tests", False))/g' $INSTALLATION_ROOT/spack/lib/spack/spack/concretize.py
# copy package settings (modify if necessary) and activate Spack # initial setup: use spack submodule if spack dir doesn't already exist
cp $EBRAINS_REPO/packages.yaml $INSTALLATION_ROOT/spack/etc/spack/packages.yaml SPACK_ROOT_EXISTED=1
source $INSTALLATION_ROOT/spack/share/spack/setup-env.sh if [ ! -d ${CI_SPACK_ROOT} ]; then
ln -s ${EBRAINS_REPO}/vendor/spack ${CI_SPACK_ROOT}
SPACK_ROOT_EXISTED=0
fi
# install platform compiler (extract version from packages.yaml) # activate Spack
EBRAINS_SPACK_COMPILER=$(grep 'compiler' $EBRAINS_REPO/packages.yaml | awk -F'[][]' '{ print $2 }') source ${CI_SPACK_ROOT}/share/spack/setup-env.sh
spack compiler find
spack install $EBRAINS_SPACK_COMPILER if [[ $UPSTREAM_INSTANCE ]]; then
spack load $EBRAINS_SPACK_COMPILER UPSTREAM_PREFIX=$(find $UPSTREAM_INSTANCE/spack/opt/spack/ -type d -name ".spack-db" 2>/dev/null | xargs -I {} dirname {})
spack compiler find spack config add upstreams:upstream-spack-instance:install_tree:$UPSTREAM_PREFIX
fi
if [ "${SPACK_ROOT_EXISTED}" -eq 0 ]; then
# for caching purposes it's nice if we can relocate into long paths, but we
# can't do that for existing installations -> else path
# ECM (2025-01-23) true seems to yield too large paths for some packages (e.g., gcc)
spack config add config:install_tree:padded_length:128
fi
# add repo if it does not exist # add repo if it does not exist
if [[ ! $(spack repo list | grep $EBRAINS_REPO) ]] if [[ ! $(spack repo list | grep ebrains-spack-builds$) ]]
then then
spack repo add $EBRAINS_REPO spack repo add $EBRAINS_REPO
fi fi
# make sure all fetching/clingo stuff happens before anything else
spack spec aida
# rebuild spack's database (could be an debugging session)
spack reindex
# add local mirror if it does not exist
if [[ ! $(spack mirror list | grep local_cache) ]]; then
# TODO for newer spack versions, add: --autopush --unsigned, drop create cache command below
# (Note: spack expects `build_cache/` below the folder we specify here
spack mirror add local_cache ${SPACK_CACHE_BUILD}
fi
spack compiler find
# create environment if it does not exist # create environment if it does not exist
if [ ! -d "$SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV" ] if [ ! -d "${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV" ]
then then
spack env create $EBRAINS_SPACK_ENV spack env create $EBRAINS_SPACK_ENV
fi fi
# update and activate environment # update environment site-configs
cp $EBRAINS_REPO/spack.yaml $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.yaml rm -rf ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV/site-config && cp -r $EBRAINS_REPO/site-config ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV
spack env activate $EBRAINS_SPACK_ENV # update spack.yaml: merge top-level and site-specific spack.yaml files
# There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies spack-python $EBRAINS_REPO/site-config/ymerge.py $EBRAINS_REPO/spack.yaml $EBRAINS_REPO/site-config/$SYSTEMNAME/spack.yaml > /tmp/spack.yaml
# for installation tests. The workaround suggested in the issue is to NOT concretize separately, but simply cp /tmp/spack.yaml ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV/
# remove the .lock file and let the enironment be concretized by the spack install command:
rm $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.lock || echo "No spack.lock file" # activate environment
spack env activate --without-view $EBRAINS_SPACK_ENV
# deactivate view during concretization and installation
spack env view disable
spack concretize --force --fresh --test root
# dump dag to file
spack spec -y > "${CACHE_SPECFILE}"
if [ -n "${OCI_CACHE_PREFIX}" ]; then
# fetch missing sources (if packages not yet installed)
python3 ${YASHCHIKI_HOME}/fetch_cached_sources.py \
--local-cache=${SPACK_CACHE_SOURCE} \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/source_cache \
--yashchiki-home=${YASHCHIKI_HOME} \
/tmp/missing_paths_sources.dat ${CACHE_SPECFILE}
# fetch missing build results (if packages not yet installed)
python3 ${YASHCHIKI_HOME}/fetch_cached_buildresults.py \
--local-cache=${SPACK_CACHE_BUILD}/build_cache \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/build_cache \
--yashchiki-home=${YASHCHIKI_HOME} \
/tmp/missing_paths_buildresults.dat ${CACHE_SPECFILE}
fi
spack-python -c "exit(not len(spack.environment.active_environment().uninstalled_specs()))" && (
# fetch all sources but delay exit code handling
spack fetch --dependencies --missing && ret=$? || ret=$?;
if [ -n "${OCI_CACHE_PREFIX}" ] && [ "${UPDATE_SPACK_OCI_CACHES:-false}" = "true" ]; then
# push freshly fetched sources to remote cache
echo "Performing update of the source cache"
python3 ${YASHCHIKI_HOME}/update_cached_sources.py \
--local-cache=${SPACK_CACHE_SOURCE} \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/source_cache \
/tmp/missing_paths_sources.dat;
else
echo "Updating of the source cache disabled."
fi
if [ "$ret" -ne 0 ]; then
(exit $ret)
fi
)
if [ -n "${OCI_CACHE_PREFIX}" ]; then
# record the state of installed/uninstalled packages before actually installing them
dag_hashes_pre_install=$(spack-python ${YASHCHIKI_HOME}/specfile_dag_hash.py ${CACHE_SPECFILE})
fi
# install the environment, use 2 jobs to reduce the amount of required RAM # install the environment, use 2 jobs to reduce the amount of required RAM
spack install -y -j2 --fresh --test root # delay exit code until we have updated the cache below
spack install --no-check-signature -y -j$SPACK_JOBS --fresh --test root && spack_install_ret=$? || spack_install_ret=$?
# re-enable view
spack env view enable
spack env view regenerate
# no need to update the local cache nor the remote cache if we don't want to update
if [ -n "${OCI_CACHE_PREFIX}" ] && [ "${UPDATE_SPACK_OCI_CACHES:-false}" = "true" ]; then
# push previously missing (but now installed) packages to the local cache
for dag_hash in $dag_hashes_pre_install; do
spack buildcache create --unsigned --only package ${SPACK_CACHE_BUILD} /${dag_hash} && ret=$? || ret=$?
if [ $ret -ne 0 ]; then
echo "Failed to push ${dag_hash}, trying to call spack find on it:"
spack find -Lvp /${dag_hash} || true
fi
done
# upload packages from local to remote cache
echo "Performing update of the build cache"
python3 ${YASHCHIKI_HOME}/update_cached_buildresults.py \
--local-cache=${SPACK_CACHE_BUILD}/build_cache \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/build_cache \
/tmp/missing_paths_buildresults.dat
else
echo "Updating of the build cache disabled."
fi
# propagate spack install exit code
if [ $spack_install_ret -ne 0 ]; then
(exit "$spack_install_ret")
fi
# remove local cache content
if [ -d ${SPACK_CACHE_BUILD} ]; then
spack mirror destroy --mirror-name local_cache
fi
# TODO: when using spack remote OCI build caches require an index file
#spack mirror add ebrains oci://docker-registry.ebrains.eu/esd/build_cache
#spack buildcache list -a ebrains && ret=$? || ret=$?
# rebuild spack's database # rebuild spack's database
spack reindex spack reindex
...@@ -65,7 +194,7 @@ spack reindex ...@@ -65,7 +194,7 @@ spack reindex
# this needs deactivating the environment first: # this needs deactivating the environment first:
spack env deactivate spack env deactivate
unset SPACK_LD_LIBRARY_PATH unset SPACK_LD_LIBRARY_PATH
spack env activate --sh $EBRAINS_SPACK_ENV > $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh spack env activate --sh $EBRAINS_SPACK_ENV > ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh
# create modules files with spack # create modules files with spack
# spack module tcl refresh -y # spack module tcl refresh -y
......
# ensure compatability with Spack v0.18.0
try:
from spack.package_base import PackageStillNeededError
except:
from spack.package import PackageStillNeededError
needed = set()
# keep packages that are part of an environment
for e in spack.environment.all_environments():
needed.update(e.all_hashes())
# also keep packages that provide compilers (and their dependencies)
for c in spack.compilers.all_compiler_specs():
pkg_spec = spack.compilers.pkg_spec_for_compiler(c)
needed.update([dep.dag_hash() for pkg in spack.store.db.query(pkg_spec) for dep in pkg.traverse()])
installed = {spec.dag_hash(): spec for spec in spack.store.db.query()}
to_remove = set(installed) - needed
# this will try to uninstall ANY package that is not part of an environment
# including test dependencies
# for a list of all the packages that will be uninstalled:
print('The following packages will be uninstalled:')
print('\n'.join(sorted([installed[h].short_spec+' ('+h+')' for h in to_remove])))
# iteratively uninstall packages with no dependents
while to_remove:
# print('New iteration')
for hash in to_remove.copy():
spec = installed[hash]
try:
spec.package.do_uninstall()
to_remove.discard(hash)
except PackageStillNeededError:
pass
# print('Not ready to remove', spec.short_spec, 'in this iteration')
# Copyright 2013-2024 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 Acpype(PythonPackage):
"""A tool based in Python to use Antechamber to generate topologies for chemical
compounds and to interface with others python applications like CCPN and ARIA"""
# Homepage and download url
homepage = "https://github.com/alanwilter/acpype"
git = 'https://github.com/alanwilter/acpype.git'
url = 'https://github.com/alanwilter/acpype/archive/refs/tags/2022.7.21.tar.gz'
# Set the gitlab accounts of this package maintainers
maintainers = ['dbeltran']
# Versions
version('master', branch='master')
version('2022.7.21', sha256='5f7e6162d9a0aed2f770b9ccf5617ac1398a423cca815ae37cbf66d4cd62ea2f')
# Dependencies
depends_on('python@3.8:', type=('build', 'run'))
depends_on('ambertools')
depends_on('openbabel')
depends_on('py-poetry-core')
# Test
@run_after('install')
@on_package_attributes(run_tests=True)
def check_install (self):
python("-c", 'import acpype')
# Copyright 2013-2024 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 Ambertools(CMakePackage):
"""AmberTools is a free, useful standalone package and a prerequisite
for installing Amber itself. The AmberTools suite is free of charge,
and its components are mostly released under the GNU General Public
License (GPL). A few components are included that are in the public
domain or which have other, open-source, licenses. The libsander and
libpbsa libraries use the LGPL license."""
homepage = "https://ambermd.org/AmberTools.php"
url = "https://ambermd.org/downloads/AmberTools22jlmrcc.tar.bz2"
maintainers("d-beltran")
# begin EBRAINS (added): add version
version("23_rc6", sha256="debb52e6ef2e1b4eaa917a8b4d4934bd2388659c660501a81ea044903bf9ee9d")
# end EBRAINS
version("22jlmrcc", sha256="1571d4e0f7d45b2a71dce5999fa875aea8c90ee219eb218d7916bf30ea229121")
depends_on("flex", type="build")
depends_on("bison", type="build")
depends_on("tcsh", type="build")
depends_on("zlib", type=("build", "run"))
depends_on("bzip2", type=("build", "run"))
depends_on("blas", type=("build", "run"))
depends_on("lapack", type=("build", "run"))
depends_on("arpack-ng", type=("build", "run"))
depends_on("netcdf-c", type=("build", "run"))
depends_on("netcdf-fortran", type=("build", "run"))
depends_on("fftw", type=("build", "run"))
depends_on("readline", type=("build", "run"))
depends_on("netlib-xblas~plain_blas", type=("build", "run"))
# Specific variants needed for boost according to build logs
depends_on(
"boost+thread+system+program_options+iostreams+regex+timer+chrono+filesystem+graph",
type=("build", "run"),
)
# Python dependencies
# begin EBRAINS (modified): add version
depends_on("python@3.8:3.10 +tkinter", type=("build", "run"), when="@22jlmrcc")
depends_on("python@3.8: +tkinter", type=("build", "run"), when="@23_rc6")
# end EBRAINS
depends_on("py-setuptools", type="build")
depends_on("py-numpy", type=("build", "run"))
depends_on("py-matplotlib", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))
def cmake_args(self):
# Translated from ambertools build/run_cmake script
# We also add the TRUST_SYSTEM_LIBS argument mentioned in the ambertools guide
# https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Guide-to-Options
args = [
self.define("COMPILER", "GNU"),
self.define("MPI", False),
self.define("CUDA", False),
self.define("INSTALL_TESTS", True),
self.define("DOWNLOAD_MINICONDA", False),
self.define("TRUST_SYSTEM_LIBS", True),
# This is to avoid the x11 (X11_Xext_LIB) error
# It is equivalent to the "-noX11" flag accoridng to the docs:
# https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Common-Options
self.define("BUILD_GUI", False),
]
return args
def setup_run_environment(self, env):
env.set("AMBER_PREFIX", self.prefix)
env.set("AMBERHOME", self.prefix)
def setup_build_environment(self, env):
env.set("AMBER_PREFIX", self.prefix)
env.set("AMBERHOME", self.prefix)
@run_after("install")
@on_package_attributes(run_tests=True)
def check_install(self):
make("test.serial")
# Temporarily copy netcdf.h header file to netcdf-fortran/include to pass the Ambertools
# cmake check (quickest fix, will probably cause problems, needs to change)
@run_before("cmake")
def fix_check(self):
cp = Executable("cp")
cp(
self.spec["netcdf-c"].headers.directories[0] + "/netcdf.h",
self.spec["netcdf-fortran"].headers.directories[0],
)
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
from spack import *
class Apbs(CMakePackage): class Apbs(CMakePackage):
...@@ -30,7 +29,7 @@ class Apbs(CMakePackage): ...@@ -30,7 +29,7 @@ class Apbs(CMakePackage):
version('3.4.0', sha256='572ff606974119430020ec948c78e171d8525fb0e67a56dad937a897cac67461') version('3.4.0', sha256='572ff606974119430020ec948c78e171d8525fb0e67a56dad937a897cac67461')
# Dependencies. # Dependencies.
depends_on('cmake@3.19', type=('build')) depends_on('cmake@3.19:', type=('build'))
depends_on('bison', type=('build')) depends_on('bison', type=('build'))
depends_on('flex', type=('build')) depends_on('flex', type=('build'))
depends_on('swig', type=('build')) depends_on('swig', type=('build'))
...@@ -39,23 +38,27 @@ class Apbs(CMakePackage): ...@@ -39,23 +38,27 @@ class Apbs(CMakePackage):
depends_on('boost', type=('build', 'run')) depends_on('boost', type=('build', 'run'))
depends_on('blas', type=('build', 'run')) depends_on('blas', type=('build', 'run'))
depends_on('arpack-ng', type=('build', 'run')) depends_on('arpack-ng', type=('build', 'run'))
depends_on('suite-sparse+tbb', type=('build', 'run')) depends_on('suite-sparse', type=('build', 'run'))
depends_on('maloc', type=('build', 'run')) depends_on('maloc', type=('build', 'run'))
depends_on('python@3.8:3.10', type=('build', 'run')) depends_on('python@3.8:3.11', type=('build', 'run'))
def cmake_args(self): def cmake_args(self):
# Min and max Python versions need to be set as variables to pass tests. # Min and max Python versions need to be set as variables to pass tests.
# See tests/CMakeLists.txt lines 6-14. # See tests/CMakeLists.txt lines 6-14.
python_version = str(self.spec['python'].version) python_version = str(self.spec['python'].version)
args = [ args = [
'-DPYTHON_MIN_VERSION='+python_version, self.define('PYTHON_MIN_VERSION', python_version),
'-DPYTHON_MAX_VERSION='+python_version self.define('PYTHON_MAX_VERSION', python_version),
] self.define('BLAS_FOUND', True),
self.define('BLAS_INCLUDE_DIRS', self.spec['blas'].prefix.include),
self.define('BLAS_LIBRARIES', self.spec['blas'].libs.joined(';'))
]
return args return args
def setup_build_environment(self, env): def setup_build_environment(self, env):
# add suite-sparse libs to path because tests can't find them # add suite-sparse libs to path because tests can't find them
env.prepend_path("LD_LIBRARY_PATH", self.spec['suite-sparse'].prefix.lib) env.prepend_path('LD_LIBRARY_PATH', self.spec['suite-sparse'].prefix.lib)
env.prepend_path('LD_LIBRARY_PATH', self.spec['blas'].prefix.lib)
def setup_dependent_build_environment(self, env, dependent_spec): def setup_dependent_build_environment(self, env, dependent_spec):
self.setup_build_environment(env) self.setup_build_environment(env)
......