Compilation method modified to flatten library.