1 /**
2  * Copyright (C) Mellanox Technologies Ltd. 2019.  ALL RIGHTS RESERVED.
3  *
4  * See file LICENSE for terms.
5  */
6 
7 #ifdef HAVE_CONFIG_H
8 #  include "config.h"
9 #endif
10 
11 #include <ucp/api/ucp.h>
12 #include <dlfcn.h>
13 #include <stdio.h>
14 
15 
main(int argc,char ** argv)16 int main(int argc, char **argv)
17 {
18     ucp_params_t params;
19     ucs_status_t status;
20     ucp_context_h context;
21 
22     params.field_mask = UCP_PARAM_FIELD_FEATURES;
23     params.features   = UCP_FEATURE_TAG;
24 
25     status = ucp_init(&params, NULL, &context);
26     if (status != UCS_OK) {
27         return -1;
28     }
29 
30     /* This could segfault if libucm_cuda.so is marked as linker nodelete but
31      * could not be loaded due to libcuda dependency, because of a corrupted
32      * link_map in the program.
33      */
34     dlopen("libgcc_s.so.1", RTLD_LAZY);
35 
36     ucp_cleanup(context);
37 
38     printf("SUCCESS\n");
39     return 0;
40 }
41 
42