Synthesis of porous materials