Skip to content

Commit

Permalink
Merge pull request #103 from IntelLabs/add_install_scons
Browse files Browse the repository at this point in the history
Add install scons
  • Loading branch information
luisremis authored May 10, 2019
2 parents eb510f2 + df15976 commit 990af7c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 9 deletions.
49 changes: 41 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,6 @@ Or follow instructions
* Follow installation instructions


## Python Client Module

VDMS offers the Python Client Module through the pip package manager,
and it is compatible with Python 2.7+ and 3.3+.
pip (or pip2 and pip3) will automatically install dependencies (protobuf).

pip install vdms

## Compilation

git clone https://github.com/intellabs/vdms
Expand All @@ -160,6 +152,47 @@ Flag | Explanation
--timing | Compiles server with chronos for internal timing, experimental.
-jX | Compiles in parallel, using X cores
INTEL_PATH=path | Path to the root folder containing pmgd and vcl. Default is "./" which is pmgd and vcl inside vdms folder. Example: scons INTEL_PATH=/opt/intel/
--prefix | Specify the installation location (see Installation below)


## Installation

### Installing VDMS Server + Libraries

By default, VDMS will build the server binary and
libraries, but will not install them in the sytem.

You can install the VDMS server + libraries in your system by running:

sudo scons install

By defaul, the installation prefix is "/usr/local",
and the VDMS server and libraries at "/usr/local/bin" and
"/usr/local/lib", respectively.

You can also remove (uninstall) VDMS files from your system by running:

sudo scons install -c

You can choose to install VDMS server and libraries in a
location of your choice by using the --prefix flag.

sudo scons install --prefix=/tmp/

In this example, VDMS server will be installed at /tmp/bin, and the
libraries will be installed at /tmp/lib.

To remove (uninstall) VDMS files from a specified location by running:

sudo scons install -c --prefix=/tmp

### Python Client Module

VDMS offers the Python Client Module through the pip package manager,
and it is compatible with Python 2.7+ and 3.3+.
pip (or pip2 and pip3) will automatically install dependencies (protobuf).

pip install vdms

### Running The VDMS Server

Expand Down
22 changes: 21 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ import os
AddOption('--no-server', action="store_false", dest="no-server",
default = True,
help='Only build client libraries')

AddOption('--timing', action='append_const', dest='cflags',
const='-DCHRONO_TIMING',
help= 'Build server with chronos')

AddOption('--prefix', dest='prefix',
type='string',
default='/usr/local/',
nargs=1,
action='store',
metavar='DIR',
help='installation prefix')

def buildServer(env):

env.Append(
Expand All @@ -28,7 +37,7 @@ def buildServer(env):
'faiss',
],

LIBPATH = ['/usr/local/lib/', 'utils/',
LIBPATH = ['utils/',
os.path.join(env['INTEL_PATH'], 'utils/'),
os.path.join(env['INTEL_PATH'], 'pmgd/lib/'),
]
Expand Down Expand Up @@ -70,6 +79,7 @@ def buildServer(env):

env.Program('vdms', vdms_server_files)


# Set INTEL_PATH. First check arguments, then enviroment, then default
if ARGUMENTS.get('INTEL_PATH', '') != '':
intel_path = ARGUMENTS.get("INTEL_PATH", '')
Expand All @@ -83,6 +93,16 @@ env = Environment(CXXFLAGS="-std=c++11 -O3 -fopenmp")
env.Append(INTEL_PATH= intel_path)
env.MergeFlags(GetOption('cflags'))

prefix = str(GetOption('prefix'))

env.Alias('install-bin', env.Install(os.path.join(prefix, "bin"),
source="vdms"))
env.Alias('install-client', env.Install(os.path.join(prefix, "lib"),
source="client/cpp/libvdms-client.so"))
env.Alias('install-utils', env.Install(os.path.join(prefix, "lib"),
source="utils/libvdms-utils.so"))
env.Alias('install', ['install-bin', 'install-client', 'install-utils'])

SConscript(os.path.join('utils', 'SConscript'), exports=['env'])
SConscript(os.path.join('client/cpp','SConscript'), exports=['env'])

Expand Down

0 comments on commit 990af7c

Please sign in to comment.