Spack is a package management tool designed to support multiple versions and configurations of software on a wide variety of platforms and environments. It was designed for large supercomputing centers, where many users and application teams share common installations of software on clusters with exotic architectures, using libraries that do not have a standard ABI. Spack is non-destructive: installing a new version does not break existing installations, so many configurations can coexist on the same system. Most importantly, Spack is simple. It offers a simple spec syntax so that users can specify versions and configuration options concisely. Spack is also simple for package authors: package files are written in pure Python, and specs allow package authors to maintain a single file for many different builds of the same package.
$ spack install --add intel-oneapi-compilers@2021.4.0 # Add the compilers to your compilers.yaml so spack can use them: # For 2023.x and earlier versions, use: $ spack compiler add `spack location -i intel-oneapi-compilers@2021.4.0`/compiler/latest/linux/bin/intel64 $ spack compiler add `spack location -i intel-oneapi-compilers@2021.4.0`/compiler/latest/linux/bin # Verify that the compilers are available: $ spack compiler list $ spack location -i intel-oneapi-compilers@2021.4.0
which mpiicc && mpiicc --version which mpiifort && mpiifort --version which mpiicpc && mpiicpc --version which icc && icc --version which ifort && ifort --version
Additionally, install curl and cmake,
1 2 3 4
$ spack info --all curl $ spack install --add curl%intel $ spack info --all cmake $ spack install --add cmake%intel
#------------------------------------------------# #Author: wpsze #Email: #date: #Version: #Description: The purpose of the script #Copyright (C): 2022 All rights reserved #------------------------------------------------#
which mpiicc && mpiicc --version which mpiifort && mpiifort --version which mpiicpc && mpiicpc --version which icc && icc --version which ifort && ifort --version
which mpiicc && mpiicc --version which mpiifort && mpiifort --version which mpiicpc && mpiicpc --version which icc && icc --version which ifort && ifort --version
echo$HOME echo$download_DIR echo$libs_DIR
mpiicc --version mpiifort --version
echo$HOME echo$download_DIR echo$libs_DIR
mkdir -p mpas_install mkdir -p Library
do_download=False # True or False compile_all=True
############################## zlib ############################ *** zlib test OK *** if [[ ${do_zlib} == True ]]; then echo"=== zlib ====" cd$download_DIR tar xvf zlib-1.2.13.tar.gz 1>/dev/null 2>&1 cd zlib-1.2.13/
./configure --prefix=$libs_DIR#--static make -j 4 make install make check cd .. rm -rf zlib-1.2.13 echo"=== zlib (end) ====" fi
############################## HDF5 ############################ if [[ ${do_hdf5} == True ]]; then echo"=== hdf5 ====" cd$download_DIR tar xvf hdf5-1.12.0.tar.gz 1>/dev/null 2>&1 cd hdf5-1.12.0/
./configure --prefix=$libs_DIR --enable-parallel --with-zlib=$libs_DIR --enable-fortran #--disable-shared make -j 4 make check make install cd .. rm -rf hdf5-1.12.0 echo"=== hdf5 (end) ====" fi
############################## pnetcdf ############################ PnetCDF has been successfully installed if [[ ${do_pnetcdf} == True ]]; then echo"=== pnetcdf ====" cd$download_DIR tar xvf pnetcdf-1.11.2.tar.gz 1>/dev/null 2>&1 cd pnetcdf-1.11.2/
./configure --prefix=$libs_DIR make -j 4 make check make ptest make testing make install cd .. rm -rf pnetcdf-1.11.2 echo"=== pnetcdf (end) ====" fi
############################## netcdf-C ############################ Congratulations! You have successfully installed netCDF! if [[ ${do_netcdfC} == True ]]; then echo"=== netcdf-C ====" ## -disable-dap:--disable-dap的原因是缺少一个‘curl’的lib ## 4.1.3以后的版本Fortran和C分开了。把disable--netcdf-4 写进去也无所谓 cd$download_DIR tar xvf netcdf-c-4.7.4.tar.gz 1>/dev/null 2>&1 cd netcdf-c-4.7.4/
make -j 4 make check make install cd .. rm -rf netcdf-fortran-4.5.3 echo"=== netcdf-F (end) ====" fi
############################## Pio ############################ if [[ ${do_pio} == True ]]; then echo"=== PIO ====" cd$download_DIR tar xvf ParallelIO-pio2_5_8.tar.gz 1>/dev/null 2>&1 cd ParallelIO-pio2_5_8/
#./configure --prefix=$libs_DIR --enable-fortran #cmake -DNetCDF_C_PATH=$libs_DIR -DNetCDF_Fortran_PATH=$libs_DIR -DPnetCDF_PATH=$libs_DIR -DPIO_ENABLE_TIMING=OFF -DCMAKE_INSTALL_PREFIX=$libs_DIR cmake -DNetCDF_C_PATH=$NETCDF -DNetCDF_Fortran_PATH=$NETCDF -DPnetCDF_PATH=$PNETCDF -DHDF5_PATH=$libs_DIR -DCMAKE_INSTALL_PREFIX=$libs_DIR -DPIO_USE_MALLOC=ON -DCMAKE_VERBOSE_MAKEFILE=1 -DPIO_ENABLE_TIMING=OFF ./ make #make check make install cd .. rm -rf ParallelIO-pio2_5_8 echo"=== PIO (end) ====" fi
############################## metis ############################ if [[ ${do_metis} == True ]]; then echo"=== metis ===="
## metis is serial export CC=icc export CXX=icpc export FC=ifort export F77=ifort export F90=ifort
cd$download_DIR tar xvf metis-5.1.0.tar.gz 1>/dev/null 2>&1 cd metis-5.1.0/ #./configure --prefix=$libs_DIR
make config prefix=$libs_DIR make #make check make install cd .. rm -rf metis-5.1.0 echo"=== metis (end) ====" fi
where use mpif90/mpicc/mpicxx but now we want to use mpiifort/mpiicc/mpiicpc.
1 2 3 4 5 6 7 8 9 10
# After reading your comment I decided to edit the Makefile, and in the lines of ifort I made the following change: # Code: ifort: ( $(MAKE) all \ "FC_PARALLEL = mpiifort" \ "CC_PARALLEL = mpiicc" \ "CXX_PARALLEL = mpiicpc" \ "FC_SERIAL = ifort" \ "CC_SERIAL = icc" \ "CXX_SERIAL = icpc" \