Updated build script to support the papi build option.