Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
46 changes: 46 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.13)
project(CNEFinder
VERSION 0.1.0
LANGUAGES CXX)

set(CMAKE_VERBOSE_MAKEFILE ON)
include(GNUInstallDirs)
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
if(${CMAKE_INSTALL_PREFIX} MATCHES linuxbrew)
set(CMAKE_INSTALL_LIBDIR lib)
endif()

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
set(CMAKE_CXX_FLAGS_DEV "-O2 -g")
add_compile_options(-Wall -Wextra -pedantic)

set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)

set(Boost_NO_BOOST_CMAKE ON)
find_package(Boost REQUIRED)
message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")

find_package(OpenMP REQUIRED)
message(STATUS "OpenMP_FOUND: ${OpenMP_FOUND}")
message(STATUS "OpenMP_CXX_FLAGS: ${OpenMP_CXX_FLAGS}")

add_executable(cnef cnef.cc)
target_compile_features(cnef PUBLIC cxx_std_11)
install(TARGETS cnef
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

add_library(objlib OBJECT
extend.cc
utils.cc
qgrams.cc
overlaps.cc
edlib.cc
)
target_link_libraries(objlib PUBLIC OpenMP::OpenMP_CXX Boost::headers)
target_link_libraries(cnef PRIVATE objlib)
20 changes: 20 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,23 @@ After compilation the binary `cnef' will be created in the working
directory, e.g. you may call it from this directory via

S ./cnef


Installation with CMake
=======================

CMake will automatically find the pre-installed softwares in your system:
C++ compiler with C++11 support, OpenMP, and Boost.
They can be installed easily with Homebrew:

brew install cmake libomp boost

Then, you can install the latest version to an arbitrary `DESTINATION`:

git clone https://github.com/lorrainea/CNEFinder.git
cd CNEFinder/
mkdir build
cd build/
DESTINATION=${HOME}/local
cmake -DCMAKE_INSTALL_PREFIX=${DESTINATION} ..
make -j4 install