separating binary lib of ippcp by target platform

oxigraph-main
Niko PLP 1 year ago
parent a397fbd0e2
commit e393b5183a
  1. 1
      plugin/ippcp/.gitignore
  2. BIN
      plugin/ippcp/examples/ippcp_example
  3. BIN
      plugin/ippcp/examples2/ippcp_example
  4. 2
      plugin/ippcp/ippcp.mk
  5. BIN
      plugin/ippcp/library/linux/lib/libippcp.a
  6. 0
      plugin/ippcp/library/macos/lib/libippcp.a
  7. BIN
      plugin/ippcp/library/src/sources/dispatcher/__pycache__/gen_disp_common.cpython-39.pyc
  8. 2
      plugin/ippcp/test_linux/Makefile
  9. 72
      plugin/ippcp/test_linux/ippcp_example.cc
  10. 12
      plugin/ippcp/test_macos/Makefile
  11. 0
      plugin/ippcp/test_macos/ippcp_example.cc
  12. 2
      plugin/ippcp/test_plain/Makefile
  13. 0
      plugin/ippcp/test_plain/ippcp_example.cc

@ -0,0 +1 @@
ippcp_example

@ -1,4 +1,4 @@
ippcp_SOURCES = ippcp_provider.cc ippcp_SOURCES = ippcp_provider.cc
ippcp_HEADERS = ippcp_provider.h ippcp_HEADERS = ippcp_provider.h
ippcp_LDFLAGS = -lippcp ippcp_LDFLAGS = -lippcp -Lplugin/ippcp/library/linux/lib
ippcp_CXXFLAGS = -Iplugin/ippcp/library/include ippcp_CXXFLAGS = -Iplugin/ippcp/library/include

@ -1,6 +1,6 @@
include ../../../make_config.mk include ../../../make_config.mk
PLATFORM_LDFLAGS += -lrocksdb -lippcp -L../../.. -L../library/lib PLATFORM_LDFLAGS += -lrocksdb -lippcp -L../../.. -L../library/linux/lib
.PHONY: clean .PHONY: clean
all: ippcp_example all: ippcp_example

@ -0,0 +1,72 @@
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// Copyright (c) 2020 Intel Corporation
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
#include <rocksdb/db.h>
#include <rocksdb/env_encryption.h>
#include <rocksdb/options.h>
#include <rocksdb/slice.h>
#include <rocksdb/utilities/options_util.h>
#include <rocksdb/utilities/object_registry.h>
#include <string>
#include "../ippcp_provider.h"
using namespace ROCKSDB_NAMESPACE;
std::string kDBPath = "/tmp/ipp_aes_example";
int main() {
DB* db;
Options options;
options.create_if_missing = true;
std::shared_ptr<EncryptionProvider> provider;
Status status = EncryptionProvider::CreateFromString(
ConfigOptions(), IppcpProvider::kName(), &provider);
std::printf("ok\n");
assert(status.ok());
status =
provider->AddCipher("", "a6d2ae2816157e2b3c4fcf098815f7xb", 32, false);
assert(status.ok());
options.env = NewEncryptedEnv(Env::Default(), provider);
status = DB::Open(options, kDBPath, &db);
assert(status.ok());
setbuf(stdout, NULL);
printf("writing 1M records...");
WriteOptions w_opts;
for (int i = 0; i < 1000000; ++i) {
std::printf("ok.%d.",i);
status = db->Put(w_opts, std::to_string(i), std::to_string(i * i));
assert(status.ok());
}
printf("flush");
db->Flush(FlushOptions());
printf("done.\n");
printf("reading 1M records...");
std::string value;
ReadOptions r_opts;
for (int i = 0; i < 1000000; ++i) {
status = db->Get(r_opts, std::to_string(i), &value);
assert(status.ok());
assert(value == std::to_string(i * i));
}
printf("done.\n");
// Close database
status = db->Close();
assert(status.ok());
//status = DestroyDB(kDBPath, options);
//assert(status.ok());
return 0;
}

@ -0,0 +1,12 @@
include ../../../make_config.mk
PLATFORM_LDFLAGS += -lrocksdb -lippcp -L../../.. -L../library/macos/lib
.PHONY: clean
all: ippcp_example
ippcp_example: ippcp_example.cc
$(CXX) $(CXXFLAGS) $@.cc -o$@ -I../../../include -O2 $(PLATFORM_LDFLAGS) $(PLATFORM_CXXFLAGS) -I../library/include
clean:
rm -rf ./ippcp_example

@ -1,6 +1,6 @@
include ../../../make_config.mk include ../../../make_config.mk
PLATFORM_LDFLAGS += -lrocksdb -lippcp -L../../.. -L../library/lib PLATFORM_LDFLAGS += -lrocksdb -lippcp -L../../.. -L../library/linux/lib
.PHONY: clean .PHONY: clean
all: ippcp_example all: ippcp_example
Loading…
Cancel
Save