Posts

Showing posts with the label C

Add Valgrind to CLion

Image
Valgrind is an open-source memory debugger and you can use throught CLion (C IDE). I found this site where they show step by step how to add valgrim as external application to CLion. But... some mistakes that you could eventually find: 1.- You must install clang and obiously valgring: sudo apt-get install clang valgrind 2.- Modify the path to valgrim in valgrim.sh. Replace /usr/local/bin/valgrim by /usr/bin/valgrim 3.- You can find external tools configuration on:  File/Settings.../Tools/External Tools 4.- If you want the real icon to put it on toolbar, follow these commands: wget  http://support.dotriver.eu/lib/exe/fetch.php?cache=&w=64&h=64&tok=54e00f&media=presentation_des_logiciels:logo_valgrind.png convert logo_valgrind.png -resize 16x16 logo.png Now you can choose it to your toolbar If you run your code and you got no errors but suppressed errors, don't be afraid: You can see sup...

How to create a C project with CLion

If you create a new project on CLion, it will be a C++ project. If you want a C project, for the moment (2 years ago that users are asking the same to JetBrains here ) you will need to edit CMakeLists.txt file: replace: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES main.cpp) by: set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") set(SOURCE_FILES main.c) Now, rename your main.cpp to main.c Enjoy it! Remember CLion (Jetbrains suite) it's free for students Free for students: Professional developer tools from JetBrains https://t.co/L8bxXBhwXA — NicolĆ”s Boettcher (@nicoboettcher) October 4, 2016 I enjoy student life @clion_ide pic.twitter.com/CxMNoW6cmg — NicolĆ”s Boettcher (@nicoboettcher) October 4, 2016

Intel AES New Instructions (AESNI) libraries for C on Ubuntu

Image
First, you need to check if your CPU is compatible with hardware accelerated Intel technology for cipher/decrypt with AES. Next, we need to download the Intel AESNI library and compile it: wget https://software.intel.com/sites/default/files/article/181731/intel-aesni-sample-library-v1.2.zip unzip intel-aesni-sample-library-v1.2.zip cd Intel_AESNI_Sample_Library_v1.2 ./mk_lnx64_all.sh Maybe, you will get the following errror: collect2: error: ld returned 1 exit status Got error on link If you get it, please install yasm sudo apt-get install yasm Now, compile it again: ./mk_lnx64.sh      ~/Downloads/Intel_AESNI_Sample_Library_v1.2/aes_example ~/Downloads/Intel_AESNI_Sample_Library_v1.2/aes_example ~/Downloads/Intel_AESNI_Sample_Library_v1.2/intel_aes_lib ~/Downloads/Intel_AESNI_Sample_Library_v1.2/intel_aes_lib do iaesx64.s do do_rdtsc.s ~/Downloads/Intel_AESNI_Sample_Library_v1.2/intel_aes_lib ~/Downloads/Intel_AESN...