I’m trying to install fenicsx on an HPC using spack
I followed the github instructions for spack.
module load gcc/13.1.0
module list # => verif gcc ok
cd /home/$USER/git
git clone https://github.com/spack/spack.git
. ./spack/share/spack/setup-env.sh
spack env create fenicsxenv
spack env activate fenicsxenv
spack add fenics-dolfinx+adios2 py-fenics-dolfinx cflags=-O3 fflags=-O3
spack concretize --force
cat ./spack/var/spack/environments/fenicsxenv/spack.yaml # verif compilers ok
spack install
Wich always results as
==> Error: ProcessError: Command exited with status 1:
'/tmp/spack-stage/spack-stage-expat-2.6.2-6zcxdsvhtdoowjfljdznplbzn5omvqzz/spack-src/configure' '--prefix=/home/$USER/git/spack/opt/spack/linux-rhel8-zen4/gcc-13.1.0/expat-2.6.2-6zcxdsvhtdoowjfljdznplbzn5omvqzz' '--without-docbook' '--enable-static' '--with-libbsd'
1 error found in build log:
127 checking whether byte ordering is bigendian... no
128 checking for an ANSI C-conforming const... yes
129 checking for size_t... yes
130 checking whether /home/$USER/git/spack/lib/spack/env/gcc/g++ supports C++11 features with -std=c++11... yes
131 checking for cos in -lm... yes
132 checking for arc4random_buf in -lbsd... no
>> 133 **configure: error: Enforced use of libbsd cannot be satisfied**.
If someone could help,
Thanks in advance.
Thank you for your reply !
I followed your link up to this one
opened 09:18PM - 08 Nov 23 UTC
build-error
### Steps to reproduce the issue
```console
$ spack install expat@2.5.0%gcc@… 11.2.0
...
```
### Error message
<details><summary>Error message</summary>
==> expat: Executing phase: 'configure'
==> Error: ProcessError: Command exited with status 1:
'/scratch/alpine/kfotso@xsede.org/spack/spack-stage/spack-stage-expat-2.5.0-5h35m36ce3fee5xfsqw5koj3uaimx3l3/spack-src/configure' '--prefix=/projects/kfotso@xsede.org/software/spack/linux-rhel8-zen3/gcc-11.2.0/expat-2.5.0-5h35m36ce3fee5xfsqw5koj3uaimx3l3' '--without-docbook' '--enable-static' '--with-libbsd'
1 error found in build log:
123 checking whether compiler supports visibility... yes
124 checking whether byte ordering is bigendian... no
125 checking for an ANSI C-conforming const... yes
126 checking for size_t... yes
127 checking for cos in -lm... yes
128 checking for arc4random_buf in -lbsd... no
>> 129 configure: error: Enforced use of libbsd cannot be satisfied.
See build log for details:
/scratch/alpine/kfotso@xsede.org/spack/spack-stage/spack-stage-expat-2.5.0-5h35m36ce3fee5xfsqw5koj3uaimx3l3/spack-build-out.txt
<pre>
...
</pre></details>
### Information on your system
Spack version is 0.20.1
OS: RedHat 8.4
[spack_debug_report.txt](https://github.com/spack/spack/files/13301015/spack_debug_report.txt)
Attached is the config.log file located in spack/spack-stage/spack-stage-expat-2.5.0-lccres6otojn6jkk5a6x6tno3wfag6jq/spack-src/config.log
[config_spack_stage_expat.log](https://github.com/spack/spack/files/13301029/config_spack_stage_expat.log)
Attached is also the output file from spack config blame
[spack_config_blame.log](https://github.com/spack/spack/files/13301037/spack_config_blame.log)
### Additional information
@scheibelp
When investigating the config_spack_stage_expat.log it appears that the following line is problematic.
```
/projects/kfotso@xsede.org/software/spack/linux-rhel8-zen3/gcc-11.2.0/libbsd-0.11.7-ummjwfjzqhyv7u2p2o7lrbeydzrkfoul/lib/libbsd.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
```
When changing directory to spack/linux-rhel8-zen3/gcc-11.2.0/libbsd-0.11.7-ummjwfjzqhyv7u2p2o7lrbeydzrkfoul/lib and assessing the type of files associated with libbsd.so and libbsd.so.0.11.7 I get the following
```
[kfotso@xsede.org@login-ci1]$ file libbsd.so.0.11.7
libbsd.so.0.11.7: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not stripped
[kfotso@xsede.org@login-ci1 lib]$ file libbsd.so
libbsd.so: ASCII text
```
Short term solution:
It looks like removing the libbsd.so file and symlinking libbsd.so.0.11.7 to libbsd.so fixed the issue.
Interestingly, this issue seems to only affect ACCESS/XSEDE users on our cluster. It appears that other users
on our cluster did not have any issue with the libbsd.so file, even though it was : ASCII text.
Finally the very same issue occured with the system compiler gcc version 8.5.0
Let me know if you need more information
Below if the build file
[spack-build-out-2.txt](https://github.com/spack/spack/files/13301329/spack-build-out-2.txt)
### General information
- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate
Which solved the issue (removing libbsd.so in the spack directories and linking libbsd.so toward libbsd.so.X.Y.Z instead)