move around

main
Ziyang Hu 2 years ago
parent f5d05a17b3
commit d08df22306

3
.gitignore vendored

@ -27,4 +27,5 @@ compile_commands.json
CTestTestfile.cmake
_deps
*.db
*.db
deps/

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "rocksdb"]
path = rocksdb
url = https://github.com/facebook/rocksdb

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/cozo-rocks">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/cozorocks">
<contentRoot DIR="$PROJECT_DIR$" />
</component>
</project>

@ -14,4 +14,4 @@ chrono = "0.4"
anyhow = "1.0"
lazy_static = "1.4.0"
thiserror = "1.0.30"
cozo-rocks = { path = "cozo-rocks" }
cozorocks = { path = "cozorocks" }

@ -0,0 +1,19 @@
cd rocksdb || exit
make clean
INSTALL_DIR=$(readlink -f ../deps)
echo "$INSTALL_DIR"
rm -fr "$INSTALL_DIR"
mkdir "$INSTALL_DIR"
export JEMALLOC_BASE=/opt/homebrew
JEMALLOC_INCLUDE=" -I $JEMALLOC_BASE/include/" \
JEMALLOC_LIB=" $JEMALLOC_BASE/lib/libjemalloc.a" \
USE_RTTI=1 \
USE_CLANG=1 \
JEMALLOC=1 \
PREFIX=$INSTALL_DIR \
make install-static
DEBUG_LEVEL=0 make libz.a libsnappy.a liblz4.a libzstd.a
mv ./*.a ../deps/lib

@ -1,16 +0,0 @@
fn main() {
cxx_build::bridge("src/lib.rs")
.file("src/cozorocks.cc")
.include("../rocksdb/include")
.include("include")
.flag_if_supported("-std=c++17")
.compile("cozo-rocks");
println!("cargo:rustc-link-search=rocksdb/");
println!("cargo:rustc-link-lib=rocksdb");
println!("cargo:rustc-link-lib=z");
println!("cargo:rustc-link-lib=bz2");
println!("cargo:rerun-if-changed=src/main.rs");
println!("cargo:rerun-if-changed=src/cozorocks.cc");
println!("cargo:rerun-if-changed=include/cozorocks.h");
}

@ -0,0 +1,86 @@
### CMake template
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

@ -1,5 +1,5 @@
[package]
name = "cozo-rocks"
name = "cozorocks"
version = "0.1.0"
edition = "2021"

@ -2,8 +2,8 @@
//// Created by Ziyang Hu on 2022/4/13.
////
//
#include "../include/cozorocks.h"
#include "cozo-rocks/src/lib.rs.h"
#include "cozorocks.h"
#include "cozorocks/src/lib.rs.h"
void write_status_impl(BridgeStatus &status, StatusCode code, StatusSubCode subcode, StatusSeverity severity, int bridge_code) {
status.code = code;

@ -0,0 +1,19 @@
fn main() {
cxx_build::bridge("src/lib.rs")
.file("bridge/cozorocks.cc")
.include("../deps/include")
.include("bridge")
.flag_if_supported("-std=c++17")
.compile("cozorocks");
println!("cargo:rustc-link-search=deps/lib/");
println!("cargo:rustc-link-lib=rocksdb");
println!("cargo:rustc-link-lib=z");
println!("cargo:rustc-link-lib=bz2");
println!("cargo:rustc-link-lib=lz4");
println!("cargo:rustc-link-lib=snappy");
println!("cargo:rustc-link-lib=zstd");
println!("cargo:rerun-if-changed=src/main.rs");
println!("cargo:rerun-if-changed=bridge/cozorocks.cc");
println!("cargo:rerun-if-changed=bridge/cozorocks.h");
}

@ -0,0 +1 @@
Subproject commit ee6ee5ff08d32fb325d8768139305a3227025b0e

@ -1,5 +1,3 @@
extern crate core;
// pub mod value;
// pub mod typing;
// pub mod env;
@ -13,4 +11,14 @@ extern crate core;
// pub mod plan;
pub mod relation;
pub mod db;
pub mod error;
pub mod error;
#[cfg(test)]
mod tests {
#[test]
fn import() {
use cozorocks::*;
let _o = Options::default();
println!("Hello");
}
}
Loading…
Cancel
Save