– The C compiler identification is GNU 9.4.0
– The CXX compiler identification is GNU 9.4.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS) (Required is at least version “3”)
– Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS) (Required is at least version “3”)
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND) (Required is at
least version “3”)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindMPI.cmake:1688 (find_package_handle_standard_args)
CMakeLists.txt:86 (find_package)
– Configuring incomplete, errors occurred!
See also “/home/fenics/dolfinx/cpp/CMakeFiles/CMakeOutput.log”.
See also “/home/fenics/dolfinx/cpp/CMakeFiles/CMakeError.log”.
I am attaching the CMakeError.log and CMakeOutput.log file.
Yes, to compile from source, you need to have every dependency installed on your system.
Since you are using Ubuntu, you can install most of them with apt.
However, do not install basix, ffcx, and ufl from apt, they are old versions that are not compatible for compiling the main branch of dolfinx. I recommend you to also build these from source, and install C++ and python interface to your system before attempting to compile dolfinx.
(base) fenics@DESKTOP-CVH2BNB:~/basix/cpp$ cmake -DCMAKE_BUILD_TYPE=Release -B build-dir -S .
– The CXX compiler identification is GNU 9.4.0
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Performing Test arch_native_supported
– Performing Test arch_native_supported - Success
– Looking for sgemm_
– Looking for sgemm_ - not found
– Looking for C++ include pthread.h
– Looking for C++ include pthread.h - found
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Found Threads: TRUE
CMake Error at /home/fenics/.spack/Spack/opt/spack/linux-ubuntu20.04-skylake/gcc-9.4.0/cmake-3.23.2-i6y3jvftz2gzsttrd5tmqdpa77rj5cs5/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
/home/fenics/.spack/Spack/opt/spack/linux-ubuntu20.04-skylake/gcc-9.4.0/cmake-3.23.2-i6y3jvftz2gzsttrd5tmqdpa77rj5cs5/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/home/fenics/.spack/Spack/opt/spack/linux-ubuntu20.04-skylake/gcc-9.4.0/cmake-3.23.2-i6y3jvftz2gzsttrd5tmqdpa77rj5cs5/share/cmake-3.23/Modules/FindBLAS.cmake:1337 (find_package_handle_standard_args)
CMakeLists.txt:66 (find_package)
– Configuring incomplete, errors occurred!
See also “/home/fenics/basix/cpp/build-dir/CMakeFiles/CMakeOutput.log”.
See also “/home/fenics/basix/cpp/build-dir/CMakeFiles/CMakeError.log”.
(base) fenics@DESKTOP-CVH2BNB:~/spack$ ls
CHANGELOG.md COPYRIGHT LICENSE-MIT README.md bin lib pyproject.toml share
CITATION.cff LICENSE-APACHE NOTICE SECURITY.md etc opt pytest.ini var
(base) fenics@DESKTOP-CVH2BNB:~/spack$ cd share/
(base) fenics@DESKTOP-CVH2BNB:~/spack/share$ ls
spack
(base) fenics@DESKTOP-CVH2BNB:~/spack/share$ cd spack/
(base) fenics@DESKTOP-CVH2BNB:~/spack/share/spack$ ls
bash csh docs keys qa setup-env.fish setup-env.sh spack-completion.bash
bootstrap docker gitlab logo setup-env.csh setup-env.ps1 setup-tutorial-env.sh templates
(base) fenics@DESKTOP-CVH2BNB:~/spack/share/spack$ bash setup-env.sh
(base) fenics@DESKTOP-CVH2BNB:~/spack/share/spack$ spack env create fenicsx-env
(base) fenics@DESKTOP-CVH2BNB:~/spack/share/spack$ spack env activate fenicsx-env
(base) fenics@DESKTOP-CVH2BNB:~/spack/share/spack$ spack add py-fenics-dolfinx cflags="-O3" fflags="-O3"
==> Adding py-fenics-dolfinx cflags="-O3" fflags="-O3" to environment fenicsx-env
(base) fenics@DESKTOP-CVH2BNB:~/spack/share/spack$ spack install
(I am posting the last error output. I am not posting the intermediate outputs)
==> Error: py-fenics-dolfinx-0.4.1-qfej72m2pmkr7mznswteim3hk7qydmsz: Package was not installed
==> Updating view at /home/fenics/.spack/Spack/var/spack/environments/fenicsx-env/.spack-env/view
==> Error: Installation request failed. Refer to reported errors for failing package(s).
fenics@DESKTOP-CVH2BNB:~$ gfortran --version
GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
When I run $ spack install, I get below stack details with error:
I am unable to post the output here (because of the word limit). So I am attaching the output in a jpeg image format. I am allowed to attach 5 images with this message. So I am attaching the output image in jpeg (only the error portions of the output) in a chronological order.
It looks like spack is not aware of your gfortran installation. Maybe you installed gfortran after creating the spack environment?
Can you try running the following command
spack compiler find
this will force a scan of all available compilers.
After that, if the same error occurs, please post the output of
fenics@DESKTOP-CVH2BNB:~$ spack compiler find
==> Found no new compilers
==> Compilers are defined in the following files:
/home/fenics/.spack/linux/compilers.yaml
fenics@DESKTOP-CVH2BNB:~$ spack compiler info gcc
gcc@9.4.0:
paths:
cc = /usr/bin/gcc
cxx = /usr/bin/g++
f77 = None
fc = None
modules =
operating system = ubuntu20.04
That’s weird. Not sure why spack is unable to find your fortran compiler.
Not 100% sure it’s gonna help, but you can try editing the /home/fenics/.spack/linux/compilers.yaml file manually into something like this:
spec: gcc@9.4.0:
paths:
cc = /usr/bin/gcc
cxx = /usr/bin/g++
f77 = /usr/bin/gfortran
fc = /usr/bin/gfortran
After updating /home/fenics/.spack/linux/compilers.yaml file manually as you said, the finding compilers error has been solved. Now the new error comes. I have attached the screenshot showing error with this mail. Please help.
There is a good news I guess. I have run $spack install again and it is installed (I guess) with no error. Now, can you tell me how to run a test case e.g. poisson_demo.py after installing spack?
command ‘fpack’ from deb libcfitsio-bin (3.470-3)
command ‘mpack’ from deb mpack (1.6-8.2)
command ‘stack’ from deb haskell-stack (1.9.3.1-1)
command ‘cpack’ from deb cmake (3.16.3-1ubuntu1)
command ‘ipack’ from deb exult-studio (1.2-18build1)
command ‘slack’ from deb slack (1:0.15.2-9)
command ‘apack’ from deb atool (0.39.0-10)
command ‘hpack’ from deb hpack (0.31.2-1)
command ‘spock’ from deb python3-sardana (3.0.2a0+34.9f6895-1)
command ‘pack’ from deb liballegro4-dev (2:4.4.3.1-1)