Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openchemistry/avogadrolibs into i…
Browse files Browse the repository at this point in the history
…mplement-g-angular-momentum

Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Dec 28, 2023
2 parents 319ed4d + 1fdede3 commit 10f40a9
Show file tree
Hide file tree
Showing 141 changed files with 55,442 additions and 24,460 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get -qq update
sudo apt-get -qq install ninja-build libeigen3-dev libboost-all-dev libglew-dev libxml2-dev
sudo apt-get -qq install ninja-build libeigen3-dev libboost-all-dev libglew-dev libxml2-dev
sudo apt-get -qq install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5x11extras5-dev libqt5svg5-dev
sudo apt-get -qq install libgcc-10-dev libgcc-9-dev
- name: Install Dependencies (macOS)
Expand Down Expand Up @@ -178,34 +178,36 @@ jobs:

- name: Fix Mac plugins
if: runner.os == 'macOS'
working-directory: ${{ runner.workspace }}/build/prefix/lib/openbabel
working-directory: ${{ runner.workspace }}/build/prefix/lib/openbabel
run: |
for plugin in *.so; do
for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do
for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 9`;
echo "Fixing $plugin $lib $libpath"
install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin
done
done
cd .. # build/prefix/lib
for plugin in libinchi.?.?.?.dylib; do
for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do
for plugin in libinchi.?.?.?.dylib libopenbabel.?.?.?.dylib; do
for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 9`;
echo "Fixing $plugin $lib $libpath"
install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin
done
done
otool -L libinchi.?.?.?.dylib
otool -L libopenbabel.?.?.?.dylib
cp -p libinchi* ../Avogadro2.app/Contents/Frameworks/
cp -p libopenbabel* ../Avogadro2.app/Contents/Frameworks/
# finally, fixup the binaries
#cd ../bin
#for exe in obabel obmm eht_bind genXrdPattern; do
# for libpath in `otool -L ${exe} | grep '/Users/runner/work' | awk '{print $1}'`; do
# export lib=`echo $libpath | cut -d '/' -f 9`;
# echo "Fixing $exe $lib $libpath"
# install_name_tool -change $libpath @executable_path/../Frameworks/$lib $exe
# done
#done
cd ../bin
for exe in obabel obmm eht_bind genXrdPattern; do
for libpath in `otool -L ${exe} | grep '/Users/runner/work' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 9`;
echo "Fixing $exe $lib $libpath"
install_name_tool -change $libpath @executable_path/../Frameworks/$lib $exe
done
done
- name: Run tests
if: matrix.config.os == 'ubuntu-20.04'
Expand Down Expand Up @@ -314,7 +316,7 @@ jobs:

- name: Upload
if: matrix.config.artifact != 0
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/build/avogadroapp/Avogadro2*.*
name: ${{ matrix.config.artifact }}
Expand All @@ -327,4 +329,3 @@ jobs:
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
2 changes: 1 addition & 1 deletion .github/workflows/build_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:

- name: Upload
if: matrix.config.artifact != 0
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/build/avogadroapp/Avogadro2*.*
name: ${{ matrix.config.artifact }}
Expand Down
151 changes: 151 additions & 0 deletions .github/workflows/build_qt6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Qt6 Build Matrix
# 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/


on: [push, pull_request, workflow_dispatch]

env:
QT_VERSION: 6.5.3
# this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems
# we set MACOSX_DEPLOYMENT_TARGET later
MACOS_TARGET: 10.15
FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_VTK=ON -DQT_VERSION=6

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Qt6", artifact: "",
os: ubuntu-latest,
cc: "gcc", cxx: "g++",
build_type: "Release",
cmake_flags: "-G Ninja",
cpack: "",
}
- {
name: "Ubuntu Qt6 AppImage", artifact: "",
os: ubuntu-20.04,
cc: "gcc", cxx: "g++",
build_type: "Release",
cmake_flags: "-G Ninja -DINSTALL_BUNDLE_FILES=ON",
cpack: "",
}
- {
name: "macOS Qt6", artifact: "",
os: macos-latest,
cc: "clang", cxx: "clang++",
build_type: "Release",
cmake_flags: "-G Ninja",
cpack_flags: "-G DragNDrop",
}
- {
name: "Windows Qt6", artifact: "",
os: windows-latest,
cc: "cl", cxx: "cl",
build_type: "Release",
cmake_flags: "",
build_flags: "-j 2",
cpack_flags: "-G NSIS",
}

steps:

- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get -qq update
sudo apt-get -qq install ninja-build libeigen3-dev libboost-all-dev libglew-dev libxml2-dev
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
if uname -p | grep -q "arm" ; then
export PATH=/opt/homebrew/bin:$PATH
else # not self-hosted runner
brew install ninja eigen glew
fi
- 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 avogadrolibs
uses: actions/checkout@v4
with:
path: avogadrolibs

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

- 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@v3
if: runner.os != 'Windows'
with:
path: |
${{ runner.workspace }}/build/thirdparty
${{ runner.workspace }}/build/Downloads
key: ${{ matrix.config.name }}-thirdparty

- name: Configure
run: |
if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi
cd "${{ runner.workspace }}/build"
# won't have any effect except on Mac
echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV
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: Run tests
if: matrix.config.os == 'ubuntu-latest'
shell: cmake -P {0}
run: |
include(ProcessorCount)
ProcessorCount(N)
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
set(ENV{ASAN_OPTIONS} "new_delete_type_mismatch=0")
execute_process(
COMMAND ctest -j ${N}
WORKING_DIRECTORY ${{ runner.workspace }}/build/avogadrolibs
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Running tests failed!")
endif()
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
14 changes: 8 additions & 6 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
CIBW_BEFORE_ALL_LINUX: yum install -y git eigen3-devel

# Specify eigen location for windows
CIBW_ENVIRONMENT_WINDOWS: "EXTRA_CMAKE_ARGS=-DEigen3_INCLUDE_DIR:PATH=/c/eigen"
CIBW_ENVIRONMENT_WINDOWS: "EXTRA_CMAKE_ARGS=-DEIGEN3_INCLUDE_DIR:PATH=/c/eigen"

# On Mac build both x64 and arm64
CIBW_ARCHS_MACOS: "x86_64 arm64"
Expand Down Expand Up @@ -52,22 +52,24 @@ jobs:
# give it a correct version even on non-tag push.
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.7'
python-version: '3.8'
cache: 'pip' # caching pip dependencies

- name: Install cibuildwheel
run: pip install cibuildwheel==2.12.3
run: pip install cibuildwheel==2.16.2

- name: Install dependencies
run: . ./scripts/github-actions/install.sh

- name: Build wheels
run: cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

upload_pypi:
Expand All @@ -77,7 +79,7 @@ jobs:
# upload to PyPI on every tag push
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Upload patch
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/clang-format.diff
name: clang-format.diff
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
echo ${{ github.event.pull_request.head.repo.full_name }} > ${{ runner.workspace }}/clang-tidy-result/pr-head-repo.txt
echo ${{ github.event.pull_request.head.ref }} > ${{ runner.workspace }}/clang-tidy-result/pr-head-ref.txt
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: clang-tidy-result
path: ${{ runner.workspace }}/clang-tidy-result/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ jobs:
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: filtered.sarif
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
source-root: ${{ github.workspace }}/avogadrolibs
Expand All @@ -105,7 +105,7 @@ jobs:
shell: bash

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
checkout_path: ${{ github.workspace }}/avogadrolibs
2 changes: 1 addition & 1 deletion avogadro/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ target_sources(Headers PUBLIC
utilities.h
vector.h
)
target_link_libraries(Headers INTERFACE Eigen3::Eigen3)
target_link_libraries(Headers INTERFACE Eigen3::Eigen)
install(TARGETS Headers
EXPORT "AvogadroLibsTargets"
FILE_SET HEADERS DESTINATION "${INSTALL_INCLUDE_DIR}")
Expand Down
4 changes: 2 additions & 2 deletions avogadro/core/atom.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,13 @@ Vector3 AtomTemplate<Molecule_T>::forceVector() const
template <class Molecule_T>
void AtomTemplate<Molecule_T>::setLabel(const std::string& label)
{
m_molecule->setLabel(m_index, label);
m_molecule->setAtomLabel(m_index, label);
}

template <class Molecule_T>
std::string AtomTemplate<Molecule_T>::label() const
{
return m_molecule->label(m_index);
return m_molecule->atomLabel(m_index);
}

} // namespace Core
Expand Down
2 changes: 0 additions & 2 deletions avogadro/core/atomutilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include "avogadrocoreexport.h"

#include "avogadrocoreexport.h"

#include <avogadro/core/molecule.h>

#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion avogadro/core/coordinateblockgenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef AVOGADRO_CORE_COORDINATEBLOCKGENERATOR_H
#define AVOGADRO_CORE_COORDINATEBLOCKGENERATOR_H

#include <avogadrocoreexport.h>
#include "avogadrocoreexport.h"

#include <sstream>
#include <string>
Expand Down
Loading

0 comments on commit 10f40a9

Please sign in to comment.