Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update revbayes to v1.2.4 #52069

Merged
merged 9 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 33 additions & 36 deletions recipes/revbayes/build.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
#!/usr/bin/env bash
#!/bin/bash

export INCLUDES="-I${PREFIX}/include"
export LIBPATH="-L${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include"

mkdir -p $PREFIX/bin
cd projects/cmake

if [ ! -d build ]; then
mkdir build
if [[ `uname` == "Darwin" ]]; then
export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER"
else
export CONFIG_ARGS=""
fi
Comment on lines +7 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add error handling for directory navigation

While the platform-specific configuration is well-implemented, the cd command should include error handling to prevent silent failures.

Apply this diff to add error handling:

 mkdir -p $PREFIX/bin
-cd projects/cmake
+cd projects/cmake || exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mkdir -p $PREFIX/bin
cd projects/cmake
if [ ! -d build ]; then
mkdir build
if [[ `uname` == "Darwin" ]]; then
export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER"
else
export CONFIG_ARGS=""
mkdir -p $PREFIX/bin
cd projects/cmake || exit 1
if [[ `uname` == "Darwin" ]]; then
export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER"
else
export CONFIG_ARGS=""
🧰 Tools
🪛 Shellcheck

[warning] 9-9: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)


./generate_version_number.sh
mv GitVersion.cpp ../../src/revlanguage/utils/

# MPI version
./regenerate.sh -mpi true

cd build
./build.sh -mpi true -help2yml true \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-boost_root "${PREFIX}" \
-j "${CPU_COUNT}" \
"${CONFIG_ARGS}"

# If cmake finds a boost version compiled with cmake, it always links to it unless both
# Boost_NO_SYSTEM_PATHS=ON and Boost_NO_BOOST_CMAKE=ON (probably a bug in cmake)
cmake -DCMAKE_PREFIX_PATH=$PREFIX \
-DBOOST_ROOT=$PREFIX \
-DBoost_NO_SYSTEM_PATHS=ON \
-DBoost_NO_BOOST_CMAKE=ON \
.

make

cd ..
mkdir -p $PREFIX/bin
mv rb $PREFIX/bin/rb-mpi
chmod 0755 rb-mpi rb-mpi-help2yml
mv rb-mpi rb-mpi-help2yml $PREFIX/bin/rb-mpi


# Non-mpi version
rm -rf build
mkdir build
rm -rf build-mpi

./regenerate.sh

cd build

# If cmake finds a boost version compiled with cmake, it always links to it unless both
# Boost_NO_SYSTEM_PATHS=ON and Boost_NO_BOOST_CMAKE=ON (probably a bug in cmake)
cmake -DCMAKE_PREFIX_PATH=$PREFIX \
-DBOOST_ROOT=$PREFIX \
-DBoost_NO_SYSTEM_PATHS=ON \
-DBoost_NO_BOOST_CMAKE=ON \
.
./build.sh -mpi false -help2yml true \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-boost_root "${PREFIX}" \
-j "${CPU_COUNT}" \
"${CONFIG_ARGS}"

make

cd ..
mkdir -p $PREFIX/bin
mv rb $PREFIX/bin
chmod 0755 rb rb-help2yml
mv rb rb-help2yml $PREFIX/bin

rm -rf build
47 changes: 31 additions & 16 deletions recipes/revbayes/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,58 @@
{% set version = "1.0.13" %}
{% set name = "revbayes" %}
{% set version = "1.2.4" %}

package:
name: revbayes
name: {{ name }}
version: {{ version }}

build:
number: 7

source:
url: https://github.com/revbayes/revbayes.archive/archive/v{{ version }}.tar.gz
sha256: e85e2e1fe182fe9f504900150d936a06d252a362c591b9d3d8272dd085aa85d9
url: https://github.com/revbayes/revbayes/archive/refs/tags/v{{ version }}.tar.gz
sha256: 020aa32b32db5896b081e14613c754fbb5523f01fa64262f502a6b693db9058a

build:
number: 0
run_exports:
- {{ pin_subpackage('revbayes', max_pin="x") }}

requirements:
build:
- make
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cmake >=2.6
- cmake
host:
- boost-cpp >=1.60
- boost-cpp >=1.71
- openmpi
- llvm-openmp # [osx]
- libgomp # [linux]
run:
- boost-cpp >=1.60
- boost-cpp >=1.71
- openmpi
- llvm-openmp # [osx]
- libgomp # [linux]

test:
commands:
- rb -v
- rb -h
- rb-mpi -v
- rb-mpi -h

about:
home: https://revbayes.github.io/
license: GPLv3
home: "https://revbayes.github.io"
license: "GPL-3.0-or-later"
license_family: GPL3
license_file: LICENSE
summary: Bayesian phylogenetic inference using probabilistic graphical models and an interactive language.
summary: "Bayesian Phylogenetic Inference Using Graphical Models and an Interactive Model-Specification Language."
dev_url: "https://github.com/revbayes/revbayes"
doc_url: "https://revbayes.github.io/tutorials"

extra:
container:
# openmpi needs ssh/rsh
extended-base: true
extended-base: True
identifiers:
- biotools:revbayes
- doi:10.1093/sysbio/syw021
- doi:10.1093/sysbio/syu039
additional-platforms:
- linux-aarch64
- osx-arm64
Loading