intel-cmt-cat
                                
                                
                                
                                    intel-cmt-cat copied to clipboard
                            
                            
                            
                        API lock initialization error! while integrating with boringssl
I am trying to use boringssl with CAT.
For making things simple, first I have compiled CAT example files using following commands:
gcc -lpqos association_app.c -o assoc.x
sudo ./assoc.x
in associatoin_app.c, I used the following code:
        struct pqos_config cfg;
        int ret, exit_val = EXIT_SUCCESS;
        memset(&cfg, 0, sizeof(cfg));
        cfg.fd_log = STDOUT_FILENO;
        cfg.verbose = 0;
        cfg.interface = PQOS_INTER_OS;
        /* PQoS Initialization - Check and initialize CAT and CMT capability */
        ret = pqos_init(&cfg);
        if (ret != PQOS_RETVAL_OK) {
                printf("Error initializing PQoS library!\n");
                exit_val = EXIT_FAILURE;
        }
        ret = pqos_alloc_assoc_set(1,1);
        ret = pqos_fini();
        if (ret != PQOS_RETVAL_OK)
                printf("Error shutting down PQoS library!\n");
        return exit_val;
which worked fine for association. (I avoided the long gcc flags and linker libraries when I found using -lpqos compiles it successfully)
Then I tried to integrate this piece of code with boringssl (in aead.c). In the CMakeLists.txt, I just added -lpqos in C_CXX_FLAGS. Files compiled fine but while running, it can not initialize pqos, showing the error:
API lock initialization error!
I am running all programs from root. So what might be the issue that same piece of code is working when I am running as a single file but can not initialize pqos in my case. I also tried adding -lpthread but it remains same.