microsoft/onnxruntime-extensions

Public

mirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.5.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cmake/externals/farmhash/dev/INSTRUCTIONS

46lines · modecode

1WARNING: ./builder (built from builder.cc) can modify files in ../src! Backup your files before running it!
2WARNING: ./builder (built from builder.cc) can attempt to download SMHasher from the internet, and compile and run it! Consider using a virtual machine or sandbox of some kind!
3
4USING ./BUILDER
5
6Some examples of how to use ./builder, assuming you've created /tmp/a as a scratch directory:
7
8cd ~/farm/farmhash/dev && g++ -std=gnu++0x builder.cc -o builder && DIR=a/$RANDOM ./builder && (cd .. && make check); wc -l ../src/farmhash.cc
9
10If that works, I also like to do
11(cd .. && make clean && make check CXXFLAGS="-msse4.2 -maes") && (cd .. && make clean && make check CXXFLAGS="-msse4.2 -O0") && (cd .. && make clean && make check CXXFLAGS="-maes -O0") && echo yes
12
13cd ~/farm/farmhash/dev && g++ -std=gnu++0x builder.cc -o builder && DIR=a/$RANDOM TEST=farmhashsa::Hash32 ./builder
14
15nspace=farmhashsu; fns=$(for i in WithSeed ""; do for j in "" D Q; do echo ${nspace}::Hash32$i$j; done; done | xargs ~/bin/shell/joinargs); cd ~/farm/farmhash/dev && g++ -std=gnu++0x builder.cc -o builder && CMAKE32=1 CXXFLAGS="-DFARMHASH_ASSUME_SSE42 -msse4.2" DIR=a/$RANDOM TEST=$fns PARALLELISM=8 ./builder
16
17STYLE NOTES
18
19Some code here is stylistically odd or following unseen rules because
20it is processed by scripts. Some of it is terribly hacky. For
21example:
22
230. Hash functions in a farmhash??.cc file that are meant to be called
24from farmhash.cc should not have "STATIC_INLINE" on their definiton,
25and their definition should begin with a single line that includes the
26arg list and ends with "{".
27
281. All hash functions in a farmhash??.cc that are conditionally
29compiled should work under the same set of conditions (e.g.,
30can_use_aesni && can_use_sse42). The condition should be made obvious
31at the top of the file, and if the requirements aren't met then dummy
32versions should be provided, with each dummy's body starting with
33FARMHASH_DIE_IF_MISCONFIGURED. It's easiest to work from a copy of an
34existing file.
35
362. SELFTESTHash32 and similar must have 2 lines and must only use "len"
37once per line.
38
393. farmhash??.cc can depend on any other farmhash??.cc, as long as
40the dependency graph is acyclic.
41
424. Macros defined in a farmhash??.cc file should generally be #undef
43before and/or after use, to reduce the chance of running into weird
44errors. The code in farmhash??.cc will end up in ../src/farmhash.cc,
45not in a header file, so you don't have to worry too much about
46messing up macro defintions that later code will require.