MySQL can't import a custom library for udf
The issue has been solved by:

removing the -c option from the gcc command line and adding the -fPIC option at the end, turning the command line into:

gcc -Wall -I/usr/local/include -shared -o libcompress_sequence.so compress_sequence.c -fPIC


The -c option removed the linking, which is not wished here since the library is compiled in one step. So removing the -c option tells to gcc to make the linking with the libraries included in the C file. But then gcc didn't compile anymore, and complained about the option -fPIC missing. I added it and gcc compiled.

Then MySQL complained about not being able to detect the function COMPRESS_PROTEIN_SEQUENCE in my library. So I put it in small letters: compress_protein_sequence, as the function is named into my C code, then MySQL imported the library. The actual MySQL command is the following:

CREATE FUNCTION compress_protein_sequence RETURNS STRING SONAME 'libcompress_sequence.so';


I am now able to use the MySQL function COMPRESS_PROTEIN_SEQUENCE.