|
75 | 75 | eval "$(${MICROMAMBA_EXE} shell hook -s bash)"
|
76 | 76 |
|
77 | 77 | # Create a QE environment with all required dependencies
|
78 |
| -echo "Creating Quantum ESPRESSO environment with dependencies..." |
79 |
| -micromamba create -n ${QE_ENV_NAME} -c conda-forge -y \ |
| 78 | +if [[ "$OS" == "darwin" ]]; then |
| 79 | + echo "Setting up QE environment for macOS..." |
| 80 | + |
| 81 | + # Use gfortran_osx-64 or system gfortran |
| 82 | + if [[ "$ARCH" == "x86_64" ]]; then |
| 83 | + # Intel macOS |
| 84 | + micromamba create -n ${QE_ENV_NAME} -c conda-forge -y \ |
| 85 | + gfortran_osx-64 cmake=3.31.6 ninja openmpi mpi4py \ |
| 86 | + fftw libxc scalapack hdf5 zlib blas lapack openblas \ |
| 87 | + wget git python |
| 88 | + elif [[ "$ARCH" == "arm64" ]]; then |
| 89 | + # Apple Silicon – safer to use system gfortran (e.g. via Homebrew) |
| 90 | + micromamba create -n ${QE_ENV_NAME} -c conda-forge -y \ |
| 91 | + cmake=3.31.6 ninja openmpi mpi4py \ |
| 92 | + fftw libxc scalapack hdf5 zlib blas lapack openblas \ |
| 93 | + wget git python |
| 94 | + fi |
| 95 | + |
| 96 | +else |
| 97 | + echo "Setting up QE environment for Linux..." |
| 98 | + |
| 99 | + # On Linux, use conda-forge compilers |
| 100 | + micromamba create -n ${QE_ENV_NAME} -c conda-forge -y \ |
80 | 101 | gfortran compilers cmake=3.31.6 ninja \
|
81 | 102 | openmpi mpi4py \
|
82 | 103 | fftw libxc scalapack hdf5 zlib blas lapack openblas \
|
83 | 104 | wget git python
|
| 105 | +fi |
84 | 106 |
|
85 | 107 | # Activate the QE environment
|
86 | 108 | micromamba activate ${QE_ENV_NAME}
|
@@ -114,12 +136,6 @@ CMAKE_OPTS="
|
114 | 136 | -DQE_ENABLE_LIBXC=OFF
|
115 | 137 | "
|
116 | 138 |
|
117 |
| -# On macOS ARM, disable offloading |
118 |
| -if [[ "$ARCH" == "arm64" ]]; then |
119 |
| - echo "Detected Apple Silicon – disabling QE offload support." |
120 |
| - CMAKE_OPTS+=" -DQE_ENABLE_OFFLOAD=OFF" |
121 |
| -fi |
122 |
| - |
123 | 139 | cmake .. $CMAKE_OPTS
|
124 | 140 |
|
125 | 141 | # Build and install
|
|
0 commit comments