PrincetonUniversity / cpf

Collaborative Parallelization Framework (CPF)
MIT License
31 stars 4 forks source link

Add an argument to Makefile.example to enable building debug/release version only #35

Open andreybokhanko opened 3 years ago

andreybokhanko commented 3 years ago

Right now make all from the bootstrap directory builds both debug and release builds of CPF and all the components (llvm, noelle, etc)

On my system, this quickly exhausted all the available disk quota.

Please add a makefile argument allowing to choose either debug or release configuration to build.

Yours, Andrey \=== Advanced Software Technology Lab Huawei

vgene commented 3 years ago

The whole compilation takes 31G on my machine, and most of which is used by compiling LLVM.

Currently, the framework is far from stable so compiling both DEBUG and RELEASE is still crucial for us and as you might find is pretty much hardcoded in the Makefiles. It will take some effort to decouple this and I'll put "adding argument to compile release or debug version only" as a low priority task, and we will work on it after September 2021.

As a workaround, here are the step by step guide to avoid build llvm in debug mode (saves 20.8G; will use around 10G instead of 31G to build the whole toolchain after this change).

  1. Follow the Dockerfile till apply patch (line 23)
  2. cp /home/cpf-workspace/cpf/bootstrap/Makefile.llvm /home/cpf-workspace/
  3. make -f Makefile.llvm llvm-objects-release
  4. In Makefile (copied from Makefile.example), change compile-llvm=1 to compile-llvm=0 and change both llvm-install-dir-debug and llvm-install-dir-release to /home/cpf-workspace/llvm-install-release
  5. Run make all with the modified Makefile
andreybokhanko commented 3 years ago

The whole compilation takes 31G on my machine, and most of which is used by compiling LLVM.

Currently, the framework is far from stable so compiling both DEBUG and RELEASE is still crucial for us and as you might find is pretty much hardcoded in the Makefiles. It will take some effort to decouple this and I'll put "adding argument to compile release or debug version only" as a low priority task, and we will work on it after September 2021.

OK, got it. Makes sense.

As a workaround, here are the step by step guide to avoid build llvm in debug mode (saves 20.8G; will use around 10G instead of 31G to build the whole toolchain after this change).

  1. Follow the Dockerfile till apply patch (line 23)
  2. cp /home/cpf-workspace/cpf/bootstrap/Makefile.llvm /home/cpf-workspace/
  3. make -f Makefile.llvm llvm-objects-release
  4. In Makefile (copied from Makefile.example), change compile-llvm=1 to compile-llvm=0 and change both llvm-install-dir-debug and llvm-install-dir-release to /home/cpf-workspace/llvm-install-release
  5. Run make all with the modified Makefile

Thanks!