Skip to content

Commit 1f80c8e

Browse files
committed
Merge commit 'f8bcf8d961df07a4d9c245212806f735d0a8c79a'
2 parents 1f7d702 + f8bcf8d commit 1f80c8e

File tree

304 files changed

+56056
-11563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+56056
-11563
lines changed

lib/mmseqs/.cirrus.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ env:
22
CIRRUS_CLONE_SUBMODULES: true
33

44
task:
5-
name: FreeBSD-13
5+
name: FreeBSD
66
freebsd_instance:
7-
image_family: freebsd-13-2-snap
7+
image_family: freebsd-14-2-snap
88
install_script: pkg install -y cmake git samtools
99
compile_script: |
1010
mkdir build && cd build
@@ -24,7 +24,7 @@ task:
2424
echo "deb [trusted=yes] http://archive.debian.org/debian jessie main" > /etc/apt/sources.list
2525
echo "deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list
2626
apt-get update --yes --force-yes || true
27-
apt-get install cmake clang-4.0 libc++-dev make git ca-certificates --yes --force-yes --no-install-suggests --no-install-recommends
27+
apt-get install wget clang-4.0 libc++-dev make git ca-certificates --yes --force-yes --no-install-suggests --no-install-recommends
2828
env:
2929
CC: clang-4.0
3030
CXX: clang++-4.0
@@ -33,13 +33,20 @@ task:
3333
echo "deb [trusted=yes] http://archive.debian.org/debian jessie main" > /etc/apt/sources.list
3434
echo "deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list
3535
apt-get update --yes --force-yes || true
36-
apt-get install cmake gcc-4.9 g++-4.9 make git ca-certificates --yes --force-yes --no-install-suggests --no-install-recommends
36+
apt-get install wget gcc-4.9 g++-4.9 make git ca-certificates --yes --force-yes --no-install-suggests --no-install-recommends
3737
env:
3838
CC: gcc-4.9
3939
CXX: g++-4.9
4040
compile_script: |
41+
mkdir -p /opt/cmake-3.31.0
42+
wget https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.sh
43+
chmod +x cmake-3.31.0-linux-x86_64.sh
44+
./cmake-3.31.0-linux-x86_64.sh --skip-license --prefix=/opt/cmake-3.31.0
45+
export PATH=/opt/cmake-3.31.0/bin/:$PATH
4146
mkdir build && cd build
42-
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_SSE4_1=1 -DREQUIRE_OPENMP=0 ..
47+
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=0 -DHAVE_SSE4_1=1 -DREQUIRE_OPENMP=0 ..
4348
make -j $(nproc --all)
44-
test_script: MMSEQS_NUM_THREADS=4 ./util/regression/run_regression.sh ./build/src/mmseqs SCRATCH SEARCH
49+
test_script: |
50+
export PATH=/opt/cmake-3.31.0/bin/:$PATH
51+
MMSEQS_NUM_THREADS=4 ./util/regression/run_regression.sh ./build/src/mmseqs SCRATCH SEARCH
4552
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ghcr.io/steineggerlab/build-containers:main-sbsa
2+
WORKDIR /work
3+
ADD . .
4+
5+
RUN mkdir -p /work/build && cd /work/build; \
6+
/usr/local/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_ARM8=1 \
7+
-DCMAKE_TOOLCHAIN_FILE=/opt/toolchain.cmake \
8+
-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I${LIBOMP_AARCH64}" -DOpenMP_C_LIB_NAMES=omp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I${LIBOMP_AARCH64}" -DOpenMP_CXX_LIB_NAMES=omp -DOpenMP_omp_LIBRARY=${LIBOMP_AARCH64}/libomp.a \
9+
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_POLICY_DEFAULT_CMP0144=NEW \
10+
-DFORCE_STATIC_DEPS=1 -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" ..; \
11+
cmake --build . -j$(nproc --all) -v;
12+
13+
RUN if readelf -a /work/build/src/mmseqs | grep -i "Shared library" | grep -P -v "(linux-vdso|ld-linux-aarch64|libc|libm|libdl|librt|libpthread).so" | grep -q .; then \
14+
echo "Error: unwanted libraries found"; \
15+
readelf -a /work/build/src/mmseqs | grep -i "Shared library"; \
16+
exit 1; \
17+
fi; \
18+
if readelf -Ws /work/build/src/mmseqs | grep -q GLIBC_PRIVATE; then \
19+
echo "Error: binary contains private glibc symbols"; \
20+
readelf -Ws /work/build/src/mmseqs; \
21+
exit 1; \
22+
fi; \
23+
LIBC_V=$(readelf -V /work/build/src/mmseqs | awk '$3 ~ /^GLIBC_/ { print $3 }' | sort -V | tail -n1); \
24+
if awk -v ver="$LIBC_V" 'BEGIN { split(ver, v, /[_.]/); if ((v[2] > 2) || (v[2] == 2 && v[3] > 28)) exit 0; exit 1; }'; then \
25+
echo "Error: glibc too new"; \
26+
exit 1; \
27+
fi;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM ghcr.io/steineggerlab/build-containers:main-x86_64
2+
3+
WORKDIR /work
4+
ADD . .
5+
RUN mkdir -p /work/build && cd /work/build; \
6+
if [ -e "${LIBGCC}/libgomp.so" ]; then \
7+
mv -f -- "${LIBGCC}/libgomp.so" "${LIBGCC}/libgomp.so.disabled"; \
8+
fi; \
9+
/usr/local/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_AVX2=1 \
10+
-DOpenMP_C_FLAGS="-fopenmp -I${LIBGCC} -L${LIBGCC}" -DOpenMP_C_LIB_NAMES=gomp -DOpenMP_CXX_FLAGS="-fopenmp -I${LIBGCC} -L${LIBGCC}" -DOpenMP_CXX_LIB_NAMES=gomp -DOpenMP_gomp_LIBRARY="${LIBGCC}/libgomp.a" \
11+
-DATOMIC_LIB_OVERRIDE="${LIBGCC}/libatomic.a" \
12+
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_POLICY_DEFAULT_CMP0144=NEW \
13+
-DZLIB_ROOT=/deps -DBZIP2_ROOT=/deps \
14+
-DFORCE_STATIC_DEPS=1 -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" ..; \
15+
cmake --build . -j$(nproc --all) -v;
16+
17+
RUN if ldd /work/build/src/mmseqs | grep -P -v "linux-vdso.so|/lib64/(ld-linux-x86-64|libc|libm|libdl|librt|libpthread).so" | grep -q .; then \
18+
echo "Error: unwanted libraries found"; \
19+
ldd /work/build/src/mmseqs; \
20+
exit 1; \
21+
fi; \
22+
if readelf -Ws /work/build/src/mmseqs | grep -q GLIBC_PRIVATE; then \
23+
echo "Error: binary contains private glibc symbols"; \
24+
readelf -Ws /work/build/src/mmseqs; \
25+
exit 1; \
26+
fi; \
27+
LIBC_V=$(readelf -V /work/build/src/mmseqs | awk '$3 ~ /^GLIBC_/ { print $3 }' | sort -V | tail -n1); \
28+
if [[ "$LIBC_V" > "GLIBC_2.17" ]]; then \
29+
echo "Error: glibc too new"; \
30+
readelf -V /work/build/src/mmseqs; \
31+
exit 1; \
32+
fi;

lib/mmseqs/.github/workflows/docker.yml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ on:
1111
tag:
1212
required: true
1313
type: string
14+
description: "Docker tag"
1415
latest:
1516
default: false
1617
type: boolean
18+
description: "Mark as latest"
1719

1820

1921
env:
@@ -45,7 +47,7 @@ jobs:
4547

4648
- name: Extract metadata (tags, labels) for Docker
4749
id: meta
48-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
50+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
4951
with:
5052
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5153

@@ -77,4 +79,63 @@ jobs:
7779
${{ steps.dispatch_tag.outputs.tag }}
7880
${{ steps.dispatch_tag.outputs.latest }}
7981
labels: ${{ steps.meta.outputs.labels }}
82+
build-and-push-gpu-image:
83+
runs-on: ubuntu-latest
84+
permissions:
85+
contents: read
86+
packages: write
87+
steps:
88+
- name: Checkout repository
89+
uses: actions/checkout@v3
90+
91+
# - name: Set up QEMU
92+
# uses: docker/setup-qemu-action@v2
93+
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v2
96+
97+
- name: Log in to the Container registry
98+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
99+
with:
100+
registry: ${{ env.REGISTRY }}
101+
username: ${{ github.actor }}
102+
password: ${{ secrets.GITHUB_TOKEN }}
103+
104+
- name: Extract metadata (tags, labels) for Docker
105+
id: meta
106+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
107+
with:
108+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
109+
flavor: |
110+
suffix=-cuda12,onlatest=true
111+
112+
- name: Tag for workflow_dispatch
113+
id: dispatch_tag
114+
run: |
115+
if [ x"$TAG" != x"" ];then
116+
echo "::set-output name=tag::${FULL_TAG}"
117+
fi
118+
if [ x"$LATEST" = x"true" ]; then
119+
echo "::set-output name=latest::${LATEST_TAG}"
120+
fi
121+
env:
122+
FULL_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}
123+
LATEST_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
124+
TAG: ${{ github.event.inputs.tag }}
125+
LATEST: ${{ github.event.inputs.latest }}
80126

127+
- name: Build and push Docker image
128+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
129+
with:
130+
context: .
131+
platforms: linux/amd64
132+
push: true
133+
cache-from: type=gha
134+
cache-to: type=gha,mode=max
135+
build-args: |
136+
GPU=1
137+
tags: |
138+
${{ steps.meta.outputs.tags }}
139+
${{ steps.dispatch_tag.outputs.tag }}
140+
${{ steps.dispatch_tag.outputs.latest }}
141+
labels: ${{ steps.meta.outputs.labels }}

lib/mmseqs/.github/workflows/mac-arm64.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ on:
77

88
jobs:
99
build:
10-
runs-on: [self-hosted, macOS, ARM64]
10+
runs-on: macos-latest
1111
steps:
1212
- uses: actions/checkout@v3
1313
with:
1414
submodules: true
1515

16+
- name: Dependencies
17+
run: |
18+
brew install -f --overwrite libomp
19+
1620
- name: Build
1721
run: |
1822
mkdir -p build
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test GPU
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
test_gpu:
8+
runs-on: [ self-hosted, slurm, gpu ]
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
submodules: true
13+
- name: Test GPU
14+
run: |
15+
source /home/cirunner/miniforge3/etc/profile.d/conda.sh
16+
conda activate nvcc
17+
mkdir build && cd build
18+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="native" ..
19+
make -j$(nproc --all)
20+
- name: Regression
21+
run: |
22+
./util/regression/run_regression.sh ./build/src/mmseqs SCRATCH

lib/mmseqs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
src/workflow/time_test
3131

3232
build/
33+
build-*/
3334
.idea/
3435
cmake-build-*/
3536
BenchmarkingDatas/

lib/mmseqs/CMakeLists.txt

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
22
project(MMseqs CXX C)
33
message("-- Source Directory: ${CMAKE_CURRENT_SOURCE_DIR}")
44
message("-- Project Directory: ${PROJECT_SOURCE_DIR}")
@@ -18,6 +18,25 @@ set(HAVE_ARM8 0 CACHE BOOL "Have ARMv8 CPU")
1818
set(HAVE_S390X 0 CACHE BOOL "Have s390x architecture")
1919
set(NATIVE_ARCH 1 CACHE BOOL "Assume native architecture for SIMD. Use one of the HAVE_* options or set CMAKE_CXX_FLAGS to the appropriate flags if you disable this.")
2020
set(USE_SYSTEM_ZSTD 0 CACHE BOOL "Use zstd provided by system instead of bundled version")
21+
set(ENABLE_CUDA 0 CACHE BOOL "Enable CUDA")
22+
set(FORCE_STATIC_DEPS 0 CACHE BOOL "Force static linking of deps")
23+
24+
if(FORCE_STATIC_DEPS)
25+
if(ENABLE_CUDA)
26+
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .so CACHE INTERNAL "" FORCE)
27+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
28+
else()
29+
set(CMAKE_FIND_LIBRARY_SUFFIXES .a CACHE INTERNAL "" FORCE)
30+
set(CMAKE_LINK_SEARCH_START_STATIC ON CACHE INTERNAL "" FORCE)
31+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++")
32+
endif()
33+
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
34+
endif()
35+
36+
if(NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
37+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
38+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
39+
endif()
2140

2241
if (HAVE_SANITIZER)
2342
include(FindUBSan)
@@ -26,10 +45,6 @@ if (HAVE_SANITIZER)
2645
include(FindTSan)
2746
endif ()
2847

29-
if (NOT CMAKE_BUILD_TYPE)
30-
set(CMAKE_BUILD_TYPE Release)
31-
endif ()
32-
3348
# find compiler
3449
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
3550
message("-- Compiler is clang(++)")
@@ -51,9 +66,9 @@ set(MMSEQS_CXX_FLAGS "-fsigned-char")
5166
set(MMSEQS_ARCH "")
5267
if (HAVE_AVX2)
5368
if (CMAKE_COMPILER_IS_CLANG)
54-
set(MMSEQS_ARCH "${MMSEQS_ARCH} -mavx2 -mcx16")
69+
set(MMSEQS_ARCH "${MMSEQS_ARCH} -mavx2 -mfma -mcx16")
5570
else ()
56-
set(MMSEQS_ARCH "${MMSEQS_ARCH} -mavx2 -mcx16 -Wa,-q")
71+
set(MMSEQS_ARCH "${MMSEQS_ARCH} -mavx2 -mfma -mcx16 -Wa,-q")
5772
endif ()
5873
set(X64 1 CACHE INTERNAL "")
5974
elseif (HAVE_SSE4_1)
@@ -77,7 +92,11 @@ elseif (HAVE_S390X)
7792
set(ZARCH 1 CACHE INTERNAL "")
7893
endif ()
7994

80-
if (NATIVE_ARCH AND (MMSEQS_ARCH STREQUAL ""))
95+
if (MMSEQS_ARCH)
96+
set(NATIVE_ARCH 0 CACHE INTERNAL "")
97+
endif ()
98+
99+
if (NATIVE_ARCH)
81100
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*|aarch64.*|AARCH64.*)")
82101
set(ARM 1 CACHE INTERNAL "")
83102
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "PPC64*|ppc64*|powerpc64*")
@@ -118,6 +137,13 @@ if (NATIVE_ARCH AND (MMSEQS_ARCH STREQUAL ""))
118137
endif ()
119138
endif ()
120139

140+
if (ARM AND CMAKE_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 20.1.5)
141+
message("-- Setting -DAVX2 ON ARM")
142+
set(MMSEQS_ARCH "${MMSEQS_ARCH} -DAVX2")
143+
endif ()
144+
145+
set(MMSEQS_ARCH ${MMSEQS_ARCH} CACHE INTERNAL "")
146+
121147
if (NOT (MMSEQS_ARCH STREQUAL ""))
122148
set(MMSEQS_CXX_FLAGS "${MMSEQS_CXX_FLAGS} ${MMSEQS_ARCH}")
123149
endif ()
@@ -164,11 +190,11 @@ endif ()
164190
set(MMSEQS_C_FLAGS "${MMSEQS_CXX_FLAGS}")
165191
set(MMSEQS_CXX_FLAGS "${MMSEQS_CXX_FLAGS} -std=c++1y")
166192
# Compiler-specific features
167-
if (CMAKE_COMPILER_IS_CLANG AND (NOT EMSCRIPTEN))
168-
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
169-
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
170-
set(MMSEQS_CXX_FLAGS "${MMSEQS_CXX_FLAGS} -stdlib=libc++")
171-
endif ()
193+
# if (CMAKE_COMPILER_IS_CLANG AND (NOT EMSCRIPTEN))
194+
# set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
195+
# set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
196+
# set(MMSEQS_CXX_FLAGS "${MMSEQS_CXX_FLAGS} -stdlib=libc++")
197+
# endif ()
172198

173199
if (USE_SYSTEM_ZSTD)
174200
include(FindPackageHandleStandardArgs)
@@ -204,21 +230,29 @@ add_subdirectory(lib/tinyexpr EXCLUDE_FROM_ALL)
204230
include_directories(lib/microtar)
205231
add_subdirectory(lib/microtar)
206232

233+
# tantan
234+
include_directories(lib/tantan)
235+
add_subdirectory(lib/tantan)
236+
207237
# simde
208238
include_directories(lib/simde)
209239

210240
include_directories(lib)
211241
include_directories(lib/simd)
212-
include_directories(lib/gzstream)
213242
include_directories(lib/alp)
214-
include_directories(lib/cacode)
215243
include_directories(lib/ksw2)
216244
include_directories(lib/xxhash)
217245
if (NOT DISABLE_IPS4O)
218246
include_directories(lib/ips4o)
219247
endif ()
220248

221-
add_subdirectory(lib/cacode)
249+
# libmarv
250+
if (ENABLE_CUDA)
251+
set(LIBRARY_ONLY 1 CACHE INTERNAL "" FORCE)
252+
include_directories(lib/libmarv/src)
253+
add_subdirectory(lib/libmarv/src EXCLUDE_FROM_ALL)
254+
endif ()
255+
222256
add_subdirectory(lib/alp)
223257
add_subdirectory(lib/ksw2)
224258
add_subdirectory(data)

0 commit comments

Comments
 (0)