Add your project to the demos folder
If you add a new feature to SciCell++ we encourage you to
create_a_tutorial and a demo showing these new features. Here
we detail the process to include your project as part of the demos of
SciCell++. We divide this process in two parts, the first one guides
you to create your folder and your validation files, the second part
shows you how to configure the SciCell++ to build and execute your
demo. In both sections we suppose that your demo is called
demo_sophy.
Create your demo and validation folder for your demo
The initial steps to include your demo as part of SciCell++ involve create a folder in the SciCell++ demos folder structure and to generate the validation files.
Execute your project and save its output into a file. We encorage you to execute it using single and double precision so that we have two different outputs. The files that you generate should be named:
validate_demo_sophy.datfor the single precision generated output.validate_double_demo_sophy.datfor the double precision generated output.
Create a new folder into the
demosfolder structure. Use a name that captures the intent of your project.mkdir <your-folder-name>
Add the following line at the end of the
CMakeLists.txtfile that lives at the same level of the folder that you created:ADD_SUBDIRECTORY(your-folder-name)
Step into your demo folder and create a folder called
validate.Copy the two output files (or copy all of them if you have more than two) generated at step 1 into the
validatefolder.
Configure SciCell++ to build and execute your demo
Once you have created your folder and copied the validation files there you are ready to configure SciCell++ to build and execute your demo.
Copy the source code for your project into your demo folder, in this case we suppose that the source code for your project is the file
demo_sophy.cpp.Copy the
CMakeLists.txt.demo_templatefrom the/tools/folder into your demo folder. Rename this file asCMakeLists.txt.Change the content of the
CMakeLists.txtfile as follow:Change all the instances of the tag
SRC_demo_johnfor your own tag to identify your source code. For example:SRC_demo_sophy.Change all the instances of
demo_john.cppfor the name of your source code file. For example:demo_sophy.cpp.Change all the instances of
demo_john, this will be the name of your executable and the name you need to type at the terminal to compile your project. For example:demo_sophy.Change all the instances of the tag
LIB_demo_johnfor your own tag to identify libraries required for your code. For example:LIB_demo_sophy.Include the modules you need. In the template we only include the
general_liband theproblem_libmodules. Check the modules document for the full list of module and their details.
In the same file perform the following changes in the
Test section.Change all the instances of
TEST_demo_john_runby the name of your demo. For example:TEST_demo_sophy_run.Important
Make sure to keep the
TESTand_runprefix and postfix, respectively.Change all the instances of
demo_johnwith the name of your demo. For example:demo_sophy.Change all the instances of
VALIDATE_FILENAME_demo_johnwith the name of your tag for the validation file. For example:VALIDATE_FILENAME_demo_sophy.Change the name of the validation file
validate_double_demo_john.datby yours. Recall that this file should store the output of your project executed using double precision. For example:validate_double_demo_sophy.dat.Change the name of the validation file
validate_demo_john.datby yours. Recall that this file should store the output of your project executed using single double precision. For example:validate_demo_sophy.dat.Change all instances of
TEST_demo_john_check_outputwith the name of your demo. For example:TEST_demo_sophy_check_output.
Important
Make sure to keep the
TESTand_outputprefix and postfix, respectively.Make sure that the computations of your demo are stored in an output file. If the file that you generate is called differently than
output_test.datthen modify any instance of that name in theCMakeLists.txtfile.Go to the root folder of SciCell++ and execute the
./autogen.shscript and enable the execution of the demos. If you find errors please make sure you correctly changed all the tags indicated in the previous steps. Your project should be automatically built, executed and validated.