Hello.
There have been a number of questions lately about compiling EnergyPlus. I know that Peter and Neil and the gang are in the process of putting together a really nice document, but until them I can share what I have been using. Its a small perl script called makemake (originally developed by Michael Wester). Makemake simply reads through the fortran and c files in a directory, finds all the dependencies, and builds a make file, which can then be used by the GNU MAKE routines on pretty much all UNIX systems (not sure if this comes in the standard Windows packages, but you can get it
here).
Here, is a link to the makemake file I have been
using. The first thing to note is that you need to confirm that your
path to perl is the same as the first line (I use 'which perl' on a
terminal to get the path easily).
The most interesting section is in defining the common macros (see 'Flag Description Notes') where the compiler flags are set. I added some notes about compiler
flags that I find useful, but the documentation of
the gfortan compiler flags (
here) is really helpful.
Once you understand the basic structure, it is easily tweaked to suit your needs.
USE:
place
the makemake file in the same directory as the source code. Add two
new folders to the directory with your source code - one named 'bin' and
one named 'obj'. open a terminal and cd to that directory. 'perl
makemake.perl energyplus' will run makemake and produce the makefile in
the same directory. The argument to the makemake script('energyplus' in
this case) declares what you want the final executable to be called.
Then, a call to 'make' in the same directory compiles the project
(typically a good wait is involved). I added a little hack called 'make tidy' which moves all of the .o and .mod files to the obj directory and a 'make untidy' which moves them back to the source directory for re-compilation. I know there is a means to write sub-directory dependencies into the make file, and I am hoping to add that feature shortly. If anyone is well versed in make files, I would love to ask some questions.
I am still experimenting with it, so any feedback would be greatly appreciated.
cheers
Dave
David Bosworth
BUILDlab LLC
Dryden NY
On Tue, Mar 26, 2013 at 11:12 PM,
<epx-dev...@googlegroups.com> wrote:
Group: http://groups.google.com/group/epx-developers/topics
Maathangi Sankar <maas...@gmail.com> Mar 26 01:40AM -0700
Hi Peter,
This is Maathangi. I have recently started to use Energyplus, and am hoping
to use the Fortran source codes for customization as per my
requirements. Was wondering if you have a tutorial for compiling this on a
freeware like gfortran?
Thanks!
On Thursday, March 21, 2013 3:23:59 PM UTC+5:30, Kiyonori Matsui wrote: