Spack configuration to build / install Xyce with ADMS plugins enabled

55 views
Skip to first unread message

Renaud Gillon

unread,
Jan 19, 2022, 6:58:16 AM1/19/22
to xyce-users
Hello,

The attached package.py allowed me to install Xyce with the ADMS plugins enabled using spack. I ran the 7.4 test-suite and all tests passed. The package.py takes care about the interaction between +plugins and +shared and declares an incompatibility between ~shared and +plugins

Tested only for the serial build. Second attachment summarizes the test results.

The spack command (run with the attached file install to define a local xyce package) was :  spack install xyce -mpi +pymi +plugins


Renaud
package.py
test_results

Ken Martin

unread,
Jan 31, 2022, 3:18:22 PM1/31/22
to xyce-users
spack install xyce -mpi +pymi +plugins
Error: trying to set variant "plugins" in package "xyce", but the package has no such variant [happened during concretization of xyce~mpi+plugins+pymi]

Also tried:
> sudo python ./package.py
Traceback (most recent call last):
  File "./package.py", line 9, in <module>
    class Xyce(CMakePackage):
NameError: name 'CMakePackage' is not defined
> python package.py
Traceback (most recent call last):
  File "package.py", line 9, in <module>
    class Xyce(CMakePackage):
NameError: name 'CMakePackage' is not defined
>

Any help? Thanks.

xyce-users

unread,
Jan 31, 2022, 6:26:02 PM1/31/22
to xyce-users
Hello, you can't run the package.py files directly. If you were to use the file provided by Renaud, you would have to replace the existing ../var/spack/repos/builtin/packages/xyce/package.py file with the one provided and then invoke `spack install ...`

There is now a PR open with a `+plugin` variant option, based off of Renaud's contribution (note that the PR uses `+plugin`, rather than `+plugins`).

You can check the status at:

Renaud Gillon

unread,
Feb 1, 2022, 3:41:50 AM2/1/22
to xyce-users
Hello,

Untill the PR (pull request) is accepted in the main spack repository, the custom package.py file has to be placed in a local configuration. The steps are as folllows:

1) Ensure you have a python 2.7 or 3.5-3.9 available on your system; Also a recent compiler (I am using GCC 7.4, which is not the most recent). 

2) See spack installation instructions at https://spack.readthedocs.io/en/latest/getting_started.html#installation. Basically very easy, just a "git clone ...." command one can execute litterally.

3) Activate the shell support of spack as per instructions at https://spack.readthedocs.io/en/latest/getting_started.html#shell-support.


5) Adapt the compiler configuration to your needs as per https://spack.readthedocs.io/en/latest/getting_started.html#compiler-configuration.

6) Create a local pacakge repository following instructions at https://spack.readthedocs.io/en/latest/repositories.html#spack-repo-create. Then add it to the list of active repositories according to https://spack.readthedocs.io/en/latest/repositories.html#spack-repo-add.

7) Add the package.py provided in a subdirectory of the newly created local repository, eg. ~/<repo_root_dir>/<name_space_dir>/packages/xyce/ where <repo_root_dir> is the name of the repository's root directory, and <name_space_dir> is the name of a name-space inside it (if assigned by default it will match the repository name).

8) Check that the ~/<repo_root_dir>/<name_space_dir>/repo.yaml file defines the corresponding name-space (https://spack.readthedocs.io/en/latest/repositories.html#namespaces).

9) Edit your ~/.spack/repos.yaml file to place your new local repository with higher precedence than the default one (https://spack.readthedocs.io/en/latest/repositories.html#repos-yaml  and https://spack.readthedocs.io/en/latest/repositories.html#overriding-built-in-packages).

Now you are set to run the command listed previously "spack install xyce -mpi +pymi +plugins". Normally it will install ADMS as part of the dependencies (on my side, I had installed it manully upfront with "spack install adms").
The instructions (1) till (5) are the standard installation steps for spack. (5) to (9) are the customization steps needed to use the customized xyce package. Once the PR https://github.com/spack/spack/pull/28698  is accepted and executed, these steps will not be necessary anymore,  and in particular step (9) should be reversed to gain access to the "official" package.

Once the installation is complete, ADMS and Xyce need to be "loaded" into your shell environment as described at https://spack.readthedocs.io/en/latest/basic_usage.html#using-installed-packages.

Then the Xyce test-suite can be run, taking into account that it requires the Numpy and Scipy packages to be installed, and that spack tends to load "its own python" along with Xyce (probably because of the +pymi option), which by default does not have those packages installed. I chose to solve that issue by unloading the spack installed python to rely on my preferred python installation (which has many packages installed).  The unload commands (in bash) are as follows:

spack unload python
spack unload py-pip
spack unload py-pybind11
spack unload py-setuptools


Once this had been done, most of the  2500+ tests passed with maybe the exception of a couple (less than 10 failures -- see attached test results above).

Success !


Renaud

xyce-users

unread,
Feb 1, 2022, 4:03:33 PM2/1/22
to xyce-users
Hello Renaud,

   Thank you for the detailed spack installation directions. The PR at https://github.com/spack/spack/pull/28698 is now merged. With a fresh clone of spack, steps #6-9 should no longer be necessary (but steps #1-5 certainly are). 

Again, please note that in the PR we used `+plugin` as opposed to `+plugins` to keep plurality consistent with Xyce_PLUGIN_SUPPORT.

Reply all
Reply to author
Forward
0 new messages