diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a31404a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: 2 -jobs: - build-and-test: - docker: - - image: continuumio/miniconda3 - steps: - - checkout - - run: - name: Create conda environment - command: | - apt-get update --yes - apt-get install --yes build-essential - conda env create -f environment.yml - - run: - name: Build the code - command: | - source activate mess-env - bash build.sh - - run: - name: Test the code - command: | - source activate mess-env - . debug/fake-install.sh - cd examples/ - mess mess.inp - cat mess.out - messpf messpf.inp - cat messpf.dat - messabs messabs.inp - cat messabs.out - messsym messsym.inp - cd .. -workflows: - version: 2 - build-all: - jobs: - - build-and-test diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..887a2c1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# SCM syntax highlighting & preventing 3-way merges +pixi.lock merge=binary linguist-language=YAML linguist-generated=true diff --git a/.github/workflows/static-build.yml b/.github/workflows/static-build.yml new file mode 100644 index 0000000..a42d84d --- /dev/null +++ b/.github/workflows/static-build.yml @@ -0,0 +1,30 @@ +name: Build and Upload MESS-Static + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Set up Pixi + uses: prefix-dev/setup-pixi@v0.8.9 + with: + manifest-path: static/pixi.toml + + # Build + - name: Build + run: pixi build + working-directory: static/ + + # Upload + - name: Upload + if: ${{ github.ref == 'refs/heads/main' && github.repository == 'Auto-Mech/mechtools'}} + run: pixi run upload + env: + ANACONDA_API_KEY: ${{ secrets.ANACONDA_API_KEY }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index c8306e5..a68f47b 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,11 @@ debug # Ignore rattler build output folder output/ + +# pixi environments +.pixi/ +!.pixi/config.toml + +# Other +test-examples/ +*.conda diff --git a/build.sh b/build.sh deleted file mode 100644 index 267b1f1..0000000 --- a/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -mkdir -p build -cd build - -echo $PREFIX - -export CFLAGS="${CFLAGS} -I${CONDA_PREFIX}/include" -export CXXFLAGS="${CXXFLAGS} -I${CONDA_PREFIX}/include" -# Build with MPACK -# export CXXFLAGS="${CXXFLAGS} -I${CONDA_PREFIX}/include -I${CONDA_PREFIX}/include/mpack -DWITH_MPACK" - -cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX - -make VERBOSE=1 -make install -ln -s $PREFIX/bin/messpf $PREFIX/bin/partition_function -ln -s $PREFIX/bin/messabs $PREFIX/bin/abstraction -ln -s $PREFIX/bin/messsym $PREFIX/bin/symmetry_number diff --git a/debug/build.sh b/debug/build.sh deleted file mode 100644 index 0b8718d..0000000 --- a/debug/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -export THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -export PROJECT_ROOT=$THIS_DIR/.. - -export CC=$CONDA_PREFIX/bin/x86_64-conda_cos6-linux-gnu-gcc -export CXX=$CONDA_PREFIX/bin/x86_64-conda_cos6-linux-gnu-c++ - -export CFLAGS="-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -I${CONDA_PREFIX}/include" -export CXXFLAGS="-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -I${CONDA_PREFIX}/include" - -mkdir -p $THIS_DIR/build -cd $THIS_DIR/build - -cmake $PROJECT_ROOT -DCMAKE_INSTALL_PREFIX=$THIS_DIR -DCMAKE_C_COMPILER=$CC -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -make VERBOSE=1 -make install -ln -s $THIS_DIR/bin/messpf $THIS_DIR/bin/partition_function -ln -s $THIS_DIR/bin/messabs $THIS_DIR/bin/abstraction -ln -s $THIS_DIR/bin/messsym $THIS_DIR/bin/symmetry_number diff --git a/debug/fake-install.sh b/debug/fake-install.sh deleted file mode 100644 index 3424a1f..0000000 --- a/debug/fake-install.sh +++ /dev/null @@ -1,5 +0,0 @@ -# run with: . /path/to/fake-install.sh -export THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -export PROJECT_ROOT=$THIS_DIR/.. - -export PATH=$THIS_DIR/bin:$PATH diff --git a/debug/install-conda.sh b/debug/install-conda.sh deleted file mode 100644 index 2993f35..0000000 --- a/debug/install-conda.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -if [ "$(uname)" == "Darwin" ]; then - wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - bash Miniconda3-latest-MacOSX-x86_64.sh -b -p $CONDA -elif [ "$(uname)" == "Linux" ]; then - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - bash Miniconda3-latest-Linux-x86_64.sh -b -p $CONDA -fi -conda update conda diff --git a/static/CONDA_BUILD.md b/static/CONDA_BUILD.md deleted file mode 100644 index c83d516..0000000 --- a/static/CONDA_BUILD.md +++ /dev/null @@ -1,67 +0,0 @@ -# Instructions for building & uploading the conda package - -The following steps use the `rattler-build` and `anaconda-client` packages to -create a conda package for installing the static MESS executables. See -instructions below for how to install them. Once the package is built and -uploaded, it can be installed in an environment as follows. -``` -conda install -c auto-mech mess-static -``` - -### Build the conda package - -1. Update the version number in `static/recipe.yaml` with today's date: `YYYY.MM.DD`. -2. Run `rattler-build build -r static/` and look for `/path/to/file.conda` in the output. Copy that path for the steps below. - -### Upload the conda package - -1. Navigate to `https://anaconda.org/` to create an API token for yourself. Save it in a secure location where you can access it. -2. `export ANACONDA_OWNER=` -3. `export ANACONDA_API_KEY=` -4. `anaconda upload -u auto-mech --label main /path/to/file.conda` - -## Testing - -### Testing the build - -To test that the build works, you can create a test environment with it installed as follows. -``` -conda create -n test-mess /path/to/file.conda -``` -You can then test that the conda package works as follows. -``` -conda activate test-mess -cd examples/ -mess mess.inp -messpf messpf.inp -``` -On subsequent tests, you will need to do remove the environment and clear the -cache before re-running the above commands (note that the cache must be cleared *after* removing the test environment). -``` -conda env remove -n test-mess -conda clean --all # Remove the cached version of test-mess -``` - -### Testing the upload - -Follow the same steps as shown above for testing the build, but create the -environment using the uploaded version as follows. Don't forget to remove the -`test-mess` environment and run `conda clean --all` if it was already created. -``` -conda create -n test-mess -c auto-mech mess-static -``` - -## Dependencies - -The following steps use the `rattler-build` and `anaconda-client` packages. - -These can be installed through pixi as follows: -``` -curl -fsSL https://pixi.sh/install.sh | bash # installs pixi -pixi global install rattler-build anaconda-client -``` - -Or, if you prefer, they can also be installed through conda: -``` -conda install -c conda-forge rattler-build anaconda-client -``` \ No newline at end of file diff --git a/static/README.md b/static/README.md new file mode 100644 index 0000000..e7f9161 --- /dev/null +++ b/static/README.md @@ -0,0 +1,23 @@ +# Instructions + +These instructions show how to build and upload the `mess-static` conda package, +containing the static executables in this directory. +The process relies in the Pixi package manager, which can be installed as follows. +``` +curl -fsSL https://pixi.sh/install.sh | sh +``` + +### Build + +Build the conda package: +``` +pixi build +``` + +### Upload + +Upload the conda package: +``` +export ANACONDA_API_KEY= +pixi run upload +``` diff --git a/static/pixi.lock b/static/pixi.lock new file mode 100644 index 0000000..79b4445 --- /dev/null +++ b/static/pixi.lock @@ -0,0 +1,227 @@ +version: 6 +environments: + default: + channels: + - url: https://prefix.dev/conda-forge/ + packages: + linux-64: + - conda: . + osx-64: + - conda: . + osx-arm64: + - conda: . + win-64: + - conda: . + dev: + channels: + - url: https://prefix.dev/conda-forge/ + packages: + linux-64: + - conda: https://prefix.dev/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 + - conda: https://prefix.dev/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + - conda: https://prefix.dev/conda-forge/noarch/ca-certificates-2025.8.3-hbd8a1cb_0.conda + - conda: https://prefix.dev/conda-forge/linux-64/libgcc-15.1.0-h767d61c_5.conda + - conda: https://prefix.dev/conda-forge/linux-64/libgomp-15.1.0-h767d61c_5.conda + - conda: https://prefix.dev/conda-forge/linux-64/libstdcxx-15.1.0-h8f9b012_5.conda + - conda: https://prefix.dev/conda-forge/linux-64/openssl-3.5.3-h26f9b46_1.conda + - conda: https://prefix.dev/conda-forge/linux-64/patchelf-0.18.0-h3f2d84a_2.conda + - conda: https://prefix.dev/conda-forge/linux-64/rattler-build-0.47.0-h60886be_0.conda + - conda: . + osx-64: + - conda: https://prefix.dev/conda-forge/osx-64/rattler-build-0.47.0-h9113d71_0.conda + - conda: . + osx-arm64: + - conda: https://prefix.dev/conda-forge/osx-arm64/rattler-build-0.47.0-h8d80559_0.conda + - conda: . + win-64: + - conda: https://prefix.dev/conda-forge/win-64/rattler-build-0.47.0-h18a1a76_0.conda + - conda: https://prefix.dev/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda + - conda: https://prefix.dev/conda-forge/win-64/vc-14.3-h41ae7f8_31.conda + - conda: https://prefix.dev/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_31.conda + - conda: https://prefix.dev/conda-forge/win-64/vcomp14-14.44.35208-h818238b_31.conda + - conda: . +packages: +- conda: https://prefix.dev/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 + sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726 + md5: d7c89558ba9fa0495403155b64376d81 + license: None + size: 2562 + timestamp: 1578324546067 +- conda: https://prefix.dev/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + build_number: 16 + sha256: fbe2c5e56a653bebb982eda4876a9178aedfc2b545f25d0ce9c4c0b508253d22 + md5: 73aaf86a425cc6e73fcf236a5a46396d + depends: + - _libgcc_mutex 0.1 conda_forge + - libgomp >=7.5.0 + constrains: + - openmp_impl 9999 + license: BSD-3-Clause + license_family: BSD + size: 23621 + timestamp: 1650670423406 +- conda: https://prefix.dev/conda-forge/noarch/ca-certificates-2025.8.3-hbd8a1cb_0.conda + sha256: 837b795a2bb39b75694ba910c13c15fa4998d4bb2a622c214a6a5174b2ae53d1 + md5: 74784ee3d225fc3dca89edb635b4e5cc + depends: + - __unix + license: ISC + size: 154402 + timestamp: 1754210968730 +- conda: https://prefix.dev/conda-forge/linux-64/libgcc-15.1.0-h767d61c_5.conda + sha256: 0caed73aac3966bfbf5710e06c728a24c6c138605121a3dacb2e03440e8baa6a + md5: 264fbfba7fb20acf3b29cde153e345ce + depends: + - __glibc >=2.17,<3.0.a0 + - _openmp_mutex >=4.5 + constrains: + - libgomp 15.1.0 h767d61c_5 + - libgcc-ng ==15.1.0=*_5 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 824191 + timestamp: 1757042543820 +- conda: https://prefix.dev/conda-forge/linux-64/libgomp-15.1.0-h767d61c_5.conda + sha256: 125051d51a8c04694d0830f6343af78b556dd88cc249dfec5a97703ebfb1832d + md5: dcd5ff1940cd38f6df777cac86819d60 + depends: + - __glibc >=2.17,<3.0.a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 447215 + timestamp: 1757042483384 +- conda: https://prefix.dev/conda-forge/linux-64/libstdcxx-15.1.0-h8f9b012_5.conda + sha256: 0f5f61cab229b6043541c13538d75ce11bd96fb2db76f94ecf81997b1fde6408 + md5: 4e02a49aaa9d5190cb630fa43528fbe6 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc 15.1.0 h767d61c_5 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 3896432 + timestamp: 1757042571458 +- conda: . + name: mess-static + version: 2025.9.0 + build: h4616a5c_0 + subdir: noarch + input: + hash: 8b79e5a3bc55d53830f91092ff4bcc7c5185097232b1ad65b0316fa5a0d921ca + globs: + - recipe.yaml + - variants.yaml +- conda: https://prefix.dev/conda-forge/linux-64/openssl-3.5.3-h26f9b46_1.conda + sha256: 0572be1b7d3c4f4c288bb8ab1cb6007b5b8b9523985b34b862b5222dea3c45f5 + md5: 4fc6c4c88da64c0219c0c6c0408cedd4 + depends: + - __glibc >=2.17,<3.0.a0 + - ca-certificates + - libgcc >=14 + license: Apache-2.0 + license_family: Apache + size: 3128517 + timestamp: 1758597915858 +- conda: https://prefix.dev/conda-forge/linux-64/patchelf-0.18.0-h3f2d84a_2.conda + sha256: 2f1caf273c7816fcff6e8438138c29d08264f8371dc0e23f86e993ccc7e978dc + md5: 5a6bde274af5252392b446ead19047d0 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + - libgcc >=13 + license: GPL-3.0-or-later + license_family: GPL + size: 136130 + timestamp: 1745559387060 +- conda: https://prefix.dev/conda-forge/linux-64/rattler-build-0.47.0-h60886be_0.conda + sha256: aa71bcaf81c71da4a9137777249970c426a37afd46b7960b3e8c397f553a7f40 + md5: 98366f1ada223a785f0dc24ed211a99c + depends: + - patchelf + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - openssl >=3.5.2,<4.0a0 + constrains: + - __glibc >=2.17 + license: BSD-3-Clause + license_family: BSD + size: 16827195 + timestamp: 1756921257075 +- conda: https://prefix.dev/conda-forge/osx-64/rattler-build-0.47.0-h9113d71_0.conda + sha256: 03d8c45aec0e1d8e4485a54e7e61e464ecc4752c1ec6e8fdd5458c226988eba8 + md5: b2f5ad0a287f0712c23abb0f45fbce6d + depends: + - __osx >=10.13 + constrains: + - __osx >=10.13 + license: BSD-3-Clause + size: 15200171 + timestamp: 1756921285627 +- conda: https://prefix.dev/conda-forge/osx-arm64/rattler-build-0.47.0-h8d80559_0.conda + sha256: d747d7d36bd38d37f6e80cb78358c373fb5776147e21f9da4121e736f9212796 + md5: dd3bf0dde45e18b8644b97a401f08ba2 + depends: + - __osx >=11.0 + constrains: + - __osx >=11.0 + license: BSD-3-Clause + license_family: BSD + size: 14273395 + timestamp: 1756921328894 +- conda: https://prefix.dev/conda-forge/win-64/rattler-build-0.47.0-h18a1a76_0.conda + sha256: 30e17e3741a7d98b937198cf2f4e6eedbadac9ecb0725334c63e2960cd5a5bc3 + md5: c8e0123a1fdee1980eff4ea01fbaac88 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: BSD-3-Clause + license_family: BSD + size: 17784676 + timestamp: 1756921275818 +- conda: https://prefix.dev/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda + sha256: 3005729dce6f3d3f5ec91dfc49fc75a0095f9cd23bab49efb899657297ac91a5 + md5: 71b24316859acd00bdb8b38f5e2ce328 + constrains: + - vc14_runtime >=14.29.30037 + - vs2015_runtime >=14.29.30037 + license: LicenseRef-MicrosoftWindowsSDK10 + size: 694692 + timestamp: 1756385147981 +- conda: https://prefix.dev/conda-forge/win-64/vc-14.3-h41ae7f8_31.conda + sha256: cb357591d069a1e6cb74199a8a43a7e3611f72a6caed9faa49dbb3d7a0a98e0b + md5: 28f4ca1e0337d0f27afb8602663c5723 + depends: + - vc14_runtime >=14.44.35208 + track_features: + - vc14 + license: BSD-3-Clause + license_family: BSD + size: 18249 + timestamp: 1753739241465 +- conda: https://prefix.dev/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_31.conda + sha256: af4b4b354b87a9a8d05b8064ff1ea0b47083274f7c30b4eb96bc2312c9b5f08f + md5: 603e41da40a765fd47995faa021da946 + depends: + - ucrt >=10.0.20348.0 + - vcomp14 14.44.35208 h818238b_31 + constrains: + - vs2015_runtime 14.44.35208.* *_31 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + size: 682424 + timestamp: 1753739239305 +- conda: https://prefix.dev/conda-forge/win-64/vcomp14-14.44.35208-h818238b_31.conda + sha256: 67b317b64f47635415776718d25170a9a6f9a1218c0f5a6202bfd687e07b6ea4 + md5: a6b1d5c1fc3cb89f88f7179ee6a9afe3 + depends: + - ucrt >=10.0.20348.0 + constrains: + - vs2015_runtime 14.44.35208.* *_31 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + size: 113963 + timestamp: 1753739198723 diff --git a/static/pixi.toml b/static/pixi.toml new file mode 100644 index 0000000..7a8392e --- /dev/null +++ b/static/pixi.toml @@ -0,0 +1,22 @@ +[workspace] +channels = ["https://prefix.dev/conda-forge"] +platforms = ["osx-arm64", "osx-64", "linux-64", "win-64"] +preview = ["pixi-build"] + +[dependencies] +mess-static = { path = "." } + +[package] +name = "mess-static" + +[package.build] +backend = { name = "pixi-build-rattler-build", version = "0.3.*" } + +[feature.dev.dependencies] +rattler-build = "*" + +[feature.dev.tasks] +upload = "rattler-build upload anaconda -o Auto-Mech *.conda || true" + +[environments] +dev = ["dev"] diff --git a/static/recipe.yaml b/static/recipe.yaml index 0f70ab8..1676fe2 100644 --- a/static/recipe.yaml +++ b/static/recipe.yaml @@ -1,6 +1,6 @@ package: name: mess-static - version: "2024.5.16" + version: "2025.9.0" source: path: .