Skip to content

Commit

Permalink
Merge branch 'cmake-tweaks' into graviton2
Browse files Browse the repository at this point in the history
  • Loading branch information
accopeland committed Apr 4, 2022
2 parents 3ec4058 + a410d48 commit 0abdd48
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if (CMAKE_VERSION VERSION_LESS "3.1")
else ()
set(CMAKE_CXX_STANDARD 11)
endif ()
# target_compile_features(<proj> PUBLIC cxx_std_11)

option(COVERAGE "Generate coverage report" OFF)
option(STATIC_BUILD "Build static executation" OFF)
Expand Down Expand Up @@ -34,7 +35,7 @@ LIST(APPEND OTHER_SOURCE

if (STATIC_BUILD)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif (STATIC_BUILD)
endif ()

find_package(ZLIB REQUIRED)
find_package(OpenMP REQUIRED)
Expand All @@ -54,18 +55,19 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g -ggdb -O1 -D_LIBCPP_DEBUG -D_GLIBCXX_DEBUG")
if (COVERAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage")
set(COV_PY "coverage run")
endif (COVERAGE)
endif ()

if (SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined")
endif (SANITIZER)
endif ()

if (TSAN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
endif (TSAN)
endif ()


message(STATUS "Build type: ${CMAKE_BUILD_TYPE}: ${CMAKE_CXX_FLAGS}")
message(STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID}" )

add_executable(megahit_core ${OTHER_SOURCE} ${ASMBL_SOURCE} ${IDBA_SOURCE} ${SDBG_SOURCE} ${LCASM_SOURCE} ${SEQ_SOURCE}
${CX1_SOURCE} ${TOOLKIT_SOURCE})
Expand Down Expand Up @@ -102,7 +104,7 @@ if (STATIC_BUILD)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -static")
set_target_properties(megahit_core megahit_core_popcnt megahit_core_no_hw_accel PROPERTIES LINK_SEARCH_START_STATIC ON)
set_target_properties(megahit_core megahit_core_popcnt megahit_core_no_hw_accel PROPERTIES LINK_SEARCH_END_STATIC ON)
endif (STATIC_BUILD)
endif ()

target_link_libraries(megahit_core ${ZLIB_LIBRARIES})
target_link_libraries(megahit_core_popcnt ${ZLIB_LIBRARIES})
Expand Down
34 changes: 24 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y g++ make zlib1g-dev gzip bzip2 cmake python --no-install-recommends

COPY . /root/megahit
WORKDIR /root/megahit
RUN rm -rf build
RUN mkdir -p build
WORKDIR build
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
RUN make -j4
RUN make install
RUN megahit --test
RUN megahit --test --kmin-1pass

RUN apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
cmake \
gzip \
g++ \
libgomp1 \
make \
python \
zlib1g-dev && \
rm -rf build && \
mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 install && \
apt-get autoremove --purge -y \
cmake \
g++ \
make \
zlib1g-dev

RUN megahit --test && megahit --test --kmin-1pass
ENTRYPOINT ["megahit"]
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
trigger:
paths:
exclude:
- '*.md'
- Dockerfile
- .travis.yml

jobs:
- job: ubuntu_1604
pool:
Expand Down

0 comments on commit 0abdd48

Please sign in to comment.