The document presents PEAK (Performance Environment Autoconfiguration frameworK), a framework that helps developers and users find optimal configurations for scientific applications on HPC systems. PEAK's interface automates benchmarking of applications using different compiler, library, and environment settings. It develops a performance database to provide reference for optimal configurations to achieve speedups. The framework was tested on two HPC systems, comparing performance of applications compiled with different compilers and linked to numerical libraries including LibSci, ACML, Intel MKL, FFTW, and CRAFFT. It found default settings were not always optimal, and the framework can help select better performing configurations for applications.