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

[Foldseek] update to v6 #6858

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
50 changes: 30 additions & 20 deletions F/Foldseek/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
# TODO
# - use Zstd_jll ? (static lib?) (now uses builtin zstd lib)

# Build fails
# - x86_64-freebsd
# compilation error, seems like a clash between KASSERT macro defined in lib/kerasify/keras_model.h
# and usage in freebsd headers, e.g. at line 190 of
# /opt/x86_64-unknown-freebsd12.2/x86_64-unknown-freebsd12.2/sys-root//usr/include/sys/time.h
# see: https://github.com/JuliaPackaging/Yggdrasil/pull/6195#issuecomment-1416227398

using BinaryBuilder, Pkg

name = "Foldseek"

# foldseek seem to use as versioning scheme of "major version + first 7
# characters of the tagged commit"
version = v"5"
# version_commitprefix = "53465f0"
version = v"6"

# url = "https://github.com/steineggerlab/foldseek"
# description = "Fast and sensitive comparisons of large protein structure sets"

sources = [
# Foldseek 5-53465f0
# Note: this is the same commit as v"4" in Yggdrasil
# Foldseek 6-29e2557
GitSource("https://github.com/steineggerlab/foldseek",
"53465f07cdeed1f7fda08ee7f188327cb57c37ba"),
"29e2557970c39c8e689601ecaae2279fff4faa17"),
DirectorySource("./bundled"),
]

# TODO
# - use Zstd_jll ? (static lib?) (now uses builtin zstd lib)

# Build fails
# - x86_64-freebsd
# compilation error, seems like a clash between KASSERT macro defined in lib/kerasify/keras_model.h
# and usage in freebsd headers, e.g. at line 190 of
# /opt/x86_64-unknown-freebsd12.2/x86_64-unknown-freebsd12.2/sys-root//usr/include/sys/time.h
# see: https://github.com/JuliaPackaging/Yggdrasil/pull/6195#issuecomment-1416227398

script = raw"""
cd $WORKSPACE/srcdir/foldseek*/

# patch lib/mmseqs/CMakeLists.txt so it doesn't set -march unnecessarily on ARM
atomic_patch -p1 ../patches/mmseqs-arm-simd-march-cmakefile.patch

# remove rustup check in corrosion's FindRust.cmake
atomic_patch -p1 ../patches/corrosion-remove-rustup-check.patch

ARCH_FLAGS=
if [[ "${target}" == x86_64-* || "${target}" == i686-* ]]; then
ARCH_FLAGS="-DHAVE_SSE2=1 -DHAVE_SSE4_1=1 -DHAVE_AVX2=1"
Expand All @@ -43,10 +41,22 @@ elif [[ "${target}" == aarch64-* ]]; then
ARCH_FLAGS="-DHAVE_ARM8=1"
fi

# hack around corrosion (cmake cargo interop package) using a wrong
# target string when cross-compiling
CARGO_TARGET=
if [[ "${target}" == *-linux-* ]]; then
# cargo uses an extra 'unknown' in the target string,
# e.g. 'x86_64-linux-gnu' becomes 'x86_64-unknown-linux-gnu' in cargo
CARGO_TARGET=$(echo ${target} | cut -d- -f1)-unknown-$(echo ${target} | cut -d- -f2-)
else
CARGO_TARGET=${target}
fi

Comment on lines +44 to +54
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this ${CARGO_BUILD_TARGET} already?

mkdir build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=RELEASE \
-DNATIVE_ARCH=0 ${ARCH_FLAGS}
-DNATIVE_ARCH=0 ${ARCH_FLAGS} \
-DRust_COMPILER=$(which ${RUSTC}) -DRust_CARGO_TARGET=${CARGO_TARGET}
make -j${nproc}
make install

Expand All @@ -72,4 +82,4 @@ dependencies = Dependency[
]

build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
julia_compat="1.6", preferred_gcc_version = v"8")
julia_compat="1.6", preferred_gcc_version = v"8", compilers=[:c, :rust])
21 changes: 21 additions & 0 deletions F/Foldseek/bundled/patches/corrosion-remove-rustup-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/lib/corrosion/cmake/FindRust.cmake b/lib/corrosion/cmake/FindRust.cmake
index ba2bd8a..4757f45 100644
--- a/lib/corrosion/cmake/FindRust.cmake
+++ b/lib/corrosion/cmake/FindRust.cmake
@@ -271,11 +271,11 @@ else()
RESULT_VARIABLE _RUSTC_VERSION_RESULT
)

- if(NOT (_RUSTC_VERSION_RESULT EQUAL "0"))
- _findrust_failed("`${_Rust_COMPILER_TEST} --version` failed with ${_RUSTC_VERSION_RESULT}\n"
- "rustc stderr:\n${_RUSTC_VERSION_STDERR}"
- )
- endif()
+ #if(NOT (_RUSTC_VERSION_RESULT EQUAL "0"))
+ # _findrust_failed("`${_Rust_COMPILER_TEST} --version` failed with ${_RUSTC_VERSION_RESULT}\n"
+ # "rustc stderr:\n${_RUSTC_VERSION_STDERR}"
+ # )
+ #endif()

if (_RUSTC_VERSION_RAW MATCHES "rustup [0-9\\.]+")
if (_USER_SPECIFIED_RUSTC)