|
62 | 62 | "conda": { |
63 | 63 | "environment_name": "mhkit-matlab-env", |
64 | 64 | "create": "conda create -n <conda_env> python=<python_version> -y", |
| 65 | + "miniconda_urls": { |
| 66 | + "mac_arm": "https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh", |
| 67 | + "mac_intel": "https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh", |
| 68 | + "linux": "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh", |
| 69 | + "windows": "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" |
| 70 | + }, |
| 71 | + "detection": { |
| 72 | + "common_paths": { |
| 73 | + "unix": [ |
| 74 | + "~/miniconda3/bin/conda", |
| 75 | + "~/miniconda3/condabin/conda", |
| 76 | + "~/anaconda3/bin/conda", |
| 77 | + "~/anaconda3/condabin/conda", |
| 78 | + "/opt/miniconda3/bin/conda", |
| 79 | + "/opt/miniconda3/condabin/conda", |
| 80 | + "/opt/anaconda3/bin/conda", |
| 81 | + "/opt/anaconda3/condabin/conda", |
| 82 | + "/usr/local/miniconda3/bin/conda", |
| 83 | + "/usr/local/miniconda3/condabin/conda", |
| 84 | + "/usr/local/anaconda3/bin/conda", |
| 85 | + "/usr/local/anaconda3/condabin/conda", |
| 86 | + "/usr/bin/conda", |
| 87 | + "/usr/local/bin/conda", |
| 88 | + "~/.local/bin/conda", |
| 89 | + "/opt/homebrew/bin/conda", |
| 90 | + "/opt/homebrew/condabin/conda", |
| 91 | + "/usr/local/Caskroom/miniconda/base/bin/conda", |
| 92 | + "/usr/local/Caskroom/miniconda/base/condabin/conda" |
| 93 | + ], |
| 94 | + "windows": [ |
| 95 | + "%USERPROFILE%\\miniconda3\\Scripts\\conda.exe", |
| 96 | + "%USERPROFILE%\\miniconda3\\condabin\\conda.bat", |
| 97 | + "%USERPROFILE%\\Miniconda3\\Scripts\\conda.exe", |
| 98 | + "%USERPROFILE%\\Anaconda3\\Scripts\\conda.exe", |
| 99 | + "%USERPROFILE%\\anaconda3\\Scripts\\conda.exe", |
| 100 | + "C:\\ProgramData\\Miniconda3\\Scripts\\conda.exe", |
| 101 | + "C:\\ProgramData\\Anaconda3\\Scripts\\conda.exe", |
| 102 | + "C:\\tools\\miniconda3\\Scripts\\conda.exe", |
| 103 | + "C:\\tools\\Miniconda3\\Scripts\\conda.exe", |
| 104 | + "%LOCALAPPDATA%\\Continuum\\miniconda3\\Scripts\\conda.exe", |
| 105 | + "%LOCALAPPDATA%\\Continuum\\anaconda3\\Scripts\\conda.exe" |
| 106 | + ] |
| 107 | + }, |
| 108 | + "environment_variables": [ |
| 109 | + "CONDA_EXE", |
| 110 | + "CONDA_PREFIX" |
| 111 | + ], |
| 112 | + "conda_config_paths": { |
| 113 | + "unix": [ |
| 114 | + "~/.condarc", |
| 115 | + "~/.conda/condarc", |
| 116 | + "/opt/miniconda3/.condarc", |
| 117 | + "/opt/anaconda3/.condarc" |
| 118 | + ], |
| 119 | + "windows": [ |
| 120 | + "%USERPROFILE%\\.condarc", |
| 121 | + "%USERPROFILE%\\.conda\\condarc" |
| 122 | + ] |
| 123 | + } |
| 124 | + }, |
65 | 125 | "install": { |
66 | 126 | "windows": { |
67 | 127 | "admin": [ |
|
123 | 183 | "conda run -n <conda_env> conda install scipy -y" |
124 | 184 | ], |
125 | 185 | "mac": [ |
126 | | - "conda run -n <conda_env> conda install openssl=3.0.* -y", |
127 | | - "conda run -n <conda_env> pip install netcdf4 --no-deps", |
128 | | - "conda run -n <conda_env> pip install cftime", |
| 186 | + "conda run -n <conda_env> conda install openssl=3.0.* ca-certificates -c conda-forge -y", |
| 187 | + "conda run -n <conda_env> pip uninstall -y netcdf4", |
| 188 | + "conda run -n <conda_env> pip install netcdf4 --no-deps --no-cache-dir", |
| 189 | + "conda run -n <conda_env> pip install cftime --no-cache-dir", |
129 | 190 | "conda run -n <conda_env> pip uninstall -y scipy", |
130 | | - "conda run -n <conda_env> pip install scipy==1.12.0" |
| 191 | + "conda run -n <conda_env> pip install scipy==1.12.0 --no-cache-dir", |
| 192 | + "conda run -n <conda_env> conda clean --all -y" |
131 | 193 | ], |
132 | 194 | "windows": [ |
133 | 195 | "conda run -n <conda_env> pip install --upgrade netcdf4", |
|
148 | 210 | }, |
149 | 211 | "environment_variables": { |
150 | 212 | "linux": {}, |
151 | | - "mac": { |
152 | | - "DYLD_FALLBACK_LIBRARY_PATH": "/opt/anaconda3/envs/mhkit-matlab-env/lib", |
153 | | - "CONDA_DLL_SEARCH_MODIFICATION_ENABLE": "1" |
154 | | - }, |
155 | | - "windows": { |
156 | | - "CONDA_DLL_SEARCH_MODIFICATION_ENABLE": "1" |
157 | | - } |
| 213 | + "mac": {}, |
| 214 | + "windows": {} |
158 | 215 | }, |
159 | 216 | "startup_fixes": { |
160 | 217 | "linux": [ |
|
169 | 226 | " end", |
170 | 227 | "end" |
171 | 228 | ], |
172 | | - "mac": [], |
| 229 | + "mac": [ |
| 230 | + "% MHKiT: Fix Python library compatibility on macOS", |
| 231 | + "if ismac", |
| 232 | + " % Get conda environment path dynamically", |
| 233 | + " try", |
| 234 | + " pe = pyenv();", |
| 235 | + " if ~isempty(pe.Executable) && contains(pe.Executable, 'mhkit-matlab-env')", |
| 236 | + " [env_path, ~, ~] = fileparts(fileparts(pe.Executable));", |
| 237 | + " lib_path = fullfile(env_path, 'lib');", |
| 238 | + " if exist(lib_path, 'dir')", |
| 239 | + " setenv('DYLD_FALLBACK_LIBRARY_PATH', lib_path);", |
| 240 | + " setenv('CONDA_DLL_SEARCH_MODIFICATION_ENABLE', '1');", |
| 241 | + " end", |
| 242 | + " end", |
| 243 | + " catch", |
| 244 | + " % Ignore errors - Python may not be configured yet", |
| 245 | + " end", |
| 246 | + "end" |
| 247 | + ], |
173 | 248 | "windows": [] |
174 | 249 | } |
175 | 250 | } |
|
0 commit comments