1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
.. _compiling:
Compiling
=========
Install build dependencies
--------------------------
SL6/CentOS7
~~~~~~~~~~~
::
sudo yum install openssl-devel libxml2-devel gsoap-devel \
doxygen cmake abi-compliance-checker
Ubuntu
~~~~~~
::
sudo apt-get install abi-compliance-checker cmake debhelper doxygen \
gsoap libgridsite-dev libssl-dev libxml2-dev pkg-config
How to build
------------
Here is how to do a simple build of davix - have a look at the next section if you need to tweak some configuration option in cmake. ::
git clone https://github.com/cern-fts/davix.git
cd davix
git submodule update --recursive --init
mkdir build && cd build
cmake ..
make
Build options
-------------
Unit tests
~~~~~~~~~~
You can run the tests with ``make test``.
Functional tests
~~~~~~~~~~~~~~~~
Running functional tests requires authentication credentials, so they are not enabled by default. As a first step,
add ``-DFUNCTIONAL_TESTS=TRUE`` to cmake.
You will see that davix no longer compiles - it expects to find the file ``credentials/creds.cmake``. This
is the file which orchestrates which functional tests are run.
Here is an example - this is the file which runs our nightly build functional tests.
Passwords were removed for obvious reasons. ::
### tests using a proxy
test_with_proxy("davs://dpmhead-rc.cern.ch/dpm/cern.ch/home/dteam/davix-tests")
test_with_proxy("davs://prometheus.desy.de/VOs/dteam/davix-tests")
### AWS S3
set(accesskey xxx)
set(secretkey xxx)
set(url https://some-bucket.s3.amazonaws.com/davix-tests)
set(alt https://s3-ap-southeast-2.amazonaws.com/some-bucket/davix-tests)
set(region ap-southeast-2)
# test v2
test_s3(${accesskey} ${secretkey} ${url} "" noalt)
test_s3(${accesskey} ${secretkey} ${alt} "" alt)
# test v4
test_s3(${accesskey} ${secretkey} ${url} ${region} noalt)
test_s3(${accesskey} ${secretkey} ${alt} ${region} alt)
### CERN ceph
set(accesskey xxx)
set(secretkey xxx)
set(url s3s://some-bucket.cs3.cern.ch/davix-tests)
test_s3(${accesskey} ${secretkey} ${url} "" noalt)
### Azure
set(azurekey xxx)
set(url https://some-user.blob.core.windows.net/some-bucket/davix-tests)
test_azure(${azurekey} ${url})
Since this file contains sensitive information, access to it should be restricted and it should *never*
be committed to the source repository.
The ``test_with_proxy`` function uses the default grid-style proxy, ``/tmp/x509_u$uid``. It should be
generated beforehand.
To run the tests automatically, use the script under ``test/run-tests.sh``. This script further
expects the existence of ``credentials/obtain-proxy.sh``, which is run to generate a proxy
without any user intervention. Here is an example: ::
#!/usr/bin/env bash
echo "certificate_password_goes_here" | voms-proxy-init --cert $PWD/credentials/cert.p12 -pwstdin --voms dteam
Using ``test/run-tests.sh``, you can run automatic functional tests in jenkins, for example.
Generating the documentation
----------------------------
We use doxygen for the API documentation and sphinx for this how-to guide. Run ``make doc`` to generate both.
|