Installing Fenics using Spack

I am following the instructions of installing fenics from the github readme. The installation fails when trying to install py-fenics-dolfinx and spack stops running.

[+] /home/patrick/spack/opt/spack/linux-ubuntu22.04-skylake_avx512/gcc-11.3.0/metis-5.1.0-tmxbxt7urbxjmhbtvzuoj3znlfxypoo4
==> Installing fenics-ufcx-0.5.0-drriawf5rn3sarrmtykqcvgitezuay3q
==> No binary for fenics-ufcx-0.5.0-drriawf5rn3sarrmtykqcvgitezuay3q found: installing from source
==> Fetching https://github.com/FEniCS/ffcx/archive/v0.5.0.tar.gz
==> No patches needed for fenics-ufcx
==> fenics-ufcx: Executing phase: ‘cmake’
==> fenics-ufcx: Executing phase: ‘build’
==> fenics-ufcx: Executing phase: ‘install’
==> fenics-ufcx: Successfully installed fenics-ufcx-0.5.0-drriawf5rn3sarrmtykqcvgitezuay3q
Fetch: 1.54s. Build: 0.58s. Total: 2.12s.
[+] /home/patrick/spack/opt/spack/linux-ubuntu22.04-skylake_avx512/gcc-11.3.0/fenics-ufcx-0.5.0-drriawf5rn3sarrmtykqcvgitezuay3q
==> Error: py-fenics-dolfinx-0.5.1-asohrdf7ofl4pwsbvpx5zompx6vxiz5g: Package was not installed
==> Updating view at /home/patrick/spack/var/spack/environments/fenicsx-env/.spack-env/view
==> Error: Installation request failed. Refer to reported errors for failing package(s).

These are last couple lines from first run
Then I ran it again and saw this error in the beginning

==> Installing libxml2-2.10.1-ffbv3v3g6gsewbdzjwxma6bnxarrqbo2
==> No binary for libxml2-2.10.1-ffbv3v3g6gsewbdzjwxma6bnxarrqbo2 found: installing from source
==> Cannot find version 2.10.1 in url_list
==> Error: FetchError: All fetchers failed for spack-stage-libxml2-2.10.1-ffbv3v3g6gsewbdzjwxma6bnxarrqbo2

/home/patrick/spack/lib/spack/spack/package_base.py:1468, in do_fetch:
1465
1466 self.stage.create()
1467 err_msg = None if not self.manual_download else self.download_instr

1468 start_time = time.time()
1469 self.stage.fetch(mirror_only, err_msg=err_msg)
1470 self._fetch_time = time.time() - start_time
1471

Also when running spack --debug install … I get this

==> [2022-11-10-11:42:16.913134] Reading config from file /home/patrick/spack/var/spack/environments/fenicsx-env/spack.yaml
==> [2022-11-10-11:42:16.915567] Using environment ‘fenicsx-env’
==> [2022-11-10-11:42:16.920774] Imported install from built-in commands
==> [2022-11-10-11:42:16.922353] Imported install from built-in commands
==> [2022-11-10-11:42:16.923149] LexError: Invalid character, ‘.’, in ‘…’ at index 0
==> [2022-11-10-11:42:16.923214] Error: Invalid character, ‘.’, in ‘…’ at index 0
Traceback (most recent call last):
File “/home/patrick/spack/lib/spack/spack/main.py”, line 1007, in main
return _main(argv)
File “/home/patrick/spack/lib/spack/spack/main.py”, line 962, in _main
return finish_parse_and_run(parser, cmd_name, env_format_error)
File “/home/patrick/spack/lib/spack/spack/main.py”, line 990, in finish_parse_and_run
return _invoke_command(command, parser, args, unknown)
File “/home/patrick/spack/lib/spack/spack/main.py”, line 639, in _invoke_command
return_val = command(parser, args)
File “/home/patrick/spack/lib/spack/spack/cmd/install.py”, line 531, in install
abstract_specs, concrete_specs = specs_from_cli(args, install_kwargs, reporter)
File “/home/patrick/spack/lib/spack/spack/cmd/install.py”, line 444, in specs_from_cli
abstract_specs = spack.cmd.parse_specs(args.spec)
File “/home/patrick/spack/lib/spack/spack/cmd/init.py”, line 224, in parse_specs
specs = spack.spec.parse(sargs)
File “/home/patrick/spack/lib/spack/spack/spec.py”, line 5410, in parse
return SpecParser().parse(string)
File “/home/patrick/spack/lib/spack/spack/parse.py”, line 159, in parse
self.setup(text)
File “/home/patrick/spack/lib/spack/spack/parse.py”, line 156, in setup
self.push_tokens(self.lexer.lex(text))
File “/home/patrick/spack/lib/spack/spack/parse.py”, line 90, in lex
tokens = self.lex_word(word)
File “/home/patrick/spack/lib/spack/spack/parse.py”, line 83, in lex_word
raise LexError(msg, word, word.index(remainder))
spack.parse.LexError: Invalid character, ‘.’, in ‘…’ at index 0

Any help would be much appreciated!

Can you share the exact command you ran to install py-fenics-dolfinx and I’ll give it a go?

I actually successfully got it to build, what I did was delete any traces of dolfinx/basix from my system installations and it appears to be working right now!

2 Likes