Skip to content
Draft
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6c217dd
WIP: build multiplier only using vcpkg
frabert Jan 22, 2024
68169ea
Fix stubs install path
frabert Jan 23, 2024
ebaf242
Fix CI
frabert Jan 23, 2024
7e333bd
Remove vendor submodules
frabert Jan 23, 2024
d728d85
Remove `VENDORED` config options
frabert Jan 23, 2024
a0f352d
Cache vcpkg binaries
frabert Jan 23, 2024
eda743c
Add custom triplets
frabert Jan 23, 2024
1cf4644
Fix caching
frabert Jan 23, 2024
770ad13
Fix capnproto portfile
frabert Jan 23, 2024
1e223da
Fix triplet
frabert Jan 23, 2024
29ebb16
Fix portfiles
frabert Jan 23, 2024
60aa6fd
Fix portfiles
frabert Jan 24, 2024
c959faf
Temporarily disable vast
frabert Jan 24, 2024
513f508
Fix gap portfile
frabert Jan 24, 2024
945125c
Fix portfiles
frabert Jan 24, 2024
d61329a
Re-enable VAST dependency
frabert Jan 24, 2024
890401c
Use clang for building
frabert Jan 24, 2024
0c9ae35
Fix CI?
frabert Jan 26, 2024
5f7522e
Link VAST::VASTFrontend
frabert Jan 26, 2024
fa328b2
Fixes and formatting
frabert Jan 29, 2024
5e2f6df
Remove linker flags CMake file
frabert Jan 29, 2024
8c277a3
Fix caching
frabert Jan 29, 2024
020198d
Change cache path
frabert Jan 29, 2024
dbab145
Use registry submodule
frabert Feb 1, 2024
58d341a
Merge remote-tracking branch 'origin/main' into frabert/build-using-v…
frabert Feb 1, 2024
891055b
No ssh-agent
frabert Feb 1, 2024
83fcb57
No heredocs
frabert Feb 1, 2024
154c7b0
New try
frabert Feb 1, 2024
43fec61
Build LTO and non-LTO versions, pin vcpkg version
frabert Feb 5, 2024
05c979e
Update vcpkg registry
frabert Feb 5, 2024
8153292
Allow installing tools to separate directory
frabert Feb 7, 2024
4e0dd7a
Fixes
frabert Feb 7, 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
48 changes: 22 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ concurrency:
cancel-in-progress: true

env:
LLVM_PASTA_VER: ba5b66d
LLVM_VER: 17
PYTHON_VER: 3.11
VCPKG_BINARY_SOURCES: clear;files,/root/vcpkg-binary-cache,readwrite

jobs:
build:
Expand Down Expand Up @@ -58,42 +58,38 @@ jobs:
- name: Set up variables
run: |
echo "RELEASE_DIR=${RUNNER_TEMP}/release" >> $GITHUB_ENV
echo "LLVM_PREFIX_DIR=${RUNNER_TEMP}/llvm" >> $GITHUB_ENV
echo "VERSION=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
echo "ARTIFACT_NAME=multiplier-$(git rev-parse --short=7 HEAD).tar.xz" >> $GITHUB_ENV
echo "CC=$(which clang-$LLVM_VER)" >> $GITHUB_ENV
echo "CXX=$(which clang++-$LLVM_VER)" >> $GITHUB_ENV
echo "CFLAGS=-g0 --ld-path=$(which ld.lld-$LLVM_VER) -flto" >> $GITHUB_ENV
echo "CXXFLAGS=-g0 --ld-path=$(which ld.lld-$LLVM_VER) -flto" >> $GITHUB_ENV

- name: Install llvm-pasta
- name: Setup vcpkg
run: |
mkdir -p ${RELEASE_DIR}
mkdir -p ${LLVM_PREFIX_DIR}
gh release download ${LLVM_PASTA_VER} --repo trail-of-forks/llvm-project --pattern 'llvm-*'
tar -xvJf llvm-pasta-*.tar.xz -C ${LLVM_PREFIX_DIR}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
mkdir -p /root/vcpkg-binary-cache
git clone https://github.com/microsoft/vcpkg $HOME/vcpkg
$HOME/vcpkg/bootstrap-vcpkg.sh

- name: Cache vcpkg binaries
id: cache-vcpkg
uses: actions/cache@v4
with:
path: /root/vcpkg-binary-cache
key: ${{ runner.os }}-vcpkg-binaries

- name: Build
run: |

CXXFLAGS="-g0" \
CCFLAGS="-g0" \
cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux-rel \
--toolchain "$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${RELEASE_DIR} \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=$(which ld.lld-${LLVM_VER})" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=$(which ld.lld-${LLVM_VER})" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=$(which ld.lld-${LLVM_VER})" \
-DCMAKE_C_COMPILER="$(which clang-${LLVM_VER})" \
-DCMAKE_CXX_COMPILER=$(which clang++-${LLVM_VER}) \
-DClang_DIR=${LLVM_PREFIX_DIR}/lib/cmake/clang \
-DLLVM_DIR=${LLVM_PREFIX_DIR}/lib/cmake/llvm \
-DMLIR_DIR=${LLVM_PREFIX_DIR}/lib/cmake/mlir \
-DMX_USE_VENDORED_CLANG=OFF \
-DMX_USE_VENDORED_PASTA=OFF \
-DLLVM_ENABLE_LLD:BOOL=TRUE \
-GNinja \
./
-S . \
-B build

ninja install
cmake --build build
cmake --install build --prefix ${RELEASE_DIR}

# Release on merge to main
- name: Package Release
Expand Down
53 changes: 0 additions & 53 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,53 +0,0 @@
[submodule "vendor/concurrentqueue/src"]
path = vendor/concurrentqueue/src
url = https://github.com/cameron314/concurrentqueue.git
shallow = true
[submodule "vendor/reproc/src"]
path = vendor/reproc/src
url = https://github.com/DaanDeMeyer/reproc.git
shallow = true
[submodule "vendor/capnproto/src"]
path = vendor/capnproto/src
url = https://github.com/capnproto/capnproto.git
shallow = true
[submodule "vendor/glog/src"]
path = vendor/glog/src
url = https://github.com/google/glog.git
shallow = true
[submodule "vendor/gflags/src"]
path = vendor/gflags/src
url = https://github.com/gflags/gflags.git
shallow = true
[submodule "vendor/zstd/src"]
path = vendor/zstd/src
url = https://github.com/facebook/zstd.git
shallow = true
[submodule "vendor/gap/src"]
path = vendor/gap/src
url = https://github.com/lifting-bits/gap.git
shallow = true
[submodule "vendor/pasta/src"]
path = vendor/pasta/src
url = https://github.com/trailofbits/pasta.git
branch = master
[submodule "vendor/llvm-project/src"]
path = vendor/llvm-project/src
url = https://github.com/trail-of-forks/llvm-project.git
branch = pasta-llvmorg-17.0.4
[submodule "vendor/abseil/src"]
path = vendor/abseil/src
url = https://github.com/abseil/abseil-cpp.git
shallow = true
[submodule "vendor/re2/src"]
path = vendor/re2/src
url = https://github.com/google/re2.git
shallow = true
[submodule "vendor/rocksdb/src"]
path = vendor/rocksdb/src
url = https://github.com/facebook/rocksdb.git
[submodule "vendor/xxhash/src"]
path = vendor/xxhash/src
url = https://github.com/Cyan4973/xxHash.git
[submodule "vendor/vast/src"]
path = vendor/vast/src
url = https://github.com/trailofbits/vast.git
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif()
list(PREPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")

include("cmake/system.cmake")
include("cmake/llvm.cmake")
#include("cmake/llvm.cmake")
include("cmake/linker.cmake")
Copy link
Contributor

@pgoodman pgoodman Jan 28, 2024

Choose a reason for hiding this comment

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

@frabert Is this still needed? It does:

if(PLATFORM_LINUX)
  set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")
  set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld")
  set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")
endif(PLATFORM_LINUX)

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this should be some higher-level vcpkg thing.

include("cmake/git.cmake")

Expand Down
4 changes: 3 additions & 1 deletion bin/Index/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ add_executable("${exe_name}"
"${MX_BOOTSTRAP_INCLUDE_VISITOR_INC_H}"
)

find_package(concurrentqueue MODULE REQUIRED)

target_link_libraries("${exe_name}"
PRIVATE
"mx-api"
Expand Down Expand Up @@ -118,7 +120,7 @@ set_target_properties("${exe_name}"
"${PROJECT_BINARY_DIR}/${MX_INSTALL_BIN_DIR}"
)

find_and_link_llvm_dependencies("${exe_name}")
#find_and_link_llvm_dependencies("${exe_name}")

if(MX_ENABLE_INSTALL AND NOT MX_ENABLE_BOOTSTRAP)
install(
Expand Down
2 changes: 1 addition & 1 deletion bindings/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if(MX_ENABLE_INSTALL AND NOT MX_ENABLE_BOOTSTRAP)
DIRECTORY
"${CMAKE_CURRENT_LIST_DIR}/${lower_project_name}-stubs"
DESTINATION
"${CMAKE_INSTALL_PREFIX}/${MX_INSTALL_LIB_DIR}/${site_packages_dir}"
"${MX_INSTALL_LIB_DIR}/${site_packages_dir}"
)

# Install the binary into the target site-packages directory.
Expand Down
16 changes: 16 additions & 0 deletions cmake/modules/Findconcurrentqueue.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
find_path(concurrentqueue_INCLUDE_DIR concurrentqueue.h PATH_SUFFIXES concurrentqueue)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(concurrentqueue
REQUIRED_VARS concurrentqueue_INCLUDE_DIR)

# Create the imported target
if(concurrentqueue_FOUND)
set(concurrentqueue_INCLUDE_DIRS ${concurrentqueue_INCLUDE_DIR})

if(NOT TARGET concurrentqueue)
add_library(concurrentqueue INTERFACE IMPORTED)
set_target_properties(concurrentqueue PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${concurrentqueue_INCLUDE_DIRS}")
endif()
endif()
15 changes: 0 additions & 15 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,6 @@ set(MX_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH "Directory i
set(MX_INSTALL_SHARE_DIR "${CMAKE_INSTALL_DATADIR}" CACHE PATH "Directory in which Multiplier CMake files will be installed")
set(MX_VENDOR_INSTALL_DIR "${PROJECT_BINARY_DIR}/vendor/install" CACHE PATH "Directory in which multiplier's vendored dependencies are installed")

option(MX_USE_VENDORED_CAPNPROTO "Set to OFF to disable default building of Cap'n Proto as a vendored library." ON)
option(MX_USE_VENDORED_GLOG "Set to OFF to disable default building of Google glog as a vendored library." ON)
option(MX_USE_VENDORED_GFLAGS "Set to OFF to disable default building of gflags as a vendored library." ON)
option(MX_USE_VENDORED_ZSTD "Set to OFF to disable default building of ZStandard as a vendored library." ON)
option(MX_USE_VENDORED_REPROC "Set to OFF to disable default building of reproc/reproc++ as a vendored library." ON)
option(MX_USE_VENDORED_GAP "Set to OFF to disable default building of gap as a vendored library." ON)
option(MX_USE_VENDORED_CLANG "Set to OFF to disable default building of Clang/LLVM as a vendored library." ON)
option(MX_USE_VENDORED_PASTA "Set to OFF to disable default building of PASTA as a vendored library." ON)
option(MX_USE_VENDORED_ABSEIL "Set to OFF to disable default building of Abseil as a vendored library." ON)
option(MX_USE_VENDORED_RE2 "Set to OFF to disable default building of RE2 as a vendored library." ON)
option(MX_USE_VENDORED_ROCKSDB "Set to OFF to disable default building of RocksDB as a vendored library." ON)
option(MX_USE_VENDORED_XXHASH "Set to OFF to disable default building of xxHash as a vendored library." ON)
option(MX_USE_VENDORED_NANOBIND "Set to OFF to disable default building of nanobind as a vendored library." ON)
option(MX_USE_VENDORED_VAST "Set to OFF to disable default building of VAST as a vendored library." ON)

option(MX_ENABLE_BOOTSTRAP "Set to ON to enable re-bootstrapping of some auto-generated files." OFF)
option(MX_ENABLE_INSTALL "Set to ON to enable the install target" ON)
option(MX_ENABLE_RE2 "Set to OFF to disable RE2 integration" ON)
Expand Down
1 change: 1 addition & 0 deletions cmake/vast.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ set(VAST_LIBS
VAST::VASTAliasTypeInterface
VAST::VASTElementTypeInterface
VAST::VASTCodeGen
VAST::VASTFrontend
)
34 changes: 34 additions & 0 deletions custom-ports/capnproto/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO capnproto/capnproto
REF f5531718b95c2ad4fcedc624e0d46866455007f4
SHA512 255c7a630096c322056775f98336df8d6ab0fb967226d9fca3db6c997dcb4e5580c9e3041aece7c7623ea006f2d857dea348399c9cc869ac8414cdfa36714a75
HEAD_REF master
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCAPNP_LITE=OFF
-DEXTERNAL_CAPNP=OFF
-DBUILD_TESTING=OFF
-DWITH_ZLIB=AUTO
-DWITH_OPENSSL=AUTO
-DWITH_FIBERS=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/CapnProto)

vcpkg_copy_tools(TOOL_NAMES capnp capnpc-c++ capnpc-capnp AUTO_CLEAN)

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

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

vcpkg_fixup_pkgconfig()
9 changes: 9 additions & 0 deletions custom-ports/capnproto/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "capnproto",
"version": "0.1.0",
"dependencies": [
"vcpkg-cmake",
"vcpkg-cmake-config"
]
}
27 changes: 27 additions & 0 deletions custom-ports/gap/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lifting-bits/gap
REF ad8fefaf7235a9cd6670e272ca4487807ed81f8a
SHA512 9e9259fd4c3c96e31965613092f7dec9df5e236aa4ef9ac122378fe1708d4efd2fb6bd9837530e8474646dc3b0aa409781fd6f45fc28929d07bb54a95a072566
HEAD_REF main
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DGAP_ENABLE_TESTING=OFF
-DGAP_ENABLE_EXAMPLES=OFF
-DGAP_ENABLE_COROUTINES=ON
-DGAP_ENABLE_WARNINGS=OFF
-DGAP_INSTALL=ON
-DUSE_SYSTEM_DEPENDENCIES=ON
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(
PACKAGE_NAME "gap"
CONFIG_PATH lib/cmake/gap
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

file( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" )
9 changes: 9 additions & 0 deletions custom-ports/gap/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "gap",
"version": "0.1.0",
"dependencies": [
"vcpkg-cmake",
"vcpkg-cmake-config"
]
}
Loading