GSAS‑II 安装与 BCS API 配置教程

 

📦 一、下载 GSAS‑II

GSAS‑II 的安装包统一托管在 GitHub 的构建工具仓库中。
请根据你的操作系统,从下面的地址下载对应的 最新版 安装包。

🔗 官方下载地址
https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/releases/latest

在该页面的 “Assets” 区域,选择以下文件(务必选择带 Latest 字样的版本):

  • Windowsgsas2main‑Latest‑Windows‑x86_64.exe 推荐
  • macOS(Apple 芯片)gsas2main‑Latest‑MacOSX‑arm64.sh
  • macOS(Intel 芯片)gsas2main‑Latest‑MacOSX‑x86_64.sh
  • Linux(通用)gsas2main‑Latest‑Linux‑x86_64.sh
  • Linux(RHEL)gsas2main‑rhel‑Latest‑Linux‑x86_64.sh

📌 注意
• 文件名中带数字(如 58335837)或 old_ 开头的均为旧版本,请勿下载。
• macOS 15.x 及以上版本 必须 使用 gsas2main 安装包,旧版 gsas2full 将无法工作。
.tgz 文件是编译好的二进制包,供高级用户使用,一般用户无需下载。
• 来源:GSAS‑II 官方发布说明[reference:0][reference:1]

⚙️ 二、安装 GSAS‑II

🪟 Windows

双击下载的 .exe 文件,按照提示完成安装即可。

🍎 macOS / 🐧 Linux

打开终端(Terminal),进入下载目录,执行以下命令:

bash gsas2main‑Latest‑MacOSX‑arm64.sh   # macOS 示例bash gsas2main‑Latest‑Linux‑x86_64.sh     # Linux 示例

安装完成后,启动 GSAS‑II,建议通过菜单栏 HelpUpdate 检查并更新到最新代码。[reference:2]


🔑 三、获取 BCS API 密钥

GSAS‑II 需要通过 Bilbao 晶体学服务器(BCS)进行空间群分析等计算。你需要注册一个免费账号并生成 API 密钥。[reference:3]

步骤 1:申请 BCS 账号

打开以下网址:
https://cryst.ehu.es/cgi-bin/cryst/programs/UserRegister.pl

输入你的邮箱地址,点击 “Apply” 按钮。[reference:4]

系统会发送一封验证邮件到你的邮箱(链接 24 小时内有效)。[reference:5]

步骤 2:完成注册

点击邮件中的链接,在新页面中填写:

  • Name(姓名)
  • Institution(单位)
  • Password(密码)

点击 “Register” 完成注册。[reference:6]

步骤 3:生成 API 密钥

访问 BCS 登录页面:
https://cryst.ehu.es/cgi-bin/cryst/programs/User_Login.pl

使用刚注册的邮箱和密码登录。[reference:7]

在账户选项页面,选择第 4 个选项:“Create/Update API Key”。[reference:8]

点击 “GENERATE A NEW API KEY” 按钮。[reference:9]

页面会显示一串以 BCS_ 开头的密钥。
⚠️ 请立即复制并妥善保存,不要泄露给他人。[reference:10]

🔗 四、在 GSAS‑II 中配置 API 密钥

启动 GSAS‑II,在菜单栏点击 FilePreferences。[reference:11]

在弹出的 “Preferences” 窗口中,从下拉列表中找到并选中 BCS_API_KEY。[reference:12]

在输入框中 粘贴 你刚才复制的 API 密钥(如果粘贴无效,请手动输入)。[reference:13]

点击 “Save current settings” 保存并关闭窗口。[reference:14]

💡 提示
如果下拉列表中找不到 BCS_API_KEY,请先通过 HelpUpdate 将 GSAS‑II 更新到最新版。

✅ 五、测试连接

配置完成后,可以通过以下方式验证是否成功:

  1. 在 GSAS‑II 中,通过 DataAdd new phase 创建一个新的物相(Phase)。[reference:15]
  2. 在左侧项目树中,单击选中该物相。
  3. 此时顶部菜单栏会出现 Compute 菜单,点击其中的 “Test Bilbao access”。[reference:16]
  4. 稍等片刻,如果一切正常,会收到连接成功的消息。[reference:17]

如果测试失败,请检查网络连接,或确认 API 密钥是否正确粘贴。[reference:18]

图片

📚 参考资料

  • GSAS‑II 官方主页:https://gsasII.github.io[reference:19]
  • GSAS‑II 安装教程:https://advancedphotonsource.github.io/GSAS-II-tutorials/install.html[reference:20]
  • BCS API 配置教程:https://advancedphotonsource.github.io/GSAS-II-tutorials/RegisterBilbao/RegisterBilbao.html[reference:21]
  •