Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version: 0.3.1 → 0.4.0 #29

Merged
merged 31 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
81f3d3a
Bump version: 0.3.1 → 0.4.0
mtbarta Jun 15, 2024
c0e4c2e
Update build_and_upload_conda.yaml
mtbarta Jun 15, 2024
9f00adc
Update CMakeLists.txt
mtbarta Jun 15, 2024
e679eac
add mkl root to conda build for ubuntu
mtbarta Jun 15, 2024
b75fba9
remove mkl root in conda commands.
mtbarta Jun 15, 2024
a2cbdae
add mkl root to conda build for ubuntu
mtbarta Jun 15, 2024
1685094
remove mkl root from linux. upgrade mkl
mtbarta Jun 15, 2024
36c8f5c
replace conda with mamba
mtbarta Jun 15, 2024
cadc76f
try to remove gnu openmp
mtbarta Jun 16, 2024
9e2c0a1
mkl to 2024.
mtbarta Jun 16, 2024
4bcfcf0
mamba init
mtbarta Jun 16, 2024
62f2d69
remove mamba
mtbarta Jun 16, 2024
5ecdee2
remove clang, but add llvm openmp
mtbarta Jun 16, 2024
6f9a8c2
use numpy from anaconda, not conda forge.
mtbarta Jun 16, 2024
08828bf
remove lapack
mtbarta Jun 16, 2024
df13abb
add fortran compiler back in
mtbarta Jun 16, 2024
a4f4bd9
remove fortran compiler from lintdb in conda
mtbarta Jun 16, 2024
f3b2ae5
fix mkl version
mtbarta Jun 16, 2024
b80df11
limit build to py3.11
mtbarta Jun 16, 2024
302d35c
remove fortran from liblintdb
mtbarta Jun 16, 2024
fbf8524
increase cmake version
mtbarta Jun 16, 2024
c00c00a
add ports to control versions of rocksdb and zlib
mtbarta Jun 16, 2024
d9c7d91
put mkl root everywhere for linux
mtbarta Jun 16, 2024
cb1f7e0
add fortran compiler for lapack
mtbarta Jun 16, 2024
e16543e
remove zlib port
mtbarta Jun 16, 2024
aba3576
use clang on linux. link against iomp for liblintdb
mtbarta Jun 16, 2024
cfaa017
add llvm-openmp for linux builds
mtbarta Jun 16, 2024
4cc54bb
provide the right path to libiomp5 library in build-lib
mtbarta Jun 16, 2024
59be30c
try to point to lib for libiomp5
mtbarta Jun 16, 2024
21f4cd7
remove libiomp5 path totally
mtbarta Jun 16, 2024
75ee5a8
explicitly require intel-openmp in linux conda
mtbarta Jun 17, 2024
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.1
current_version = 0.4.0
commit = True
tag = True

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build_and_upload_conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

- name: Update environment
run:
mamba env update -n lintdb-build -f
conda env update -n lintdb-build -f
conda/environment.yaml
if: steps.cache.outputs.cache-hit != 'true'

Expand All @@ -81,16 +81,17 @@ jobs:
MKLROOT: ${{ github.workspace }}/builds/release/vcpkg_installed/x64-linux/lib/intel64
run: |
label=""
upload="yes"
if [ "${{github.event.action}}" == "released" ]; then
label="main"
elif [ "${{github.event.action}}" == "prereleased" ]; then
label="dev"
else
echo "The trigger type ${{github.event.action}} is not compatible with `label: auto`"
exit 1
label="nightly"
upload="no"
fi
conda activate lintdb-build
conda config --set anaconda_upload yes
conda config --set anaconda_upload ${upload}
out_dir=`mktemp -d -t compilation-XXXXXXXXXX`
echo "::group::Building conda package for host platform"
echo "conda build lintdb --user deployql --cache-dir "conda-${{ runner.os }}--${{ runner.arch }}-build-cache" --output-folder $out_dir"
Expand Down
14 changes: 11 additions & 3 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
python:
- 3.9
- 3.10
# - 3.9
# - 3.10
- 3.11
- 3.12
# - 3.12
MACOSX_SDK_VERSION: # [osx and x86_64]
- "10.13" # [osx and x86_64]
MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64]
- "10.13" # [osx and x86_64]
c_compiler:
- clang
c_compiler_version:
- 18
cxx_compiler:
- clangxx
cxx_compiler_version:
- 18
10 changes: 7 additions & 3 deletions conda/lintdb/build-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

set -e

cmake -B _build \
MKLROOT=_build/vcpkg_installed/x64-linux/lib/intel64 cmake -B _build \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DENABLE_PYTHON=OFF \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBLA_VENDOR=Intel10_64lp \
-DCMAKE_BUILD_TYPE=Release .
-DCMAKE_BUILD_TYPE=Release \
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \
-DOpenMP_CXX_LIB_NAMES=libiomp5 \
-DOpenMP_libiomp5_LIBRARY=$PREFIX/lib/libiomp5.so \
.

make -C _build -j$(nproc) lintdb
MKLROOT=_build/vcpkg_installed/x64-linux/lib/intel64 make -C _build -j$(nproc) lintdb

cmake --install _build --prefix $PREFIX
cmake --install _build --prefix _liblintdb_stage/
4 changes: 2 additions & 2 deletions conda/lintdb/build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ set -e
# -DPYTHON_INCLUDE_DIR=$(python -c "import sysconfig; print(sysconfig.get_path('include'))") \
# -DPYTHON_LIBRARY=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \

cmake -B _build_python_${PY_VER} \
MKLROOT=_build_python_${PY_VER}/vcpkg_installed/x64-linux/lib/intel64 cmake -B _build_python_${PY_VER} \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-Dlintdb_ROOT=_liblintdb_stage/ \
-DCMAKE_BUILD_TYPE=Release \
-DPython_EXECUTABLE=$PYTHON \
.

make -C _build_python_${PY_VER} -j$(nproc) pylintdb
MKLROOT=_build_python_${PY_VER}/vcpkg_installed/x64-linux/lib/intel64 make -C _build_python_${PY_VER} -j$(nproc) pylintdb

# Build actual python module.
cd _build_python_${PY_VER}/lintdb/python
Expand Down
38 changes: 18 additions & 20 deletions conda/lintdb/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,25 @@ outputs:
requirements:
build:
- {{ compiler('cxx') }}
- {{ compiler('fortran')}}
- {{ compiler('fortran') }}
- sysroot_linux-64 =2.17 # [linux64]
- llvm-openmp # [osx]
- cmake >=3.23.1
- llvm-openmp # [osx]
- intel::intel-openmp =2023.0.0 #[linux]
- cmake >=3.25
- make # [not win]
- lapack # [linux]
- conda-forge::swig >=4.0.2
- conda-forge::numpy
- mkl-devel =2023 # [x86_64]
- conda-forge::onnxruntime-cpp
- numpy
- mkl-devel =2023.0.0 # [x86_64]
- conda-forge::onnxruntime-cpp==1.17.3
host:
- mkl =2023 # [x86_64]
- intel::intel-openmp =2023.0.0 #[linux]
- mkl =2023.0.0 # [x86_64]
- openblas # [not x86_64]
- conda-forge::onnxruntime-cpp
- conda-forge::onnxruntime-cpp==1.17.3
run:
- mkl =2023 # [x86_64]
- mkl =2023.0.0 # [x86_64]
- openblas # [not x86_64]
- conda-forge::onnxruntime-cpp
- conda-forge::onnxruntime-cpp==1.17.3
- __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.13") }} # [osx and x86_64]
test:
requires:
Expand All @@ -64,7 +65,6 @@ outputs:
- conda inspect linkages -p $PREFIX $PKG_NAME # [not win]
- conda inspect objects -p $PREFIX $PKG_NAME # [osx]


- name: lintdb
script: build-pkg.sh # [x86_64 and linux]
script: build-pkg-osx.sh # [x86_64 and osx]
Expand All @@ -76,28 +76,26 @@ outputs:
requirements:
build:
- {{ compiler('cxx') }}
- {{ compiler('fortran') }}
- llvm-openmp # [osx]
# - lapack # [linux]
- llvm-openmp
- sysroot_linux-64 =2.17 # [linux64]
- conda-forge::swig >= 4.0.2
- conda-forge::numpy
- cmake >=3.23.1
- numpy
- cmake >=3.25
- make # [not win]
- python {{ python }}
host:
- python {{ python }}
- conda-forge::numpy
- numpy
- {{ pin_subpackage('liblintdb', exact=True) }}
run:
- python {{ python }}
- conda-forge::numpy
- numpy
- packaging
- {{ pin_subpackage('liblintdb', exact=True) }}
- __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.13") }} # [osx and x86_64]
test:
requires:
- conda-forge::numpy
- numpy
- pytorch
commands:
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*"
Expand Down
4 changes: 2 additions & 2 deletions lintdb/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include(${SWIG_USE_FILE})
include(UseSWIG)

# below is useful for debugging typemaps. It will log how each object resolves its typemap.
set(CMAKE_SWIG_FLAGS "-debug-tmsearch")
# set(CMAKE_SWIG_FLAGS "-debug-tmsearch")

set(UseSWIG_TARGET_NAME_PREFERENCE STANDARD)
set(SWIG_SOURCE_FILE_EXTENSIONS swig)
Expand Down Expand Up @@ -82,4 +82,4 @@ configure_file(setup.py setup.py COPYONLY)
configure_file(__init__.py __init__.py COPYONLY)

# copy our version file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.txt ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.txt ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
2 changes: 1 addition & 1 deletion lintdb/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#define LINTDB_VERSION_STRING "0.3.1"
#define LINTDB_VERSION_STRING "0.4.0"


namespace lintdb {
Expand Down
122 changes: 122 additions & 0 deletions ports/rocksdb/0001-fix-dependencies.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
CMakeLists.txt | 33 +++++++++++++++------------------
cmake/RocksDBConfig.cmake.in | 11 ++++++++---
2 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 23a4014bc..045f5a36d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,7 @@ endif()

include(CMakeDependentOption)

-if(MSVC)
+if(0)
option(WITH_GFLAGS "build with GFlags" OFF)
option(WITH_XPRESS "build with windows built in compression" OFF)
option(ROCKSDB_SKIP_THIRDPARTY "skip thirdparty.inc" OFF)
@@ -136,10 +136,7 @@ else()
endif()

if(WITH_SNAPPY)
- find_package(Snappy CONFIG)
- if(NOT Snappy_FOUND)
- find_package(Snappy REQUIRED)
- endif()
+ find_package(Snappy CONFIG REQUIRED)
add_definitions(-DSNAPPY)
list(APPEND THIRDPARTY_LIBS Snappy::snappy)
endif()
@@ -163,16 +160,19 @@ else()
endif()

if(WITH_LZ4)
- find_package(lz4 REQUIRED)
+ find_package(lz4 CONFIG REQUIRED)
add_definitions(-DLZ4)
list(APPEND THIRDPARTY_LIBS lz4::lz4)
endif()

if(WITH_ZSTD)
- find_package(zstd REQUIRED)
+ find_package(zstd CONFIG REQUIRED)
add_definitions(-DZSTD)
- include_directories(${ZSTD_INCLUDE_DIR})
- list(APPEND THIRDPARTY_LIBS zstd::zstd)
+ if(TARGET zstd::libzstd_shared)
+ list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared)
+ elseif(TARGET zstd::libzstd_static)
+ list(APPEND THIRDPARTY_LIBS zstd::libzstd_static)
+ endif()
endif()
endif()

@@ -312,11 +312,10 @@ int main() {
endif()

if (WITH_LIBURING)
- find_package(uring)
- if (uring_FOUND)
- add_definitions(-DROCKSDB_IOURING_PRESENT)
- list(APPEND THIRDPARTY_LIBS uring::uring)
- endif()
+ find_package(PkgConfig)
+ pkg_check_modules(liburing REQUIRED IMPORTED_TARGET GLOBAL liburing>=2.0)
+ add_definitions(-DROCKSDB_IOURING_PRESENT)
+ list(APPEND THIRDPARTY_LIBS PkgConfig::liburing)
endif()

# Reset the required flags
@@ -382,9 +381,9 @@ endif()

option(WITH_TBB "build with Threading Building Blocks (TBB)" OFF)
if(WITH_TBB)
- find_package(TBB REQUIRED)
+ find_package(TBB CONFIG REQUIRED)
add_definitions(-DTBB)
- list(APPEND THIRDPARTY_LIBS TBB::TBB)
+ list(APPEND THIRDPARTY_LIBS TBB::tbb)
endif()

# Stall notifications eat some performance from inserts
@@ -1202,8 +1201,6 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)
endforeach()
endforeach()

- install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination})
-
install(
TARGETS ${ROCKSDB_STATIC_LIB}
EXPORT RocksDBTargets
diff --git a/cmake/RocksDBConfig.cmake.in b/cmake/RocksDBConfig.cmake.in
index 0bd14be11..a420d8bfe 100644
--- a/cmake/RocksDBConfig.cmake.in
+++ b/cmake/RocksDBConfig.cmake.in
@@ -33,11 +33,11 @@ if(@WITH_BZ2@)
endif()

if(@WITH_LZ4@)
- find_dependency(lz4)
+ find_dependency(lz4 CONFIG)
endif()

if(@WITH_ZSTD@)
- find_dependency(zstd)
+ find_dependency(zstd CONFIG)
endif()

if(@WITH_NUMA@)
@@ -45,7 +45,12 @@ if(@WITH_NUMA@)
endif()

if(@WITH_TBB@)
- find_dependency(TBB)
+ find_dependency(TBB CONFIG)
+endif()
+
+if(@WITH_LIBURING@)
+ find_dependency(PkgConfig)
+ pkg_check_modules(liburing REQUIRED IMPORTED_TARGET GLOBAL liburing>=2.0)
endif()

find_dependency(Threads)
68 changes: 68 additions & 0 deletions ports/rocksdb/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebook/rocksdb
REF "v${VERSION}"
SHA512 524e3e70ed2b1d2e6c61a7b401946e50473cc95684ce4efc6250062f5bc945e443e96f7907fcc3ee1ab98c71179a8b56a654383cf2c0bbe1bb20907ab1ac7523
HEAD_REF main
PATCHES
0001-fix-dependencies.patch
)

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_MD_LIBRARY)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ROCKSDB_BUILD_SHARED)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"liburing" WITH_LIBURING
"snappy" WITH_SNAPPY
"lz4" WITH_LZ4
"zlib" WITH_ZLIB
"zstd" WITH_ZSTD
"bzip2" WITH_BZ2
"numa" WITH_NUMA
"tbb" WITH_TBB
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DWITH_GFLAGS=OFF
-DWITH_TESTS=OFF
-DWITH_BENCHMARK_TOOLS=OFF
-DWITH_TOOLS=OFF
-DUSE_RTTI=ON
-DROCKSDB_INSTALL_ON_WINDOWS=ON
-DFAIL_ON_WARNINGS=OFF
-DWITH_MD_LIBRARY=${WITH_MD_LIBRARY}
-DPORTABLE=1 # Minimum CPU arch to support, or 0 = current CPU, 1 = baseline CPU
-DROCKSDB_BUILD_SHARED=${ROCKSDB_BUILD_SHARED}
-DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DCMAKE_DEBUG_POSTFIX=d
-DWITH_RUNTIME_DEBUG=ON
OPTIONS_RELEASE
-DWITH_RUNTIME_DEBUG=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/rocksdb)

vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_fixup_pkgconfig()

vcpkg_install_copyright(COMMENT [[
RocksDB is dual-licensed under both the GPLv2 (found in COPYING)
and Apache 2.0 License (found in LICENSE.Apache). You may select,
at your option, one of the above-listed licenses.
]]
FILE_LIST
"${SOURCE_PATH}/LICENSE.leveldb"
"${SOURCE_PATH}/LICENSE.Apache"
"${SOURCE_PATH}/COPYING"
)
Loading
Loading