Hello,
I’ve write a grass script (https://svn.osgeo.org/grass/grass-addons/raster/r.inund.fluv/) In my grass script I use four implemented fortran codes.
Now this script is in Add_ons repository, but there isn’t a Makefile. I’ve written an install.sh script.
With Markus, we think that is good to make some changes to the MAKE system and to allow the compilation of Fortan codes.
probably is like the compilation of C codes
We wrote some lines in install.sh script (see below), but we’re sure that this can be written more elegant in make syntax.
#compile the fortran codes with GNUFORTRAN
#gfortran -O1 -o trova_alveo.exe trova_alveo.f90
#gfortran -O1 -o pulizia_inondazione.exe pulizia_inondazione.f90
#gfortran -O1 -o reticolo2d.exe reticolo2d.f90
#gfortran -O1 -o correzione_reticolo.exe correzione_reticolo.f90
# put the .exe files in the chosen directory and change the 219-222 rows of the script
Anyone may help me?
Thanks in advanced
Roberto
Robert,
I have added a (draft) Makefile to that directory. Please check.
Now you can simplify your script and call the F90 based binaries
directly like
$GISBASE/etc/fortran_code/find_main_channel
etc.
instead of (script excerpt):
rm -r -f ~/$cartella_nascosta
mkdir ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/find_main_channel.exe ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/clean_inundation.exe ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/2d_path.exe ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/correction_from_path.exe ~/$cartella_nascosta
....
cheers,
Markus
On Fri, May 2, 2008 at 5:49 PM, roberto.marzocchi
<roberto.marzocchi@gmail.com> wrote:
Hello,
I've write a grass script
(https://svn.osgeo.org/grass/grass-addons/raster/r.inund.fluv/) In my grass
script I use four implemented fortran codes.
Now this script is in Add_ons repository, but there isn't a Makefile. I've
written an install.sh script.
With Markus, we think that is good to make some changes to the MAKE system
and to allow the compilation of Fortan codes.
probably is like the compilation of C codes
We wrote some lines in install.sh script (see below), but we're sure that
this can be written more elegant in make syntax.
#compile the fortran codes with GNUFORTRAN
#gfortran -O1 -o trova_alveo.exe trova_alveo.f90
#gfortran -O1 -o pulizia_inondazione.exe
pulizia_inondazione.f90
#gfortran -O1 -o reticolo2d.exe reticolo2d.f90
#gfortran -O1 -o correzione_reticolo.exe
correzione_reticolo.f90
# put the .exe files in the chosen directory and change the
219-222 rows of the script
Anyone may help me?
Thanks in advanced
Roberto
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
--
Open Source Geospatial Foundation
http://www.osgeo.org/
http://www.grassbook.org/
Markus Neteler ha scritto:
Robert,
I have added a (draft) Makefile to that directory. Please check.
I’ve make some changes to Makefile, because before the Makefile created a uncorrect directory.
Now there is only one more problem:
the clean lines don’t remove correctly the binaries
"
clean:
-rm -f find_main_channel.exe clean_inundation.exe 2d_path.exe correction_from_path.exe dati.mod dd.mod
"
Anyone have an idea?
Now you can simplify your script and call the F90 based binaries
directly like
$GISBASE/etc/fortran_code/find_main_channel
etc.
Yes I did.
instead of (script excerpt):
rm -r -f ~/$cartella_nascosta
mkdir ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/find_main_channel.exe ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/clean_inundation.exe ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/2d_path.exe ~/$cartella_nascosta
cp "$GISBASE/fortran_code"/correction_from_path.exe ~/$cartella_nascosta
....
cheers,
Markus
Cheers
Roberto
roberto.marzocchi wrote:
I've write a grass script
(https://svn.osgeo.org/grass/grass-addons/raster/r.inund.fluv/) In my
grass script I use four implemented fortran codes.
Now this script is in Add_ons repository, but there isn't a Makefile.
I've written an install.sh script.
With Markus, we think that is good to make some changes to the MAKE
system and to allow the compilation of Fortan codes.
probably is like the compilation of C codes
We wrote some lines in install.sh script (see below), but we're sure
that this can be written more elegant in make syntax.
/ #compile the fortran codes with GNUFORTRAN
#gfortran -O1 -o trova_alveo.exe trova_alveo.f90
#gfortran -O1 -o pulizia_inondazione.exe pulizia_inondazione.f90
#gfortran -O1 -o reticolo2d.exe reticolo2d.f90
#gfortran -O1 -o correzione_reticolo.exe correzione_reticolo.f90
# put the .exe files in the chosen directory and change the
219-222 rows of the script/
Anyone may help me?
The compilation rules should be relatively straightforward; see the
rules for C and C++ files in include/Make/Rules.make.
The main thing which needs to be done is to add configure tests for a
Fortran-90 compiler. AFAICT, AC_PROG_FC is the appropriate macro.
--
Glynn Clements <glynn@gclements.plus.com>
Glynn Clements ha scritto:
roberto.marzocchi wrote:
I've write a grass script
([https://svn.osgeo.org/grass/grass-addons/raster/r.inund.fluv/](https://svn.osgeo.org/grass/grass-addons/raster/r.inund.fluv/)) In my
grass script I use four implemented fortran codes.
Now this script is in Add_ons repository, but there isn't a Makefile.
I've written an install.sh script.
With Markus, we think that is good to make some changes to the MAKE
system and to allow the compilation of Fortan codes.
probably is like the compilation of C codes
We wrote some lines in install.sh script (see below), but we're sure
that this can be written more elegant in make syntax.
/ #compile the fortran codes with GNUFORTRAN
#gfortran -O1 -o trova_alveo.exe trova_alveo.f90
#gfortran -O1 -o pulizia_inondazione.exe pulizia_inondazione.f90
#gfortran -O1 -o reticolo2d.exe reticolo2d.f90
#gfortran -O1 -o correzione_reticolo.exe correzione_reticolo.f90
# put the .exe files in the chosen directory and change the
219-222 rows of the script/
Anyone may help me?
The compilation rules should be relatively straightforward; see the
rules for C and C++ files in include/Make/Rules.make.
Yes try to understand…
The main thing which needs to be done is to add configure tests for a
Fortran-90 compiler. AFAICT, AC_PROG_FC is the appropriate macro.
I write to Markus: “Probably the file configure of GRASS source code must test the installation of GNUFortran compiler on the computer too”.
Markus wrote to me: "this is currently disabled because nobody needed it If requested, it may come back "
Probably he yet changed the configure file.
I’m not very expert…
Thanks
Roberto