Skip to content

Commit c1eb2c0

Browse files
authored
Refactor function names and update build (#118)
* Update data dir location,refactor main function name,remove autoconf and update INSTALL.txt. * Also remove code coverage upload from workflow due to errors.
1 parent c7fa42b commit c1eb2c0

49 files changed

Lines changed: 45 additions & 44 deletions

Some content is hidden

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

.github/workflows/main.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ env:
1717

1818
jobs:
1919
Build-Test:
20+
permissions: write-all
2021
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
2122
runs-on: ubuntu-latest
2223

@@ -65,13 +66,13 @@ jobs:
6566
working-directory: ${{github.workspace}}/build
6667
run: make lcov2
6768
# Reporting code coverage
68-
- name: Report code coverage
69-
uses: zgosalvez/github-actions-report-lcov@v2
70-
with:
71-
working-directory: ${{github.workspace}}/build
72-
coverage-files: ${{github.workspace}}/build/coverage.info
73-
artifact-name: code-coverage-report
74-
github-token: ${{ secrets.GITHUB_TOKEN }}
69+
#- name: Report code coverage
70+
# uses: zgosalvez/github-actions-report-lcov@v3
71+
# with:
72+
# working-directory: ${{github.workspace}}/build
73+
# coverage-files: ${{github.workspace}}/build/coverage.info
74+
# artifact-name: code-coverage-report
75+
# github-token: ${{ secrets.GITHUB_TOKEN }}
7576
# Uploading to Codecov
7677
- name: Upload coverage reports to codecov.io
7778
uses: codecov/codecov-action@v3

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ add_executable(FastANI src/cgi/core_genome_identity.cpp src/cgi/main.cpp)
99
target_include_directories(FastANI PUBLIC "src/")
1010
#
1111
# by default, static linking
12-
option(GSL_SHARED "Build using shared libraries" OFF)
12+
option(GSL_SHARED "Build using shared libraries" ON)
1313
option(BUILD_TESTING "Build tests" ON) # build tests
1414
#
1515
# zlib dependency
@@ -70,7 +70,7 @@ if(${BUILD_TESTING})
7070
${OpenMP_CXX_LIBRARIES}
7171
gcov)
7272
catch_discover_tests(FastANITest)
73-
file(COPY data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
73+
file(COPY tests/data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
7474
add_custom_target(lcov lcov -c -d .. -o FastANITest.out
7575
COMMAND genhtml -o ../lcov/ FastANITest.out
7676
DEPENDS FastANITest)
@@ -81,6 +81,8 @@ if(${BUILD_TESTING})
8181
DEPENDS FastANITest)
8282
endif(${BUILD_TESTING})
8383

84+
install(TARGETS FastANI DESTINATION bin)
85+
8486
set(CPACK_GENERATOR "TGZ")
8587
set(CPACK_SOURCE_GENERATOR "TGZ")
8688
set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package)

INSTALL.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ which is available in GCC >= 4.8 (on linux) and Clang >= 3.3 (on mac)
33

44
Dependencies:
55
-------------
6-
- Autoconf ( http://www.gnu.org/software/autoconf/ )
6+
- CMake 3.2 or above ( https://cmake.org/ )
77
- either...
88
GNU Scientific Library ( http://www.gnu.org/software/gsl/ )
99
or..
10-
Boost Library ( http://www.boost.org ) (see "-with-boost" below)
10+
Boost Library ( http://www.boost.org ) (see "-DBOOST_ROOT" below)
1111
- Zlib ( included with OS X and most Linuxes, http://www.zlib.net ) *
1212
- C++ compiler with C++11 and openmp support
1313
Note for macOS users: Use "libomp" to link openmp with Clang
@@ -16,34 +16,32 @@ Dependencies:
1616

1717
Steps:
1818
------
19-
./bootstrap.sh
20-
./configure [--prefix=...] [--with-gsl=...] [--with-boost=...]
21-
make
19+
mkdir build
20+
cd build
21+
cmake .. -DCMAKE_BUILD_TYPE=Release [--install-prefix ... -DGSL_SHARED=... -DGSL_ROOT_DIR=... -DBOOST_ROOT=...]
22+
cmake --build .
2223

2324

2425
Products:
2526
---------
26-
- Executable fastANI
27+
- Executable fastANI built in the build directory
2728

2829

29-
30-
Configure options:
31-
------------------
32-
--prefix=</path/to/install>
30+
cmake configure options:
31+
-----------------------------
32+
--install-prefix </path/to/install>
3333
Installs binaries to bin/ and libraries to lib/ within this path. The default
3434
is /usr/local/, which will typically require sudo for make install. Must be
3535
absolute path.
36-
--with-gsl=</path/to/gsl/>
36+
lib/.
37+
-DGSL_ROOT_DIR=</path/to/gsl_dir>
3738
Where to find the GNU Scientific library install if not in the default
3839
location (/usr/local). Must be absolute path and should not include bin/ or
39-
lib/.
40-
--enable-static-gsl
40+
-DGSL_SHARED=OFF
4141
Statically link the GNU Scientific library instead of dynamically. Be mindful
4242
of licensure if distributing.
43-
--with-boost=</path/to/boost/>
43+
-DBOOST_ROOT=</path/to/boost/>
4444
Use Boost from this location, instead of GSL. Must be absolute path and should
4545
not include bin/ or lib/. Will be statically linked. Be mindful of licensure
4646
if distributing.
4747

48-
* If Zlib is not installed in a standard system location (it usually is),
49-
CXXFLAGS and LDFLAGS will have to be modified before making.

src/cgi/core_genome_identity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inline bool file_exists (const std::string& name) {
2424
return f.good();
2525
}
2626

27-
int cgi_main(int argc, char **argv)
27+
int core_genome_identity(int argc, char **argv)
2828
{
2929
/*
3030
* Make sure env variable MALLOC_ARENA_MAX is unset

src/cgi/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Created by srirampc on 11/30/22.
33
//
44

5-
int cgi_main(int argc, char **argv);
5+
int core_genome_identity(int argc, char **argv);
66

77
int main(int argc, char** argv) {
8-
return cgi_main(argc, argv);
8+
return core_genome_identity(argc, argv);
99
}

0 commit comments

Comments
 (0)