Skip to content
Permalink
Browse files

compile macOS build with AppleClang

  • Loading branch information...
milot-mirdita committed Oct 30, 2019
1 parent 34eefde commit 49a7568e693f5cb92cd7fb0019365effeb123eb4
Showing with 14 additions and 9 deletions.
  1. +2 −2 azure-pipelines.yml
  2. +7 −2 src/CMakeLists.txt
  3. +5 −5 util/build_osx.sh
@@ -35,11 +35,11 @@ jobs:
- checkout: self
submodules: true
- script: |
brew install cmake gcc@9 zlib bzip2 coreutils
brew install cmake zlib bzip2 libomp
displayName: Install Dependencies
- script: |
cd ${BUILD_SOURCESDIRECTORY}
CC=gcc-9 CXX=g++-9 ./util/build_osx.sh . build
./util/build_osx.sh . build
displayName: Build MMseqs2
- script: |
${BUILD_SOURCESDIRECTORY}/util/regression/run_regression.sh ${BUILD_SOURCESDIRECTORY}/build/build_sse41/src/mmseqs ${BUILD_SOURCESDIRECTORY}/regression
@@ -120,8 +120,13 @@ endif ()
# SIMD instruction sets support
if (HAVE_AVX2)
target_compile_definitions(mmseqs-framework PUBLIC -DAVX2=1)
append_target_property(mmseqs-framework COMPILE_FLAGS -mavx2 -Wa,-q)
append_target_property(mmseqs-framework LINK_FLAGS -mavx2 -Wa,-q)
if (CMAKE_COMPILER_IS_CLANG)
append_target_property(mmseqs-framework COMPILE_FLAGS -mavx2)
append_target_property(mmseqs-framework LINK_FLAGS -mavx2)
else ()
append_target_property(mmseqs-framework COMPILE_FLAGS -mavx2 -Wa,-q)
append_target_property(mmseqs-framework LINK_FLAGS -mavx2 -Wa,-q)
endif ()
elseif (HAVE_SSE4_1)
target_compile_definitions(mmseqs-framework PUBLIC -DSSE=1)
append_target_property(mmseqs-framework COMPILE_FLAGS -msse4.1)
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/sh -e
REPO="$(greadlink -f $1)"
BUILD="$(greadlink -f $2)"
BINARY_NAME="${3:-mmseqs}"
@@ -9,19 +9,19 @@ if [ ! -d "$REPO" ]; then
fi

mkdir -p "$BUILD/build_sse41" && cd "$BUILD/build_sse41"
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=0 -DHAVE_MPI=0 -DHAVE_SSE4_1=1 -DBUILD_SHARED_LIBS=OFF -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" "$REPO"
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=0 -DHAVE_MPI=0 -DHAVE_SSE4_1=1 -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" -DOpenMP_C_LIB_NAMES=omp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" -DOpenMP_CXX_LIB_NAMES=omp -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.a "$REPO"
make -j 4

if [ "$(echo $(otool -L "src/${BINARY_NAME}" | wc -l))" != 4 ]; then
if [ "$(echo $(otool -L "src/${BINARY_NAME}" | wc -l))" != 5 ]; then
echo "Too many linked libraries found in ${BINARY_NAME} binary. Build is not static!"
exit 1
fi

cd "$BUILD" && mkdir -p "build_avx2" && cd "build_avx2"
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=0 -DHAVE_MPI=0 -DHAVE_AVX2=1 -DBUILD_SHARED_LIBS=OFF -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" "$REPO"
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=0 -DHAVE_MPI=0 -DHAVE_AVX2=1 -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" -DOpenMP_C_LIB_NAMES=omp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" -DOpenMP_CXX_LIB_NAMES=omp -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.a "$REPO"
make -j 4

if [ "$(echo $(otool -L "src/${BINARY_NAME}" | wc -l))" != 4 ]; then
if [ "$(echo $(otool -L "src/${BINARY_NAME}" | wc -l))" != 5 ]; then
echo "Too many linked libraries found in ${BINARY_NAME} binary. Build i not static!"
exit 1
fi

0 comments on commit 49a7568

Please sign in to comment.
You can’t perform that action at this time.