Compilable version of adding ports