Skip to content

Commit

Permalink
attempt at release
Browse files Browse the repository at this point in the history
  • Loading branch information
tjira committed Aug 1, 2024
1 parent 6f1cdd2 commit 7b58ae2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 89 deletions.
84 changes: 16 additions & 68 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ jobs:
- uses: actions/checkout@v4

- name: Install Packages
run: sudo apt install -y libboost-dev libeigen3-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev
run: sudo apt install -y libboost-dev libeigen3-dev

- name: Install Python Packages
run: pip install typing-extensions

- name: Build Libtorch
run: ./script/libtorch.sh

- name: Build Libfftw
run: ./script/libfftw.sh
Expand All @@ -28,13 +34,10 @@ jobs:
run: ./script/libint.sh

- name: Configure Acorn
run: cmake -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build Acorn
run: |
export CPLUS_INCLUDE_PATH="$PWD/libfftw/install/include:$PWD/libint/install/include:$CPLUS_INCLUDE_PATH"
export LIBRARY_PATH="$PWD/libfftw/install/lib:$PWD/libint/install/lib:$LIBRARY_PATH"
cmake --build build --parallel 2
run: cmake --build build --parallel 2

- name: Rename Binaries
run: |
Expand All @@ -47,6 +50,9 @@ jobs:
mv bin/acorn_qdyn bin/acorn_qdyn_linux_x86-64
mv bin/acorn_transform bin/acorn_transform_linux_x86-64
- name: Copy the Shared Libraries
run: cp external/lib/*.so bin/

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -60,48 +66,11 @@ jobs:
bin/acorn_mp_linux_x86-64
bin/acorn_qdyn_linux_x86-64
bin/acorn_transform_linux_x86-64
build_windows_x86-64:
runs-on: windows-2022

steps:
- uses: actions/checkout@v4

- name: Configure Acorn
run: cmake -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTATIC=ON

- name: Build Acorn
run: |
cmake --build build --parallel 2
- name: Rename Binaries
run: |
mv bin/acorn_cdyn.exe bin/acorn_cdyn_windows_x86-64.exe
mv bin/acorn_ci.exe bin/acorn_ci_windows_x86-64.exe
mv bin/acorn_expression.exe bin/acorn_expression_windows_x86-64.exe
mv bin/acorn_hf.exe bin/acorn_hf_windows_x86-64.exe
mv bin/acorn_integral.exe bin/acorn_integral_windows_x86-64.exe
mv bin/acorn_mp.exe bin/acorn_mp_windows_x86-64.exe
mv bin/acorn_qdyn.exe bin/acorn_qdyn_windows_x86-64.exe
mv bin/acorn_transform.exe bin/acorn_transform_windows_x86-64.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: |
bin/acorn_cdyn_windows_x86-64.exe
bin/acorn_ci_windows_x86-64.exe
bin/acorn_expression_windows_x86-64.exe
bin/acorn_hf_windows_x86-64.exe
bin/acorn_integral_windows_x86-64.exe
bin/acorn_mp_windows_x86-64.exe
bin/acorn_qdyn_windows_x86-64.exe
bin/acorn_transform_windows_x86-64.exe
bin/*.so
release:
runs-on: ubuntu-latest
needs: [build_linux_x86-64, build_windows_x86-64]
needs: [build_linux_x86-64]

steps:
- uses: actions/checkout@v4
Expand All @@ -122,36 +91,15 @@ jobs:
cp linux/acorn_mp_linux_x86-64 acorn_mp
cp linux/acorn_qdyn_linux_x86-64 acorn_qdyn
cp linux/acorn_transform_linux_x86-64 acorn_transform
cp linux/*.so .
- name: Create x86-64 Linux Packages
run: |
tar -czf acorn_linux_x86-64.tar.gz acorn_cdyn acorn_ci acorn_expression acorn_hf acorn_integral acorn_mp acorn_qdyn acorn_transform basis example script/plot.py LICENSE.md
- name: Copy x86-64 Windows Static Binaries to the Root Folder
run: |
cp windows/acorn_cdyn_windows_x86-64.exe acorn_cdyn.exe
cp windows/acorn_ci_windows_x86-64.exe acorn_ci.exe
cp windows/acorn_expression_windows_x86-64.exe acorn_expression.exe
cp windows/acorn_hf_windows_x86-64.exe acorn_hf.exe
cp windows/acorn_integral_windows_x86-64.exe acorn_integral.exe
cp windows/acorn_mp_windows_x86-64.exe acorn_mp.exe
cp windows/acorn_qdyn_windows_x86-64.exe acorn_qdyn.exe
cp windows/acorn_transform_windows_x86-64.exe acorn_transform.exe
- name: Create x86-64 Static Windows Packages
run: |
zip -r acorn_windows_x86-64.zip acorn_cdyn.exe acorn_ci.exe acorn_expression.exe acorn_hf.exe acorn_integral.exe acorn_mp.exe acorn_qdyn.exe acorn_transform.exe basis example script/plot.py LICENSE.md
tar -czf acorn_linux_x86-64.tar.gz acorn_cdyn acorn_ci acorn_expression acorn_hf acorn_integral acorn_mp acorn_qdyn acorn_transform basis example script/plot.py LICENSE.md *.so
- name: Release linux_x86-64 Version of Acorn
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
file: acorn_linux_x86-64.tar.gz
tag: ${{github.ref}}

- name: Release windows_x86-64 Version of Acorn
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
file: acorn_windows_x86-64.zip
tag: ${{github.ref}}
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ cmake_minimum_required(VERSION 3.16)
# project name
project(Acorn)

# include the fetch plugin
include(FetchContent)

# set the c++ standard
set(CMAKE_CXX_STANDARD 20)

Expand All @@ -17,8 +14,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")

# set the base compiler flags
set(CMAKE_CXX_FLAGS_DEBUG "-g -pg -Og -Wall -Wextra --coverage")
set(CMAKE_CXX_FLAGS_RELEASE "-s -O3 -flto=auto -march=native")
set(CMAKE_CXX_FLAGS_DEBUG "-g -pg -Og -Wall -Wextra -Wl,-rpath,'$ORIGIN' --coverage")
set(CMAKE_CXX_FLAGS_RELEASE "-s -O3 -flto=auto -march=native -Wl,-rpath,'$ORIGIN'")

# include directories
include_directories(example/diagram external/include external/include/torch/csrc/api/include include lib)
Expand All @@ -30,8 +27,8 @@ find_package(OpenMP REQUIRED)
# find installed libraries
find_library(LIBTORCH_CPU NAMES torch_cpu PATHS external/lib NO_DEFAULT_PATH)
find_library(LIBTORCH NAMES torch PATHS external/lib NO_DEFAULT_PATH)
find_library(LIBFFTW NAMES fftw3 PATHS external/lib NO_DEFAULT_PATH)
find_library(LIBINT NAMES int2 PATHS external/lib NO_DEFAULT_PATH)
find_library(LIBFFTW NAMES fftw PATHS external/lib NO_DEFAULT_PATH)
find_library(LIBINT NAMES int PATHS external/lib NO_DEFAULT_PATH)
find_library(LIBC10 NAMES c10 PATHS external/lib NO_DEFAULT_PATH)

# add the base library
Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,13 @@ Below are all the important features of Acorn divided into categories. If you ar

## Compilation

The software requires the [libint](https://github.com/evaleev/libint) and [fftw](https://www.fftw.org) libraries. Before compiling these libraries and proceeding with the following steps, make sure you have [eigen](https://gitlab.com/libeigen/eigen) and [boost](https://github.com/boostorg/boost) library installed. On debian-based distributions, you can do it with the following command.
The software requires the [fftw](https://www.fftw.org), [libint](https://github.com/evaleev/libint) and [pytorch](https://github.com/pytorch/pytorch) libraries. Before compiling these libraries and proceeding with the following steps, make sure you have [eigen](https://gitlab.com/libeigen/eigen) and [boost](https://github.com/boostorg/boost) libraries installed. On debian-based distributions, you can do it with the following command.

```bash
sudo apt install libboost-dev libeigen3-dev
```

To compile the libraries execute `./script/libfftw.sh && ./script/libint.sh` from the project root directory. Now, we export the necessary environment variables.

```bash
export CPLUS_INCLUDE_PATH="$PWD/libfftw/install/include:$PWD/libint/install/include:$CPLUS_INCLUDE_PATH"
export LIBRARY_PATH="$PWD/libfftw/install/lib:$PWD/libint/install/lib:$LIBRARY_PATH"
```

After this, the project configuration should finish without errors.
To compile the libraries execute `./script/libfftw.sh && ./script/libint.sh && ./script/libtorch.sh` from the project root directory. After this, the project configuration should finish without errors.

```bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
Expand All @@ -90,6 +83,8 @@ All the examples are implemented as `example/makefile` targets. If you are in ex
## Credits

* [argparse](https://github.com/p-ranav/argparse) - Argument Parser for Modern C++.
* [eigen](https://gitlab.com/libeigen/eigen) - C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
* [exprtk](https://github.com/ArashPartow/exprtk) - C++ Mathematical Expression Parsing and Evaluation Library.
* [fftw](https://www.fftw.org) - C Subroutine Library for Computing the Discrete Fourier Transform .
* [fftw](https://www.fftw.org) - C Subroutine Library for Computing the Discrete Fourier Transform.
* [libint](https://github.com/evaleev/libint) - High-Performance Library for Computing Gaussian Integrals in Quantum Mechanics.
* [pytorch](https://github.com/pytorch/pytorch) - Tensors and Dynamic neural networks in Python with strong GPU acceleration.
2 changes: 1 addition & 1 deletion example/qdyn-lz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ QS_2="0.01*tanh(0.6*x) 0.001*exp(-x^2) 0.001*exp(-x^2) 0.001*exp(-x^2)
0.001*exp(-x^2) 0.001*exp(-x^2) 0.001*exp(-x^2) (-0.01)*tanh(0.6*x)"
QS_2_DIS=3; QS_2_AIS=3; QS_2_IX=-10; QS_2_IP=15

A=0.05; C=("tab:blue" "tab:orange" "tab:green" "tab:red" "tab:purple" "tab:brown"); FC=${C[0]}; I=3500; L=500; M=2000; R=1; T=100
A=0.05; C=("tab:blue" "tab:orange" "tab:green" "tab:red" "tab:purple" "tab:brown"); FC=${C[0]}; I=3500; L=500; M=2000; R=1; T=1000

for POT in TULLY_1 TULLY_2 DS_1 DS_2 TS_1 TS_2 TS_3 QS_1 QS_2; do
# for POT in QS_1; do
Expand Down
3 changes: 3 additions & 0 deletions script/libfftw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ cp -r external/libfftw/install/include external/libfftw/install/lib external/

# remove redundant files
rm -rf external/libfftw external/include/*.f external/include/*.f03 external/lib/cmake external/lib/pkgconfig

# rename the library
mv external/lib/libfftw3.a external/lib/libfftw.a
3 changes: 3 additions & 0 deletions script/libint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ cp -r external/libint/install/include external/libint/install/lib external/

# remove redundant files
rm -rf external/libint external/lib/cmake external/lib/pkgconfig

# rename the library
mv external/lib/libint2.a external/lib/libint.a
6 changes: 3 additions & 3 deletions script/libtorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ cd external/libtorch && cmake -B build -DBUILD_PYTHON=OFF -DBUILD_SHARED_LIBS=ON
# compile and install libtorch
cd external/libtorch && cmake --build build --parallel 2 && cmake --install build && cd -

# copy the compiled library
cp -r external/libtorch/install/include external/libtorch/install/lib external/
# remove static libraries and copy the compiled library
rm external/libtorch/install/lib/*.a && cp -r external/libtorch/install/include external/libtorch/install/lib external/

# remove redundant files
rm -rf external/libtorch external/lib/cmake external/lib/pkgconfig external/lib/libtorch_global_deps.so external/lib/*.a
rm -rf external/libtorch external/lib/cmake external/lib/pkgconfig external/lib/libtorch_global_deps.so

0 comments on commit 7b58ae2

Please sign in to comment.