Skip to content

Commit 2d7c214

Browse files
committed
change cirrus.yml to support rust & clean up code for clang/bsd build
1 parent b5a8cff commit 2d7c214

19 files changed

+48
-58
lines changed

.cirrus.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ task:
55
name: FreeBSD
66
freebsd_instance:
77
image_family: freebsd-14-2-snap
8-
install_script: pkg install -y cmake git samtools
8+
install_script: |
9+
pkg update -f
10+
pkg install -y cmake git samtools rust
11+
export PATH=/usr/local/bin:$PATH
912
compile_script: |
1013
mkdir build && cd build
11-
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_SSE4_1=1 ..
14+
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_SSE4_1=1 -DRust_COMPILER=/usr/local/bin/rustc ..
1215
make -j $(sysctl -n hw.ncpu)
1316
test_script: ./util/regression/run_regression.sh ./build/src/mmseqs SCRATCH
1417

@@ -24,7 +27,9 @@ task:
2427
echo "deb [trusted=yes] http://archive.debian.org/debian jessie main" > /etc/apt/sources.list
2528
echo "deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list
2629
apt-get update --yes --force-yes || true
27-
apt-get install wget clang-4.0 libc++-dev make git ca-certificates --yes --force-yes --no-install-suggests --no-install-recommends
30+
apt-get install -y --no-install-suggests --no-install-recommends wget clang-4.0 libc++-dev make git ca-certificates curl
31+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
32+
export PATH=/root/.cargo/bin:$PATH
2833
env:
2934
CC: clang-4.0
3035
CXX: clang++-4.0
@@ -33,20 +38,24 @@ task:
3338
echo "deb [trusted=yes] http://archive.debian.org/debian jessie main" > /etc/apt/sources.list
3439
echo "deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list
3540
apt-get update --yes --force-yes || true
36-
apt-get install wget gcc-4.9 g++-4.9 make git ca-certificates --yes --force-yes --no-install-suggests --no-install-recommends
41+
apt-get install -y --no-install-suggests --no-install-recommends wget gcc-4.9 g++-4.9 make git ca-certificates curl
42+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
43+
export PATH=/root/.cargo/bin:$PATH
3744
env:
3845
CC: gcc-4.9
3946
CXX: g++-4.9
47+
4048
compile_script: |
4149
mkdir -p /opt/cmake-3.31.0
4250
wget https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.sh
4351
chmod +x cmake-3.31.0-linux-x86_64.sh
4452
./cmake-3.31.0-linux-x86_64.sh --skip-license --prefix=/opt/cmake-3.31.0
4553
export PATH=/opt/cmake-3.31.0/bin/:$PATH
54+
export PATH=/root/.cargo/bin:$PATH
4655
mkdir build && cd build
47-
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=0 -DHAVE_SSE4_1=1 -DREQUIRE_OPENMP=0 ..
56+
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=0 -DHAVE_SSE4_1=1 -DREQUIRE_OPENMP=0 -DRust_COMPILER=/root/.cargo/bin/rustc ..
4857
make -j $(nproc --all)
4958
test_script: |
5059
export PATH=/opt/cmake-3.31.0/bin/:$PATH
60+
export PATH=/root/.cargo/bin:$PATH
5161
MMSEQS_NUM_THREADS=4 ./util/regression/run_regression.sh ./build/src/mmseqs SCRATCH SEARCH
52-

.github/workflows/Dockerfile.GPU-buster-cross-sbsa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN mkdir -p /work/build && cd /work/build; \
1010
-DFORCE_STATIC_DEPS=1 -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" ..; \
1111
cmake --build . -j$(nproc --all) -v;
1212

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 \
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|libutil).so" | grep -q .; then \
1414
echo "Error: unwanted libraries found"; \
1515
readelf -a /work/build/src/mmseqs | grep -i "Shared library"; \
1616
exit 1; \

.github/workflows/Dockerfile.GPU-manylinux2014

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN mkdir -p /work/build && cd /work/build; \
1414
-DFORCE_STATIC_DEPS=1 -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" ..; \
1515
cmake --build . -j$(nproc --all) -v;
1616

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 \
17+
RUN if ldd /work/build/src/mmseqs | grep -P -v "linux-vdso.so|/lib64/(ld-linux-x86-64|libc|libm|libdl|librt|libpthread|libutil).so" | grep -q .; then \
1818
echo "Error: unwanted libraries found"; \
1919
ldd /work/build/src/mmseqs; \
2020
exit 1; \

src/alignment/Alignment.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,15 @@ void Alignment::run(const std::string &outDB, const std::string &outDBIndex, con
292292

293293
std::vector<Matcher::result_t> swResults;
294294
swResults.reserve(300);
295-
Matcher matcher(querySeqType, targetSeqType, maxMatcherSeqLen, m, &evaluer, compBiasCorrection, compBiasCorrectionScale, gapOpen, gapExtend, correlationScoreWeight, zdrop);
295+
Matcher matcher(querySeqType, maxMatcherSeqLen, m, &evaluer, compBiasCorrection, compBiasCorrectionScale, gapOpen, gapExtend, correlationScoreWeight, zdrop);
296296

297297
std::vector<Matcher::result_t> swRealignResults;
298298
Matcher *realigner = NULL;
299299
if (realign == true) {
300300
swRealignResults.reserve(300);
301301
realigner = &matcher;
302302
if (realign_m != NULL) {
303-
realigner = new Matcher(querySeqType, targetSeqType, maxMatcherSeqLen, realign_m, &evaluer, compBiasCorrection, compBiasCorrectionScale, gapOpen, gapExtend, 0.0, zdrop);
303+
realigner = new Matcher(querySeqType, maxMatcherSeqLen, realign_m, &evaluer, compBiasCorrection, compBiasCorrectionScale, gapOpen, gapExtend, 0.0, zdrop);
304304
}
305305
}
306306

src/alignment/Matcher.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
#include <fast_float/fast_float.h>
88

99

10-
Matcher::Matcher(int querySeqType, int targetSeqType, int maxSeqLen, BaseMatrix *m, EvalueComputation * evaluer,
10+
Matcher::Matcher(int querySeqType, int maxSeqLen, BaseMatrix *m, EvalueComputation * evaluer,
1111
bool aaBiasCorrection, float aaBiasCorrectionScale, int gapOpen, int gapExtend, float correlationScoreWeight, int zdrop)
12-
: gapOpen(gapOpen), gapExtend(gapExtend), correlationScoreWeight(correlationScoreWeight), m(m), evaluer(evaluer), tinySubMat(NULL) {
13-
setSubstitutionMatrix(m);
14-
12+
: gapOpen(gapOpen), gapExtend(gapExtend), correlationScoreWeight(correlationScoreWeight), m(m), evaluer(evaluer), tinySubMat(NULL) {
1513
if (Parameters::isEqualDbtype(querySeqType, Parameters::DBTYPE_NUCLEOTIDES)) {
1614
nuclaligner = new BandedNucleotideAligner(m, maxSeqLen, gapOpen, gapExtend, zdrop);
1715
aligner = NULL;
@@ -78,10 +76,10 @@ Matcher::result_t Matcher::getSWResult(Sequence* dbSeq, const int diagonal, bool
7876
alignmentMode = Matcher::SCORE_COV_SEQID;
7977
} else {
8078
if (isIdentity == false) {
81-
alignment = aligner->ssw_align(dbSeq->numSequence, dbSeq->numConsensusSequence,
82-
dbSeq->getAlignmentProfile(), dbSeq->L, backtrace,
79+
alignment = aligner->ssw_align(dbSeq->numSequence,
80+
dbSeq->L, backtrace,
8381
gapOpen, gapExtend, alignmentMode, evalThr, evaluer, covMode,
84-
covThr, correlationScoreWeight, maskLen, dbSeq->getId());
82+
covThr, correlationScoreWeight, maskLen);
8583
} else {
8684
alignment = aligner->scoreIdentical(dbSeq->numSequence, dbSeq->L, evaluer, alignmentMode, backtrace);
8785
}

src/alignment/Matcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class Matcher{
142142
}
143143
};
144144

145-
Matcher(int querySeqType, int targetSeqType, int maxSeqLen, BaseMatrix *m,
145+
Matcher(int querySeqType, int maxSeqLen, BaseMatrix *m,
146146
EvalueComputation * evaluer, bool aaBiasCorrection, float aaBiasCorrectionScale,
147147
int gapOpen, int gapExtend, float correlationScoreWeight,
148148
int zdrop);

src/alignment/StripedSmithWaterman.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ SmithWaterman::SmithWaterman(size_t maxSequenceLength, int aaSize, bool aaBiasCo
4242
this->aaBiasCorrectionScale = aaBiasCorrectionScale;
4343
this->aaBiasCorrection = aaBiasCorrection;
4444

45-
int segSize = (maxSequenceLength+7)/8;
46-
segSize = segSize;
45+
int segmentSize = (maxSequenceLength+7)/8;
46+
segSize = segmentSize;
4747
vHStore = (simd_int*) mem_align(ALIGN_INT, segSize * sizeof(simd_int));
4848
vHLoad = (simd_int*) mem_align(ALIGN_INT, segSize * sizeof(simd_int));
4949
vE = (simd_int*) mem_align(ALIGN_INT, segSize * sizeof(simd_int));
@@ -201,8 +201,6 @@ void SmithWaterman::reverseMat(int8_t *mat_rev, const int8_t *mat, const int32_t
201201

202202
s_align SmithWaterman::ssw_align (
203203
const unsigned char *db_num_sequence,
204-
const unsigned char *db_consens_sequence,
205-
const int8_t *db_mat,
206204
int32_t db_length,
207205
std::string & backtrace,
208206
const uint8_t gap_open,
@@ -211,14 +209,14 @@ s_align SmithWaterman::ssw_align (
211209
const double evalueThr,
212210
EvalueComputation * evaluer,
213211
const int covMode, const float covThr, const float correlationScoreWeight,
214-
const int32_t maskLen, const size_t id) {
212+
const int32_t maskLen) {
215213
s_align alignment;
216214
// check if both query and target are profiles
217215
if (profile->isProfile) {
218-
alignment = ssw_align_private<SmithWaterman::PROFILE_SEQ>(db_num_sequence, db_mat, db_length, backtrace, gap_open,
216+
alignment = ssw_align_private<SmithWaterman::PROFILE_SEQ>(db_num_sequence, db_length, backtrace, gap_open,
219217
gap_extend, alignmentMode, evalueThr, evaluer, covMode, covThr, correlationScoreWeight, maskLen);
220218
} else {
221-
alignment = ssw_align_private<SmithWaterman::SEQ_SEQ>(db_num_sequence, db_mat, db_length, backtrace, gap_open,
219+
alignment = ssw_align_private<SmithWaterman::SEQ_SEQ>(db_num_sequence, db_length, backtrace, gap_open,
222220
gap_extend, alignmentMode, evalueThr, evaluer, covMode, covThr, correlationScoreWeight, maskLen);
223221
}
224222
return alignment;
@@ -228,7 +226,6 @@ s_align SmithWaterman::ssw_align (
228226
template <unsigned int type>
229227
s_align SmithWaterman::ssw_align_private (
230228
const unsigned char *db_sequence,
231-
const int8_t *db_mat,
232229
int32_t db_length,
233230
std::string & backtrace,
234231
const uint8_t gap_open,
@@ -653,9 +650,9 @@ s_align SmithWaterman::alignStartPosBacktrace (
653650
}
654651

655652
template
656-
s_align SmithWaterman::ssw_align_private<SmithWaterman::SEQ_SEQ>(const unsigned char*, const int8_t*, int32_t, std::string&, const uint8_t, const uint8_t, const uint8_t, const double, EvalueComputation*, const int, const float, const float, const int32_t);
653+
s_align SmithWaterman::ssw_align_private<SmithWaterman::SEQ_SEQ>(const unsigned char*, int32_t, std::string&, const uint8_t, const uint8_t, const uint8_t, const double, EvalueComputation*, const int, const float, const float, const int32_t);
657654
template
658-
s_align SmithWaterman::ssw_align_private<SmithWaterman::PROFILE_SEQ>(const unsigned char*, const int8_t*, int32_t, std::string&, const uint8_t, const uint8_t, const uint8_t, const double, EvalueComputation*, const int, const float, const float, const int32_t);
655+
s_align SmithWaterman::ssw_align_private<SmithWaterman::PROFILE_SEQ>(const unsigned char*, int32_t, std::string&, const uint8_t, const uint8_t, const uint8_t, const double, EvalueComputation*, const int, const float, const float, const int32_t);
659656

660657
template
661658
s_align SmithWaterman::alignScoreEndPos<SmithWaterman::SEQ_SEQ>(const unsigned char*, int32_t, const uint8_t, const uint8_t, const int32_t);

src/alignment/StripedSmithWaterman.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ class SmithWaterman{
215215
s_align r);
216216

217217
s_align ssw_align (const unsigned char *db_num_sequence,
218-
const unsigned char *db_consens_sequence,
219-
const int8_t *db_profile,
220218
int32_t db_length,
221219
std::string &backtrace,
222220
const uint8_t gap_open,
@@ -225,7 +223,7 @@ class SmithWaterman{
225223
const double filters,
226224
EvalueComputation * filterd,
227225
const int covMode, const float covThr, const float correlationScoreWeight,
228-
const int32_t maskLen, const size_t id);
226+
const int32_t maskLen);
229227

230228

231229
/*! @function computed ungapped alignment score
@@ -308,6 +306,7 @@ class SmithWaterman{
308306

309307
// target variables
310308
simd_int* target_profile_byte;
309+
int segSize;
311310

312311
// needed for type checking query and target databases
313312
bool isQueryProfile;
@@ -327,7 +326,6 @@ class SmithWaterman{
327326

328327
template <unsigned int type>
329328
s_align ssw_align_private (const unsigned char*db_sequence,
330-
const int8_t *db_profile,
331329
int32_t db_length,
332330
std::string &backtrace,
333331
const uint8_t gap_open,

src/prefiltering/ungappedprefilter.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ void runFilterOnCpu(Parameters & par, BaseMatrix * subMat, int8_t * tinySubMat,
418418
} else {
419419
res = aligner.ssw_align(
420420
tSeq.numSequence,
421-
tSeq.numConsensusSequence,
422-
tSeq.getAlignmentProfile(),
423421
tSeq.L,
424422
backtrace,
425423
par.gapOpen.values.aminoacid(),
@@ -430,8 +428,7 @@ void runFilterOnCpu(Parameters & par, BaseMatrix * subMat, int8_t * tinySubMat,
430428
par.covMode,
431429
par.covThr,
432430
par.correlationScoreWeight,
433-
qSeq.L / 2,
434-
tId
431+
qSeq.L / 2
435432
);
436433
}
437434
score = res.score1;

src/test/TestAlignment.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int main (int, const char**) {
6767
Sequence* dbSeq = new Sequence(10000, 0, &subMat, kmer_size, true, false);
6868
//dbSeq->mapSequence(1,"lala2",ref_seq);
6969
dbSeq->mapSequence(1,1,tim2.c_str(), tim2.size());
70-
SmithWaterman aligner(15000, subMat.alphabetSize, true, 1.0, Parameters::DBTYPE_AMINO_ACIDS);
70+
SmithWaterman aligner(15000, subMat.alphabetSize, true, 1.0, &subMat);
7171
int8_t * tinySubMat = new int8_t[subMat.alphabetSize*subMat.alphabetSize];
7272
for (int i = 0; i < subMat.alphabetSize; i++) {
7373
for (int j = 0; j < subMat.alphabetSize; j++) {
@@ -92,8 +92,6 @@ int main (int, const char**) {
9292
std::string backtrace;
9393
s_align alignment = aligner.ssw_align(
9494
dbSeq->numSequence,
95-
dbSeq->numConsensusSequence,
96-
dbSeq->getAlignmentProfile(),
9795
dbSeq->L,
9896
backtrace,
9997
gap_open, gap_extend,
@@ -102,8 +100,7 @@ int main (int, const char**) {
102100
&evalueComputation,
103101
0, 0.0,
104102
0.0,
105-
maskLen,
106-
dbSeq->getId()
103+
maskLen
107104
);
108105
if(alignment.cigar){
109106
std::cout << "Cigar" << std::endl;

0 commit comments

Comments
 (0)