diff --git a/biology/kallisto/Makefile b/biology/kallisto/Makefile index ea7cb1a53596..4ae2b8bd94ec 100644 --- a/biology/kallisto/Makefile +++ b/biology/kallisto/Makefile @@ -1,48 +1,50 @@ PORTNAME= kallisto DISTVERSIONPREFIX= v DISTVERSION= 0.50.0 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= biology MAINTAINER= jwb@FreeBSD.org COMMENT= Quantify abundances of transcripts from RNA-Seq data WWW= https://pachterlab.github.io/kallisto/about.html LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/license.txt -# Requires a 64-bit processor ONLY_FOR_ARCHS= aarch64 amd64 powerpc64 powerpc64le riscv64 +ONLY_FOR_ARCHS_REASON= Requires a 64-bit processor LIB_DEPENDS= libhdf5.so:science/hdf5 \ libsz.so:science/libaec \ libhts.so:biology/htslib USES= cmake:noninja compiler:c++11-lang gmake localbase:ldflags USE_GITHUB= yes GH_ACCOUNT= pachterlab SUB_FILES= kallisto-test PORTEXAMPLES= * PLIST_FILES= bin/kallisto EXAMPLES_PLIST_FILES= bin/kallisto-test # hdf5 is being phased out and is no longer built in by default, but is still # required for Sleuth (requires kallisto bootstrap estimates) and other # downstream tools. Remove this after Sleuth et al catch up. -CMAKE_ARGS+= -DUSE_HDF5:BOOL=ON +CMAKE_ARGS+= -DUSE_HDF5:BOOL=ON -DUSE_BAM:BOOL=ON +# WIP: Remove before committing +CMAKE_ARGS+= -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON MAKE_JOBS_UNSAFE= yes LDFLAGS+= -lhts -lz OPTIONS_DEFINE= EXAMPLES post-extract: ${RM} -rf ${WRKSRC}/ext/htslib post-install-EXAMPLES-on: ${INSTALL_SCRIPT} ${WRKDIR}/kallisto-test ${STAGEDIR}${PREFIX}/bin cd ${WRKSRC}/test && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} .include diff --git a/biology/kallisto/files/patch-CMakeLists.txt b/biology/kallisto/files/patch-CMakeLists.txt index 7c6d4c95b51e..0eff9653f86c 100644 --- a/biology/kallisto/files/patch-CMakeLists.txt +++ b/biology/kallisto/files/patch-CMakeLists.txt @@ -1,46 +1,71 @@ --- CMakeLists.txt.orig 2023-06-27 10:45:00 UTC +++ CMakeLists.txt -@@ -56,42 +56,16 @@ ENDIF(LINK MATCHES static) +@@ -33,10 +33,11 @@ if(${CMAKE_VERSION} VERSION_LESS 3.1) + # remove this block once CMake >=3.1 has fixated in the ecosystem + add_compile_options(-std=c++11) + else() ++ # Use c++11 to silence warnings + include(CheckCXXCompilerFlag) +- check_cxx_compiler_flag(-std=c++17 COMPILER_SUPPORTS_CXX17) ++ check_cxx_compiler_flag(-std=c++11 COMPILER_SUPPORTS_CXX17) + if(COMPILER_SUPPORTS_CXX17) +- set(CMAKE_CXX_STANDARD 17) ++ set(CMAKE_CXX_STANDARD 11) + else() + set(CMAKE_CXX_STANDARD 11) + endif() +@@ -44,9 +45,7 @@ else() + set(CMAKE_CXX_EXTENSIONS OFF) + endif() + +-#add_compile_options(-Wall -Wno-unused-function) +-add_compile_options(-Wno-subobject-linkage) # Suppress bifrost warning +-set(PROJECT_BIFROST_CMAKE_CXX_FLAGS "-Wno-subobject-linkage -Wno-return-type") # Suppress bifrost warning ++set(PROJECT_BIFROST_CMAKE_CXX_FLAGS "-Wno-return-type") # Suppress bifrost warning + + if(LINK MATCHES static) + message("static build") +@@ -56,42 +55,16 @@ ENDIF(LINK MATCHES static) include(ExternalProject) -if (USE_BAM) -ExternalProject_Add(htslib - PREFIX ${PROJECT_SOURCE_DIR}/ext/htslib - SOURCE_DIR ${PROJECT_SOURCE_DIR}/ext/htslib - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND autoreconf -i && autoheader && autoconf && ${PROJECT_SOURCE_DIR}/ext/htslib/configure - --prefix=${PREFIX} --disable-bz2 --disable-lzma --disable-libcurl - BUILD_COMMAND make lib-static - INSTALL_COMMAND "" -) -endif(USE_BAM) ExternalProject_Add(bifrost PREFIX ${PROJECT_SOURCE_DIR}/ext/bifrost SOURCE_DIR ${PROJECT_SOURCE_DIR}/ext/bifrost BUILD_IN_SOURCE 1 CONFIGURE_COMMAND mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_CXX_FLAGS=${PROJECT_BIFROST_CMAKE_CXX_FLAGS} - BUILD_COMMAND cd build && make + BUILD_COMMAND cd build && gmake INSTALL_COMMAND "" ) -if (ZLIBNG) - message("zlib-ng enabled.") - ExternalProject_Add(zlib-ng - PREFIX ${PROJECT_SOURCE_DIR}/ext/zlib-ng - SOURCE_DIR ${PROJECT_SOURCE_DIR}/ext/zlib-ng - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND mkdir -p zlib-ng && cd zlib-ng && cmake .. -DZLIB_COMPAT=ON -DZLIB_ENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=${PREFIX} - BUILD_COMMAND cd zlib-ng && make - INSTALL_COMMAND "" - ) -endif(ZLIBNG) - -if (USE_BAM) -include_directories(${htslib_PREFIX}/src/htslib) -endif(USE_BAM) include_directories(${EXT_PROJECTS_DIR}/bifrost/build/src) ExternalProject_Get_Property(bifrost install_dir) diff --git a/biology/kallisto/files/patch-ext_bifrost_CMakeLists.txt b/biology/kallisto/files/patch-ext_bifrost_CMakeLists.txt index c4c22a5e0666..d25cf028cfdd 100644 --- a/biology/kallisto/files/patch-ext_bifrost_CMakeLists.txt +++ b/biology/kallisto/files/patch-ext_bifrost_CMakeLists.txt @@ -1,11 +1,40 @@ ---- ext/bifrost/CMakeLists.txt.orig 2023-07-14 14:27:24 UTC +--- ext/bifrost/CMakeLists.txt.orig 2023-06-27 10:45:00 UTC +++ ext/bifrost/CMakeLists.txt -@@ -30,8 +30,6 @@ if(COMPILATION_ARCH MATCHES "OFF") +@@ -7,18 +7,12 @@ find_package(Threads REQUIRED) + # To enable a larger default k-mer size, replace MAX_KMER_SIZE with a larger multiple of 32: actual maximum k-mer size will be MAX_KMER_SIZE-1. + SET(MAX_KMER_SIZE "32" CACHE STRING "MAX_KMER_SIZE") + SET(MAX_GMER_SIZE "${MAX_KMER_SIZE}" CACHE STRING "MAX_GMER_SIZE") +-# Enable architecture optimizations +-SET(COMPILATION_ARCH "native" CACHE STRING "COMPILATION_ARCH") +-# Enable AVX2 instructions +-SET(ENABLE_AVX2 "ON" CACHE STRING "ENABLE_AVX2") ++SET(CMAKE_VERBOSE_MAKEFILE "ON") + + # Set some default compile flags + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + +-set_property(SOURCE BlockedBloomFilter.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " -funroll-loops") +- +- + #check if we are on arm64 and apple, if so, disable AVX2 + if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + message("Disabling AVX2 instructions on arm64") +@@ -30,8 +24,6 @@ if(COMPILATION_ARCH MATCHES "OFF") message("Disabling native architecture compilation (including AVX2)") else(COMPILATION_ARCH MATCHES "OFF") message("Compilation architecture: ${COMPILATION_ARCH}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${COMPILATION_ARCH}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${COMPILATION_ARCH}") endif(COMPILATION_ARCH MATCHES "OFF") if(ENABLE_AVX2 MATCHES "OFF") +@@ -56,7 +48,7 @@ else(CMAKE_BUILD_TYPE MATCHES Debug) + set(CMAKE_EXE_LINKER_FLAGS "-pg") + else(CMAKE_BUILD_TYPE MATCHES Profile) + message("Build type: Release") +- add_compile_options(-O3) ++ add_compile_options(-O2) + endif(CMAKE_BUILD_TYPE MATCHES Profile) + endif(CMAKE_BUILD_TYPE MATCHES Debug) + diff --git a/biology/kallisto/files/patch-src_CMakeLists.txt b/biology/kallisto/files/patch-src_CMakeLists.txt index c7927b9e1478..87cd4b49b02d 100644 --- a/biology/kallisto/files/patch-src_CMakeLists.txt +++ b/biology/kallisto/files/patch-src_CMakeLists.txt @@ -1,22 +1,24 @@ ---- src/CMakeLists.txt.orig 2023-07-06 14:07:38 UTC +--- src/CMakeLists.txt.orig 2023-06-27 10:45:00 UTC +++ src/CMakeLists.txt -@@ -3,10 +3,6 @@ file(GLOB headers *.h *.hpp) +@@ -3,12 +3,6 @@ file(GLOB headers *.h *.hpp) list(REMOVE_ITEM sources main.cpp) -if (USE_BAM) -include_directories(../ext/htslib) -endif(USE_BAM) - - add_compile_options(-Wno-subobject-linkage) # Suppress bifrost warning - +-add_compile_options(-Wno-subobject-linkage) # Suppress bifrost warning +- add_library(kallisto_core ${sources} ${headers}) -@@ -17,7 +13,7 @@ add_executable(kallisto main.cpp) + target_include_directories(kallisto_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +@@ -17,7 +11,7 @@ add_executable(kallisto main.cpp) find_package( Threads REQUIRED ) ExternalProject_Get_Property(bifrost install_dir) if (USE_BAM) -target_link_libraries(kallisto kallisto_core pthread ${CMAKE_CURRENT_SOURCE_DIR}/../ext/htslib/libhts.a ${install_dir}/build/src/libbifrost.a) +target_link_libraries(kallisto kallisto_core pthread hts ${install_dir}/build/src/libbifrost.a) else() target_link_libraries(kallisto kallisto_core pthread ${install_dir}/build/src/libbifrost.a) endif(USE_BAM)