Open Hakimo2 opened 3 years ago
What you are trying to do there isn't directly related to the Fortran Template library. You made your own template (the task.F90_template file) and are now trying to instantiate for integers and reals. The FTL is a collection of ready made templates, that you can use as they are. It provides templates for commonly used things like dynamically sized arrays, dictionaries, and other popular containers. But you are not using any of those templates, and instead making your own. That is perfectly fine of course, and you can probably draw some inspiration from how the FTL does things for your own templates.
The code you pasted looks pretty much correct to me. Just skip all the FTL related things like "-lftl" and such. If you want to see the preprocessed source code your template instantiations have generated, the "-E" flag of gfortran is quite useful. Try "gfortran -cpp -E tasksf90". That should show you the source code of the instantiations of the "task" function template for integers and reals.
I'm trying to use the Fortran template library as show here. I don't know if there's some needed installation in order to use it. Should I download the zip file ? I created a file called task.F90_template as shown in the link and it contains:
I don't understand also where to instantiate the template manually using the C preprocessor
I want also to ask about the extension of the file tasks.F90_template since it doesn't get automatically colored.
This is the makefile I am using to compile my code:
I am a little bit lost.