building mads shared library