Skip to content

Commit

Permalink
Merge branch 'master' into msgpack-calcs
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis authored Nov 30, 2024
2 parents 23447e4 + c491afc commit 3f72754
Show file tree
Hide file tree
Showing 151 changed files with 10,014 additions and 9,584 deletions.
37 changes: 24 additions & 13 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ jobs:
cmake_flags: "-G Ninja -DBUILD_MOLEQUEUE=OFF",
cpack_flags: "-G DragNDrop",
}
- {
name: "Windows Latest MSVC", artifact: "Win64.exe",
os: windows-latest,
cc: "cl", cxx: "cl",
build_type: "Release",
cmake_flags: "-DBUILD_MOLEQUEUE=OFF",
build_flags: "-j 2",
cpack_flags: "-G NSIS",
}
- {
name: "Ubuntu Address Sanitizer", artifact: "",
os: ubuntu-20.04,
Expand Down Expand Up @@ -283,6 +274,7 @@ jobs:
[[ ! "${GITHUB_REF}" =~ "tags" ]] && export SNAPSHOT_DATE=`date -j "+%d-%m-%y"`
cpack ${{ matrix.config.cpack_flags }}
working-directory: ${{ runner.workspace }}/build/avogadroapp
continue-on-error: true
env:
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }}
Expand Down Expand Up @@ -328,17 +320,36 @@ jobs:
CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }}
continue-on-error: true

- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

- name: Upload
if: matrix.config.artifact != 0
id: upload-artifact
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/build/avogadroapp/Avogadro*.*
name: ${{ matrix.config.artifact }}

- name: Sign Windows artifact
if: matrix.config.os == 'windows-latest' && github.ref == 'refs/heads/master'
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '${{ secrets.SIGNPATH_ORG_ID }}'
project-slug: 'avogadrolibs'
signing-policy-slug: 'test-signing'
github-artifact-id: '${{ steps.upload-artifact.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: '${{ runner.workspace }}/build/avogadroapp'

- name: Notarize Mac DMG
if: matrix.config.os == 'windows-latest' && github.ref == 'refs/heads/master'
run: |
ls -la ./
working-directory: ${{ runner.workspace }}/build/avogadroapp

- name: Setup tmate session
if: failure()
uses: mxschmitt/action-tmate@v3

- name: Cleanup
if: ${{ always() }} # To ensure this step runs even when earlier steps fail
shell: bash
Expand Down
169 changes: 169 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: CMake Windows Build
# Many thanks to Cristian Adam for examples
# e.g. https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml
# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/

# This workflow will build and sign on Windows
# .. since SignPath requires only a Windows build in the action
# .. to successfully sign

on: [push, pull_request, workflow_dispatch]

env:
QT_VERSION: 5.15.2
FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_VTK=ON -DUSE_3DCONNEXION=ON

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC", artifact: "Win64.exe",
os: windows-latest,
cc: "cl", cxx: "cl",
build_type: "Release",
cmake_flags: "-DBUILD_MOLEQUEUE=OFF",
build_flags: "-j 2",
cpack_flags: "-G NSIS",
}

steps:

- name: Install Dependencies (Windows)
if: runner.os == 'Windows'
run: choco install ninja

- name: Checkout openchemistry
uses: actions/checkout@v4
with:
repository: openchemistry/openchemistry
submodules: recursive

- name: Checkout avogadroapp
uses: actions/checkout@v4
with:
repository: openchemistry/avogadroapp
path: avogadroapp

- name: Checkout molecules
uses: actions/checkout@v4
with:
repository: openchemistry/molecules
path: molecules

- name: Checkout fragments
uses: actions/checkout@v4
with:
repository: openchemistry/fragments
path: fragments

- name: Checkout crystals
uses: actions/checkout@v4
with:
repository: openchemistry/crystals
path: crystals

- name: Checkout i18n
uses: actions/checkout@v4
with:
repository: openchemistry/avogadro-i18n
path: avogadro-i18n

- name: Checkout avogadrolibs
uses: actions/checkout@v4
with:
path: avogadrolibs

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
cache: true
version: ${{ env.QT_VERSION }}

- name: Configure MSVC Command Prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Grab cache files
uses: actions/cache@v4
if: runner.os != 'Windows'
with:
path: |
${{ runner.workspace }}/build/Downloads
key: ${{ matrix.config.name }}-downloads

- name: Configure
run: |
if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi
cd "${{ runner.workspace }}/build"
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}}
shell: bash

- name: Build
run: |
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}}
shell: bash
working-directory: ${{ runner.workspace }}/build

- name: Create Windows Package
if: matrix.config.os == 'windows-latest'
shell: bash
run: |
[[ ! "${GITHUB_REF}" =~ "tags" ]] && export SNAPSHOT_DATE=`date -j "+%d-%m-%y"`
cpack ${{ matrix.config.cpack_flags }}
working-directory: ${{ runner.workspace }}/build/avogadroapp
continue-on-error: true
env:
OPENSSL_ROOT_DIR: ${{ matrix.config.ssl_env }}

- name: Upload
if: matrix.config.artifact != 0
id: upload-artifact
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/build/avogadroapp/Avogadro*.*
name: ${{ matrix.config.artifact }}

- name: Sign Windows release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '${{ secrets.SIGNPATH_ORG_ID }}'
project-slug: 'avogadrolibs'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-artifact.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: '../build/'

- name: Upload
if: matrix.config.artifact != 0
id: upload-signed-artifact
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/build/Avogadro2*.*
name: 'Win64-signed.exe'

- name: Setup tmate session
if: failure()
uses: mxschmitt/action-tmate@v3

- name: Cleanup
if: ${{ always() }} # To ensure this step runs even when earlier steps fail
shell: bash
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ if(MSVC)
# Ensure __cplusplus is correct, otherwise it defaults to 199711L which isn't true
# https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")

message(STATUS "Setting MSVC debug information format to 'Embedded'")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")

set(CMAKE_VS_GLOBALS
"UseMultiToolTask=true"
"DebugInformationFormat=OldStyle"
)
endif()

option(ENABLE_TESTING "Enable testing and building the tests." OFF)
Expand Down
19 changes: 4 additions & 15 deletions avogadro/command/qube.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
/******************************************************************************
This source file is part of the Avogadro project.
Copyright 2014 Albert DeFusco University of Pittsburgh
This source code is released under the New BSD License, (the "License").
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This source code is released under the 3-Clause BSD License, (see "LICENSE").
******************************************************************************/
#include <avogadro/io/fileformatmanager.h>
#include <avogadro/quantumio/gamessus.h>
Expand All @@ -28,15 +17,15 @@
#include <sstream>
#include <string>

using Avogadro::Io::FileFormatManager;
using Avogadro::Core::Cube;
using Avogadro::Core::Molecule;
using Avogadro::Core::GaussianSetTools;
using Avogadro::Core::Molecule;
using Avogadro::Io::FileFormatManager;
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::ostringstream;
using std::string;

using Eigen::Vector3d;
using Eigen::Vector3i;
Expand Down
72 changes: 66 additions & 6 deletions avogadro/core/gaussianset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ unsigned int GaussianSet::addBasis(unsigned int atom, orbital type)
case F7:
m_numMOs += 7;
break;
case G:
m_numMOs += 15;
break;
case G9:
m_numMOs += 9;
break;
case H:
m_numMOs += 21;
break;
case H11:
m_numMOs += 11;
break;
case I:
m_numMOs += 28;
break;
case I13:
m_numMOs += 13;
break;
default:
// Should never hit here
;
Expand Down Expand Up @@ -434,12 +452,54 @@ void GaussianSet::initCalculation()
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.25) * norm); //-3
}
} break;
case G:
skip = 15;
break;
case G9:
skip = 9;
break;
case G: {
// 16 * (2.0/pi)^0.75
double norm = 11.403287525679843;
double norm1 = norm / sqrt(7.0);
double norm2 = norm / sqrt(35.0 / 3.0);
double norm3 = norm / sqrt(35.0);
m_moIndices[i] = indexMO;
indexMO += 15;
m_cIndices.push_back(static_cast<unsigned int>(m_gtoCN.size()));
for (unsigned j = m_gtoIndices[i]; j < m_gtoIndices[i + 1]; ++j) {
// molden order
// xxxx yyyy zzzz xxxy xxxz yyyx yyyz zzzx zzzy,
// xxyy xxzz yyzz xxyz yyxz zzxy
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); // xxxx
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); // yyyy
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); // zzzz
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm1); // xxxy
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm1); // xxxz
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm1); // yyyx
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm1); // yyyz
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm1); // zzzx
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm1); // zzzy
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm2); // xxyy
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm2); // xxzz
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm2); // yyzz
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm3); // xxyz
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm3); // yyxz
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm3); // zzxy
}
} break;
case G9: {
// 16 * (2.0/pi)^0.75
double norm = 11.403287525679843;
m_moIndices[i] = indexMO;
indexMO += 9;
m_cIndices.push_back(static_cast<unsigned int>(m_gtoCN.size()));
for (unsigned j = m_gtoIndices[i]; j < m_gtoIndices[i + 1]; ++j) {
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); // 0
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //+1
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //-1
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //+2
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //-2
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //+3
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //-3
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //+4
m_gtoCN.push_back(m_gtoC[j] * pow(m_gtoA[j], 2.75) * norm); //-4
}
} break;
case H:
skip = 21;
break;
Expand Down
Loading

0 comments on commit 3f72754

Please sign in to comment.