Skip to content

Commit

Permalink
Merge branch 'master' into multichrom
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaller committed Nov 12, 2024
2 parents 519d459 + 6e77cf4 commit 08651e2
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 29 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]
tests-Unix-CLI:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
strategy:
fail-fast: false
matrix:
Expand All @@ -22,22 +23,20 @@ jobs:
- {os: ubuntu-20.04, gcc: 7, python: 3.8}
- {os: ubuntu-20.04, gcc: 11, python: 3.9}
# macOS, oldest supported version
# (macos-10.15 and macos-11 were removed by GitHub)
- {os: macos-12, python: 3.8}
# macOS, newest supported version (haven't tried macos-14 yet)
# (macos-10.15, macos-11, and macos-12 were removed by GitHub)
- {os: macos-13, python: 3.9}
# macOS, newest supported version
- {os: macos-15, python: 3.9}

runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true
python-version: ${{ matrix.python }}
- name: Get Date
id: get-date
Expand All @@ -58,7 +57,7 @@ jobs:
id: cache
- name: Update environment
run:
mamba env update -n anaconda-client-env -f treerec/tests/environment.yml
conda env update -n anaconda-client-env -f treerec/tests/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Workaround for gcc-11
if: startsWith(matrix.os, 'ubuntu') && matrix.gcc == 11
Expand Down Expand Up @@ -93,6 +92,7 @@ jobs:
cd treerec/tests && python -m pytest -xv
tests-Windows-CLI:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
runs-on: windows-latest
strategy:
fail-fast: false
Expand All @@ -117,13 +117,11 @@ jobs:
msys2-devel
mingw-w64-${{matrix.env}}-toolchain
mingw-w64-${{matrix.env}}-cmake
- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true
auto-update-conda: true
python-version: ${{ matrix.python }}
- name: Get Date
Expand All @@ -132,21 +130,27 @@ jobs:
shell: bash
- name: Cache Conda env
uses: actions/cache@v3
env:
# Increase this value to reset cache if treerec/tests/environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ${{ env.CONDA }}/envs
# Use faster GNU tar
enableCrossOsArchive: true
path: D:\conda_pkgs_dir
key:
conda-${{ runner.os }}--python-${{ matrix.python }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('treerec/tests/environment.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if
# treerec/tests/environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: anaconda-client-env
environment-file: treerec/tests/environment.yml
pkgs-dirs: D:\conda_pkgs_dir
- name: Update environment
shell: bash -el {0}
run:
mamba env update -n anaconda-client-env -f treerec/tests/environment.yml
conda env update -n anaconda-client-env -f treerec/tests/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Build and test (Debug)
run: |
Expand Down Expand Up @@ -175,6 +179,7 @@ jobs:
cd treerec/tests && python -m pytest -xv
tests-Unix-GUI:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -227,6 +232,7 @@ jobs:
make -j 2 && make test
tests-Windows-GUI:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -264,6 +270,7 @@ jobs:
make -j 2 && make test
tests-windows-latest-pacman:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'messerlab/slim')
runs-on: windows-latest
strategy:
fail-fast: false
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ if(NOT CMAKE_BUILD_TYPE)
endif(NOT CMAKE_BUILD_TYPE)

# Add "-D BUILD_SLIMGUI=ON" to the CMake command to build SLiMgui
# This requires that Qt 5, a widget framework, is installed
option(BUILD_SLIMGUI "Build the Qt5-based GUI for SLiM" OFF)
# This requires that Qt, a widget framework, is installed
option(BUILD_SLIMGUI "Build the Qt-based GUI for SLiM" OFF)

# Add "-D PARALLEL=ON" to the CMake command to make a parallel (multi-threaded) build
# This is supported only for the command-line tools, not for SLiMgui; do not set BUILD_SLIMGUI
Expand Down
73 changes: 65 additions & 8 deletions SLiM.spec
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# Cross-distribution SLiM RPM spec.
# Defines:
%if %{defined suse_version}
%define qt5 libqt5
%if 0%{?suse_version} < 1600
%global qtNameAndVersion libqt5
%else
%define qt5 qt5
%global qtNameAndVersion qt6
%endif
%endif

%if %{defined fedora}
%if 0%{?fedora} >= 39
%global qtNameAndVersion qt6
%else
%global qtNameAndVersion qt5
%endif
%endif

%if %{defined rhel}
%if 0%{?epel} >= 9
# qt6 is only available through EPEL on RHEL 9 and higher
%global qtNameAndVersion qt6
%else
%global qtNameAndVersion qt5
%endif
%endif

Name: SLiM
Expand All @@ -22,21 +40,29 @@ Conflicts: slim
BuildRequires: cmake
# openSUSE Build Requires
%if %{defined suse_version}
%if 0%{?suse_version} >= 1500
BuildRequires: glew-devel
BuildRequires: Mesa-libGL-devel
BuildRequires: gcc-c++
BuildRequires: libqt5-qtbase-devel
BuildRequires: appstream-glib-devel
%if 0%{?suse_version} < 1600
BuildRequires: %{qtNameAndVersion}-qtbase-devel
%else
# only Tumbleweed officially supports Qt6; further, it's "base" not "qtbase" in Tumbleweed. :(
BuildRequires: %{qtNameAndVersion}-base-devel
%endif
%else
BuildRequires: qt5-qtbase-devel
# if not on openSUSE
BuildRequires: %{qtNameAndVersion}-qtbase-devel
BuildRequires: libappstream-glib
%endif
ExclusiveArch: x86_64

# RHEL 8 has the oldest point release of 5.15, and is the oldest RHEL supported.
Requires: %{qt5}-qtbase >= 5.15.1
%if 0%{?rhel} == 8
Requires: qt5-qtbase >= 5.15.1
%else
Requires: %{qtNameAndVersion}-qtbase
%endif

%description
SLiM is an evolutionary simulation framework that combines a powerful engine for
Expand All @@ -53,11 +79,32 @@ visualization of simulation output.
%setup -q

%build
%if 0%{?rhel} == 8
%if "%_vpath_builddir" != "%_vpath_srcdir"
echo "current directory: %(pwd)"
echo "source directory: %_vpath_srcdir"
echo "build directory: %_vpath_builddir"
mkdir -p %_vpath_builddir
%else
%{warn "The build directory is the same as the source directory on RHEL 8!"}
%endif

## Tell CMake where the source directory and the build directory are, directly.
%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON
cd %_vpath_builddir
%else
# rpmbuild is not running on RHEL 8
%cmake -DBUILD_SLIMGUI=ON
%endif

%cmake_build

%install
%if 0%{?rhel} == 8
cmake --install %_vpath_builddir --prefix %{buildroot}/usr
%else
%cmake_install
%endif

%files
%{_bindir}/eidos
Expand All @@ -72,6 +119,16 @@ visualization of simulation output.
%{_datadir}/mime/packages/org.messerlab.slimgui-mime.xml

%changelog
* Sun Sep 15 2024 Bryce Carson <[email protected]> - 4.3-2
- Significant work has been invested into debugging the build of RHEL 8 on COPR. For whatever reason, since 4.0.1-1, we were unable to build on RHEL 8 (or perhaps it was EPEL 8?). Regardless, the ability to build on RHEL 8 and EPEL 8 has been achieved or restored, using conditionals which check what distribution the build is occuring on. These conditionals check the distribution using the defined RPM macros, a reliable system that the operating systems try not to step on each others toes; it'd be nicer if CentOS didn't call itself RHEL, though, but CentOS purposefully tries to be "bug-compatible" (if I recall) with RHEL, yet be slightly upstream of it with RHEL. The buildroot (which is the installation prefix within the CHROOT) and the source and build directories must be manually specified when building on RHEL 8 or EPEL 8 systems (which is RHEL 8 + EPEL [the extra packages for enterprise linux repository] for RHEL 8). I don't know what changed amongst the macros, if anything ever did change, but with 4.0.1-1 we were able to build for EPEL 8 two years ago, and then we weren't when I tried however long ago that issue four-hundred and forty cropped up. This has been resolved with the use of conditionals in the RPM preprocessor (do recall that "if" is not actually a macro) and RPM macros.
- Conditionals and macros are used to decide whether to use Qt 6 or Qt 5.

* Mon Sep 02 2024 Bryce Carson <[email protected]> - 4.3-1
- Changes to the package have occurred. See the following points.
- Further version checks for various distributions are introduced to allow cross-distribution packaging and building against Qt5 or Qt6, appropriate to the platform.
- An attempt to fix issue 440 is made
- See the SLiM release notes on GitHub for information about changes to the packaged software.

* Tue Apr 30 2024 Ben Haller <[email protected]> - 4.2.2-1
- No changes to the package have been made since the last release.
- Ship the fix for the 4.2.1-2 crashing bug as a separate release.
Expand All @@ -85,7 +142,7 @@ visualization of simulation output.
- No changes to the package have been made since the last release.
- Fix for a crashing bug under certain conditions.

* Thu Mar 20 2024 Bryce Carson <[email protected]> - 4.2-1
* Wed Mar 20 2024 Bryce Carson <[email protected]> - 4.2-1
- No changes to the package have been made since the last release. See the SLiM release notes on GitHub for information about changes to the packaged software.

* Mon Dec 4 2023 Bryce Carson <[email protected]> - 4.1-1
Expand Down
1 change: 1 addition & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Note that not every commit will be logged here; that is what the Github commit h


development head (in the master branch):
fix the wiring for calcPi() and calcTajimasD() to call the correct code; they were broken in SLiM 4.3
multi-chromosome transition:
API changes:
x class Genome -> class Haplosome
Expand Down
6 changes: 4 additions & 2 deletions core/slim_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ extern const char *gSLiMSourceCode_calcPairHeterozygosity;
extern const char *gSLiMSourceCode_calcHeterozygosity;
extern const char *gSLiMSourceCode_calcWattersonsTheta;
extern const char *gSLiMSourceCode_calcInbreedingLoad;
extern const char *gSLiMSourceCode_calcPi;
extern const char *gSLiMSourceCode_calcTajimasD;


const std::vector<EidosFunctionSignature_CSP> *Community::SLiMFunctionSignatures(void)
Expand Down Expand Up @@ -71,8 +73,8 @@ const std::vector<EidosFunctionSignature_CSP> *Community::SLiMFunctionSignatures
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("calcHeterozygosity", gSLiMSourceCode_calcHeterozygosity, kEidosValueMaskFloat | kEidosValueMaskSingleton, "SLiM"))->AddObject("haplosomes", gSLiM_Haplosome_Class)->AddObject_ON("muts", gSLiM_Mutation_Class, gStaticEidosValueNULL)->AddInt_OSN("start", gStaticEidosValueNULL)->AddInt_OSN("end", gStaticEidosValueNULL));
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("calcWattersonsTheta", gSLiMSourceCode_calcWattersonsTheta, kEidosValueMaskFloat | kEidosValueMaskSingleton, "SLiM"))->AddObject("haplosomes", gSLiM_Haplosome_Class)->AddObject_ON("muts", gSLiM_Mutation_Class, gStaticEidosValueNULL)->AddInt_OSN("start", gStaticEidosValueNULL)->AddInt_OSN("end", gStaticEidosValueNULL));
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("calcInbreedingLoad", gSLiMSourceCode_calcInbreedingLoad, kEidosValueMaskFloat | kEidosValueMaskSingleton, "SLiM"))->AddObject("haplosomes", gSLiM_Haplosome_Class)->AddObject_OSN("mutType", gSLiM_MutationType_Class, gStaticEidosValueNULL));
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("calcPi", gSLiMSourceCode_calcWattersonsTheta, kEidosValueMaskFloat | kEidosValueMaskSingleton, "SLiM"))->AddObject("haplosomes", gSLiM_Haplosome_Class)->AddObject_ON("muts", gSLiM_Mutation_Class, gStaticEidosValueNULL)->AddInt_OSN("start", gStaticEidosValueNULL)->AddInt_OSN("end", gStaticEidosValueNULL));
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("calcTajimasD", gSLiMSourceCode_calcWattersonsTheta, kEidosValueMaskFloat | kEidosValueMaskSingleton, "SLiM"))->AddObject("haplosomes", gSLiM_Haplosome_Class)->AddObject_ON("muts", gSLiM_Mutation_Class, gStaticEidosValueNULL)->AddInt_OSN("start", gStaticEidosValueNULL)->AddInt_OSN("end", gStaticEidosValueNULL));
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("calcPi", gSLiMSourceCode_calcPi, kEidosValueMaskFloat | kEidosValueMaskSingleton, "SLiM"))->AddObject("haplosomes", gSLiM_Haplosome_Class)->AddObject_ON("muts", gSLiM_Mutation_Class, gStaticEidosValueNULL)->AddInt_OSN("start", gStaticEidosValueNULL)->AddInt_OSN("end", gStaticEidosValueNULL));
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("calcTajimasD", gSLiMSourceCode_calcTajimasD, kEidosValueMaskFloat | kEidosValueMaskSingleton, "SLiM"))->AddObject("haplosomes", gSLiM_Haplosome_Class)->AddObject_ON("muts", gSLiM_Mutation_Class, gStaticEidosValueNULL)->AddInt_OSN("start", gStaticEidosValueNULL)->AddInt_OSN("end", gStaticEidosValueNULL));

// Other built-in SLiM functions
sim_func_signatures_.emplace_back((EidosFunctionSignature *)(new EidosFunctionSignature("summarizeIndividuals", SLiM_ExecuteFunction_summarizeIndividuals, kEidosValueMaskFloat, "SLiM"))->AddObject("individuals", gSLiM_Individual_Class)->AddInt("dim")->AddNumeric("spatialBounds")->AddString_S("operation")->AddLogicalEquiv_OSN("empty", gStaticEidosValue_Float0)->AddLogical_OS("perUnitArea", gStaticEidosValue_LogicalF)->AddString_OSN("spatiality", gStaticEidosValueNULL));
Expand Down
2 changes: 1 addition & 1 deletion treerec/tests/environment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
channels:
- conda-forge
- defaults
- nodefaults
dependencies:
- tskit >= 0.4.1
- msprime >= 1.2.0
Expand Down

0 comments on commit 08651e2

Please sign in to comment.