Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
9f008da
Update build.sh
karasikov Sep 29, 2025
f5dd754
enable osx
karasikov Sep 29, 2025
ce328da
Update meta.yaml
mencian Sep 30, 2025
c6b302c
Update 0001-boost-cmake.patch
mencian Sep 30, 2025
12dc8af
Delete recipes/metagraph/0001-boost-cmake.patch
mencian Sep 30, 2025
a291b25
Update build.sh
mencian Sep 30, 2025
c545689
add icu for osx
mencian Sep 30, 2025
62d844b
Update build.sh
mencian Sep 30, 2025
69efa5a
Update meta.yaml
mencian Sep 30, 2025
5f067b8
Update build.sh
mencian Sep 30, 2025
f6eee1b
Update build.sh
mencian Sep 30, 2025
3676287
Update meta.yaml
mencian Sep 30, 2025
fa8b46d
Update meta.yaml
karasikov Oct 1, 2025
eb97070
Update meta.yaml
karasikov Oct 1, 2025
5a7ae2f
Update meta.yaml
karasikov Oct 1, 2025
e695a7a
Update build.sh
karasikov Oct 1, 2025
23c8e46
removed htslib cp command
karasikov Oct 14, 2025
165f91b
Update meta.yaml
karasikov Oct 14, 2025
b4b00fd
Merge branch 'master' into patch-2
karasikov Oct 14, 2025
9444345
download from tar and check sha256sum
karasikov Oct 14, 2025
7ab8b6a
download from releases
karasikov Oct 14, 2025
7f3fec4
remove htslib patch lines
karasikov Oct 14, 2025
83498df
Update build.sh
karasikov Oct 14, 2025
9f4d633
Update meta.yaml
karasikov Oct 14, 2025
7e94d22
create version.h
karasikov Oct 14, 2025
736c8da
removed jemalloc dirs
karasikov Oct 14, 2025
92bc04c
removed jemalloc
karasikov Oct 14, 2025
2ac6f1d
cleanup
karasikov Oct 14, 2025
6c1cce7
Merge branch 'pr-59714' into patch-2
karasikov Oct 14, 2025
2f8f75f
Update metagraph dependencies and build configuration
karasikov Oct 14, 2025
5fd13b7
removed -Wno-invalid-specialization from clang
karasikov Oct 14, 2025
cfda535
don't wait for linux CI to finish
karasikov Oct 14, 2025
4cec677
added -Wno-invalid-specialization
karasikov Oct 14, 2025
3f84318
install jemalloc
karasikov Oct 14, 2025
8ae6200
revert
karasikov Oct 14, 2025
e29dbd9
link against jemalloc on Darwin
karasikov Oct 14, 2025
39e561e
minor
karasikov Oct 14, 2025
55ea348
without jemalloc on macos
karasikov Oct 14, 2025
cdc4fe8
cleanup
karasikov Oct 14, 2025
d6b3bbe
added -Wno-attributes
karasikov Oct 15, 2025
289bc50
added jemalloc patch
karasikov Oct 15, 2025
9496379
moved
karasikov Oct 15, 2025
d6d7df0
libgomp also for macos
karasikov Oct 15, 2025
4e4fca6
try libomp
karasikov Oct 15, 2025
958d575
try llvm-openmp
karasikov Oct 15, 2025
c27f6dc
try
karasikov Oct 15, 2025
e439ed7
try
karasikov Oct 15, 2025
24e02ce
added OSX_SYSROOT
karasikov Oct 15, 2025
e576f18
added OMP_ROOT
karasikov Oct 15, 2025
8a0cb00
try
karasikov Oct 15, 2025
d39361e
Temporarily disable Linux Tests to focus on macOS build issues
karasikov Oct 15, 2025
32c37ed
Remove temporary files
karasikov Oct 15, 2025
62dc4ce
test
karasikov Oct 15, 2025
f81dff3
/lib
karasikov Oct 15, 2025
e67499c
try
karasikov Oct 15, 2025
2ce9760
cleanup
karasikov Oct 15, 2025
ba5959b
cleanup
karasikov Oct 15, 2025
4ca2c06
also compile for linux
karasikov Oct 15, 2025
beb8a98
try with jemalloc
karasikov Oct 15, 2025
0a168cf
patch with jemalloc
karasikov Oct 16, 2025
b4c1c85
osx without jemalloc
karasikov Oct 16, 2025
d1da8cc
revert minor changes, also added adamant-pwn
karasikov Oct 16, 2025
ca33d92
update
karasikov Oct 16, 2025
2975de5
Merge branch 'master' into patch-2
karasikov Oct 20, 2025
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
39 changes: 0 additions & 39 deletions recipes/metagraph/0001-boost-cmake.patch

This file was deleted.

13 changes: 0 additions & 13 deletions recipes/metagraph/arm_hwcap.patch

This file was deleted.

73 changes: 7 additions & 66 deletions recipes/metagraph/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,15 @@

export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include"
export CXXFLAGS="${CXXFLAGS} -O3 -Wno-deprecated-declarations"
export CFLAGS="${CFLAGS} -O3 -Wno-unused-but-set-variable"
export JEMALLOC_LIBRARY="${PREFIX}/lib"
export JEMALLOC_INCLUDE_DIR="${PREFIX}/include"
export BOOST_INCLUDEDIR="${PREFIX}/include"
export BOOST_LIBRARYDIR="${PREFIX}/lib"

sed -i.bak 's|VERSION 2.8.2|VERSION 3.5|' metagraph/CMakeLists.txt.in
sed -i.bak 's|VERSION 2.8.12|VERSION 3.5|' metagraph/CMakeListsKMC.txt.in
sed -i.bak 's|VERSION 2.8.11|VERSION 3.5|' metagraph/external-libraries/sdsl-lite/CMakeLists.txt
sed -i.bak 's|VERSION 2.4.4|VERSION 3.5|' metagraph/external-libraries/sdsl-lite/external/libdivsufsort/CMakeLists.txt
sed -i.bak 's|VERSION 2.6.4|VERSION 3.5|' metagraph/external-libraries/sdsl-lite/external/googletest/CMakeLists.txt
sed -i.bak 's|VERSION 2.6.4|VERSION 3.5|' metagraph/external-libraries/sdsl-lite/external/googletest/googletest/CMakeLists.txt
sed -i.bak 's|VERSION 2.6.4|VERSION 3.5|' metagraph/external-libraries/sdsl-lite/external/googletest/googlemock/CMakeLists.txt
sed -i.bak 's|VERSION 2.6|VERSION 3.5|' metagraph/external-libraries/DYNAMIC/CMakeLists.txt
sed -i.bak 's|VERSION 2.8.12|VERSION 3.5|' metagraph/external-libraries/zlib/CMakeLists.txt
sed -i.bak 's|VERSION 3.1.3|VERSION 3.5|' metagraph/external-libraries/caches/CMakeLists.txt
sed -i.bak 's|VERSION 2.8.11|VERSION 3.5|' metagraph/external-libraries/eigen/CMakeLists.txt
sed -i.bak 's|VERSION 3.0.2|VERSION 3.5|' metagraph/external-libraries/folly/CMakeLists.txt
sed -i.bak 's|VERSION 3.1|VERSION 3.5|' metagraph/external-libraries/hopscotch-map/CMakeLists.txt
sed -i.bak 's|VERSION 3.1|VERSION 3.5|' metagraph/external-libraries/ordered-map/CMakeLists.txt
export CXXFLAGS="${CXXFLAGS} -Wno-deprecated-declarations -Wno-attributes"

ARCH=$(uname -m)
OS=$(uname -s)

if [[ "${ARCH}" == "arm64" || "${ARCH}" == "aarch64" ]]; then
sed -i.bak 's|"-mavx"|""|' metagraph/CMakeListsKMC.txt.in
sed -i.bak 's|-mavx2||' metagraph/CMakeListsKMC.txt.in
sed -i.bak 's|-mfma||' metagraph/CMakeListsKMC.txt.in
sed -i.bak 's|"-msse2"|""|' metagraph/CMakeListsKMC.txt.in
sed -i.bak 's|"-msse4.1"|""|' metagraph/CMakeListsKMC.txt.in
sed -i.bak 's|-m64||' metagraph/CMakeListsKMC.txt.in
sed -i.bak 's|g++|${CXX}|' metagraph/external-libraries/KMC/makefile
sed -i.bak 's|-m64||' metagraph/external-libraries/KMC/makefile
rm -rf metagraph/external-libraries/KMC/*.bak
sed -i.bak 's|-mcx16||' metagraph/CMakeLists.txt
rm -rf metagraph/*.bak
fi

if [[ "${OS}" == "Linux" ]]; then
CMAKE_PLATFORM_FLAGS=""
export CXXFLAGS="${CXXFLAGS} -Wno-attributes -Wno-narrowing -Wno-type-limits"
export CONFIG_ARGS=""
elif [[ "${OS}" == "Darwin" ]]; then
sed -i.bak 's|/usr/local/gcc-6.3.0/bin/g++|${CXX}|' metagraph/external-libraries/KMC/makefile_mac
sed -i.bak 's|-m64||' metagraph/external-libraries/KMC/makefile_mac
rm -rf metagraph/external-libraries/KMC/*.bak
CMAKE_PLATFORM_FLAGS="-DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT}"
export CXXFLAGS="${CXXFLAGS} -Wno-implicit-function-declaration -Wno-suggest-destructor-override -Wno-error=deprecated-copy -D_LIBCPP_DISABLE_AVAILABILITY"
export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER"
fi

sed -i.bak 's|-O2|-O3|' metagraph/CMakeLists.txt
sed -i.bak 's|-lpthread|-pthread|' metagraph/CMakeLists.txt
sed -i.bak 's|-std=c++11|-std=c++14|' metagraph/CMakeListsKMC.txt.in
rm -rf metagraph/*.bak
sed -i.bak 's|-std=c++11|-std=c++14|' metagraph/external-libraries/sdsl-lite/CMakeLists.txt
rm -rf metagraph/external-libraries/sdsl-lite/*.bak
# set version manually since we're installing from source and not from a checked out git repo
echo '#define HTSCODECS_VERSION_TEXT "1.6.4"' > metagraph/external-libraries/htslib/htscodecs/htscodecs/version.h

sed -i.bak 's|Boost_USE_STATIC_LIBS ON|Boost_USE_STATIC_LIBS OFF|' metagraph/CMakeLists.txt

pushd metagraph/external-libraries/sdsl-lite
./install.sh "${PWD}"
Expand All @@ -74,21 +25,11 @@ export PIP_NO_INDEX=False

CMAKE_PARAMS="-DCMAKE_BUILD_TYPE=Release \
-DBOOST_ROOT=${PREFIX} \
-DJEMALLOC_ROOT=${PREFIX} \
-DOMP_ROOT=${PREFIX} \
-DCMAKE_PREFIX_PATH=${PREFIX} \
-DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=1 \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_KMC=OFF \
-DWITH_AVX=OFF -Wno-dev -Wno-deprecated --no-warn-unused-cli \
${CMAKE_PLATFORM_FLAGS} ${CONFIG_ARGS}"

if [[ "${ARCH}" == "arm64" || "${ARCH}" == "aarch64" ]]; then
CMAKE_PARAMS="${CMAKE_PARAMS} -DWITH_MSSE42=OFF"
fi
-DBUILD_KMC=OFF \
"

cmake -S .. -B . ${CMAKE_PARAMS}

Expand Down
44 changes: 21 additions & 23 deletions recipes/metagraph/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
{% set name = "metagraph" %}
{% set version = "0.4.3" %}
{% set version = "0.4.5" %}

package:
name: {{ name|lower }}
name: {{ name }}
version: {{ version }}

source:
git_url: https://github.com/ratschlab/metagraph.git
git_tag: v{{ version }}
sha256: unused
url: https://github.com/ratschlab/metagraph/releases/download/v{{ version }}/v{{ version }}-sources-with-submodules.tar.gz
sha256: d377f16329d3725e580d3e57ea46a2b501855cd50fdac511d93d1b0bc8413189
patches:
- 0001-boost-cmake.patch
- arm_hwcap.patch
- metagraph-jemalloc-conditional.patch

build:
number: 0
skip: True # [osx]
skip: True # [win]
run_exports:
- {{ pin_subpackage('metagraph', max_pin="x.x") }}
- {{ pin_subpackage(name, max_pin="x.x") }}

requirements:
build:
Expand All @@ -28,22 +26,22 @@ requirements:
- automake
- libtool
- pkg-config
host:
- python >=3
- setuptools
- libdeflate
- icu # [osx,osx-arm64]
- zstd
- bzip2
- htslib
- jemalloc
- boost-cpp ==1.71.0
- llvm-openmp # [osx]
host:
- jemalloc # [linux]
- boost-cpp
- libgomp # [linux]
- clangdev # [osx]
- llvmlite # [osx]
- doxygen
- llvm-openmp # [osx,osx-arm64]
run:
- htslib
- jemalloc
- boost-cpp ==1.71.0
- llvm-openmp # [osx]
- jemalloc # [linux]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this Linux only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were issues with compiling with jemalloc.
It couldn't find the jemalloc headers. When I compile locally on my MacOS, everything works. So it's a bit difficult to troubleshoot this, as this appears to be specific to the online setup and paths where it installs packages.

23:55:57 �[32mBIOCONDA INFO�[0m (ERR) /opt/mambaforge/envs/bioconda/conda-bld/metagraph_1760572361042/work/metagraph/external-libraries/folly/folly/memory/Malloc.h:103:53: error: use of undeclared identifier 'xallocx'�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR)   103 |     if (mallocx == nullptr || rallocx == nullptr || xallocx == nullptr ||�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR)       |                                                     ^�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR) /opt/mambaforge/envs/bioconda/conda-bld/metagraph_1760572361042/work/metagraph/external-libraries/folly/folly/memory/Malloc.h:104:9: error: use of undeclared identifier 'sallocx'�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR)   104 |         sallocx == nullptr || dallocx == nullptr || sdallocx == nullptr ||�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR)       |         ^�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR) /opt/mambaforge/envs/bioconda/conda-bld/metagraph_1760572361042/work/metagraph/external-libraries/folly/folly/memory/Malloc.h:104:31: error: use of undeclared identifier 'dallocx'�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR)   104 |         sallocx == nullptr || dallocx == nullptr || sdallocx == nullptr ||�[0m
23:55:57 �[32mBIOCONDA INFO�[0m (ERR)       |                               ^�[0m

- boost-cpp
- libgomp # [linux]
- llvm-openmp # [osx,osx-arm64]

test:
commands:
Expand All @@ -64,9 +62,9 @@ about:

extra:
recipe-maintainers:
- adamant-pwn
- izcram
- karasikov
additional-platforms:
- linux-aarch64
skip-lints:
- uses_vcs_url
- osx-arm64
85 changes: 85 additions & 0 deletions recipes/metagraph/metagraph-jemalloc-conditional.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please make sure, this gets upstreamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's already in the master branch and will be in the next release. So, this patch can be removed in the next release.

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
diff --git a/metagraph/CMakeLists.txt b/metagraph/CMakeLists.txt
index e651d2176..2371386b7 100644
--- a/metagraph/CMakeLists.txt
+++ b/metagraph/CMakeLists.txt
@@ -331,16 +331,17 @@ find_package(Boost REQUIRED COMPONENTS iostreams)

findFolly()
if(FOLLY_FOUND)
- add_definitions(-D_USE_FOLLY -DUSE_JEMALLOC)
+ add_definitions(-D_USE_FOLLY)
+ if(Jemalloc_FOUND)
+ add_definitions(-DUSE_JEMALLOC)
+ else()
+ message(WARNING "Jemalloc not found, some optimizations will be disabled.")
+ endif()
include_directories(SYSTEM
external-libraries/folly
${CMAKE_BINARY_DIR}/external-libraries/folly/include
)
set(METALIBS ${METALIBS} fbvector)
-else()
- message(WARNING "Prerequisites for Folly (Facebook Open Source Library) not found."
- " Install jemalloc to compile with folly and enable various"
- " optimizations as well as reduce memory taken up by the Row-Compressed annotator.")
endif()

# makes ASIO not depend on boost
diff --git a/metagraph/CMakeListsHelpers.txt b/metagraph/CMakeListsHelpers.txt
index d7777c644..fd01b885d 100644
--- a/metagraph/CMakeListsHelpers.txt
+++ b/metagraph/CMakeListsHelpers.txt
@@ -7,7 +7,7 @@ function (findOpenMP)
# and happily cached, thus messing up the compilation flags forever
unset(OpenMP_C_FLAGS CACHE)
unset(OpenMP_CXX_FLAGS CACHE)
-if(APPLE AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
execute_process(
COMMAND brew --prefix libomp
OUTPUT_VARIABLE BREW_OMP_PREFIX
@@ -90,27 +90,25 @@ if(Jemalloc_FOUND)
endif()
endif()

-if(Jemalloc_FOUND)
- message(STATUS "Configuring Folly")
- include(external-libraries/folly/CMake/FollyConfigChecks.cmake)
- configure_file(
- external-libraries/folly/CMake/folly-config.h.cmake
- ${CMAKE_BINARY_DIR}/external-libraries/folly/include/folly/folly-config.h
- )
- add_library(fbvector STATIC
- external-libraries/folly/folly/ScopeGuard.cpp
- external-libraries/folly/folly/memory/detail/MallocImpl.cpp
- )
- target_include_directories(fbvector SYSTEM PRIVATE
- ${JEMALLOC_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS}
- external-libraries/folly
- ${CMAKE_BINARY_DIR}/external-libraries/folly/include
- ${PROJECT_SOURCE_DIR}/src/common
- )
- target_link_libraries(fbvector PRIVATE ${JEMALLOC_LIBRARIES} ${Boost_LIBRARIES})
- set(FOLLY_FOUND TRUE PARENT_SCOPE)
-endif()
+message(STATUS "Configuring Folly")
+include(external-libraries/folly/CMake/FollyConfigChecks.cmake)
+configure_file(
+ external-libraries/folly/CMake/folly-config.h.cmake
+ ${CMAKE_BINARY_DIR}/external-libraries/folly/include/folly/folly-config.h
+)
+add_library(fbvector STATIC
+ external-libraries/folly/folly/ScopeGuard.cpp
+ external-libraries/folly/folly/memory/detail/MallocImpl.cpp
+)
+target_include_directories(fbvector SYSTEM PRIVATE
+ ${JEMALLOC_INCLUDE_DIRS}
+ ${Boost_INCLUDE_DIRS}
+ external-libraries/folly
+ ${CMAKE_BINARY_DIR}/external-libraries/folly/include
+ ${PROJECT_SOURCE_DIR}/src/common
+)
+target_link_libraries(fbvector PRIVATE ${JEMALLOC_LIBRARIES} ${Boost_LIBRARIES})
+set(FOLLY_FOUND TRUE PARENT_SCOPE)
endfunction()