When you start developing MercuryDPM applications ("Drivers"), you need a directory in which to store them. All MercuryDPM developers can create a directory to store their applications, and use git for version control. Here is how you do it:
- Open a terminal, enter the sub-folder Drivers/USER in the source directory, and copy the template USER directory into a directory named after you, e.g.
MercurySource/Drivers/
USER$ cp Template Marlin # There is
a template folder with
a TemplateDriver.cpp, CMakeLists.txt files and
a Scripts folder with
a README file
git add Marlin # This command stages the
new folder Marlin and
all the files within it
for commit.
@ USER
Definition: MercuryBase.h:64
static constexpr Eigen::internal::all_t all
Definition: IndexedViewHelper.h:86
const Scalar * a
Definition: level2_cplx_impl.h:32
- Enter your directory. If you have already written a driver code, replace the template driver with your driver and use 'git add .' to add the driver.
MercurySource/Drivers/
USER$ cd Marlin
MercurySource/Drivers/
USER/Marlin$ cp $DIRECTORY/MyFirstDriver.cpp .
MercurySource/Drivers/
USER/Marlin$ rm TemplateDriver.cpp
MercurySource/Drivers/
USER/Marlin$ git add .
If you are just starting to develop a driver, just rename the template driver to the name you want to give your driver, e.g. MercurySource/Drivers/
USER$ cd Marlin
MercurySource/Drivers/
USER/Marlin$ mv TemplateDriver.cpp MyFirstDriver.cpp
MercurySource/Drivers/
USER/Marlin$ git add .
- return to your build directory and update cmake.
MercurySource/Drivers/
USER/Marlin$ cd ../../../../MercuryBuild
MercuryBuild$ cmake .
-- Build files have been written to: /Users/Marlin/Mercury/Trunk/cmake-build-debug
Updating cmake made a make command for your driver, you can test this: MercuryBuild$ make MyFirstDriver
[100%] Built target MyFirstDriver
- then check-in your changes (after testing that all codes compile):
MercuryBuild$ make fullTest
MercuryBuild$ cd ../MercurySource
MercurySource$ git st
A + Drivers/
USER/Marlin/MyFirstDriver.cpp
D + Drivers/
USER/Marlin/TemplateDriver.cpp
MercurySource$ git commit -
m "added a USER directory named Marlin"
dominoes D
Definition: Domino.cpp:55
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
int * m
Definition: level2_cplx_impl.h:294
Now you can modify the driver code to your specific application.