Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move source dirs into flashlight dir and fix include paths (#216)
Summary: Pull Request resolved: flashlight/flashlight#216 Change project structure in the following ways: - Creating a new `flashlight` directory inside of the project root. - Moving the "flashlight core" to `flashlight/fl` - Moving `app` to `flashlight/app` - Moving `lib` to `flashlight/lib` - Moving `ext` to `flashlight/ext` - I'll change include directories throughout the project to reflect the new location -- generally, `s|#include "flashlight/flashlight|#include flashlight/fl|g`. - I won't be touching namespaces at this time. The new project structure will roughly be: ``` [project root] flashlight/ app/ ext/ lib/ fl/ nn/ modules/ Conv2D.h bindings/ cmake/ docs/ ... ``` This fixes installation issues and makes it so that the name of the directory containing the project doesn't create problems for header portability/is needed for `vcpkg`. See [this document](https://fb.quip.com/aLksAcfobRSP) for the motivation/more details. ### Command summary: flashlight core ``` hg mv deeplearning/projects/flashlight deeplearning/projects/fl mkdir deeplearning/projects/flashlight/flashlight hg mv deeplearning/projects/fl deeplearning/projects/flashlight/flashlight ``` ``` # lib hg mv deeplearning/projects/flashlight/lib deeplearning/projects/flashlight/flashlight/ hg mv deeplearning/projects/flashlight/ext deeplearning/projects/flashlight/flashlight/ hg mv deeplearning/projects/flashlight/app deeplearning/projects/flashlight/flashlight/ ``` Adjust headers: ``` find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.cuh" -o -name "*.cu" -o -name "*.hpp" \) \ | xargs sed -i 's|#include "flashlight/flashlight|#include "flashlight/fl|g' ``` Adjust `TARGETS`: ``` find . -type f -name "TARGETS" \ | xargs sed -i 's|deeplearning/projects/flashlight/flashlight|deeplearning/projects/flashlight/flashlight/fl|g' find . -type f -name "TARGETS" \ | xargs sed -i 's|deeplearning/projects/flashlight/lib|deeplearning/projects/flashlight/flashlight/lib|g' find . -type f -name "TARGETS" \ | xargs sed -i 's|deeplearning/projects/flashlight/ext|deeplearning/projects/flashlight/flashlight/ext|g' find . -type f -name "TARGETS" \ | xargs sed -i 's|deeplearning/projects/flashlight/app|deeplearning/projects/flashlight/flashlight/app|g' ``` Fix include directories in targets: ``` find . -type f -name "TARGETS" \ | xargs sed -i 's|"-Ideeplearning/projects/"|"-Ideeplearning/projects/flashlight"|g' ``` Reviewed By: syhw, tlikhomanenko Differential Revision: D24634434 fbshipit-source-id: d8bbfb2cdfedeaf68754bb38109efd4822e20fc7
- Loading branch information