Re: [EPx Developers] Digest for epx-developers@googlegroups.com - 1 Message in 1 Topic

31 views
Skip to first unread message

David Bosworth

unread,
Mar 27, 2013, 11:50:14 AM3/27/13
to epx-dev...@googlegroups.com
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:
     

     

You received this message because you are subscribed to the Google Group epx-developers.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.

--
You received this message because you are subscribed to the Google Groups "EPx Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to epx-developer...@googlegroups.com.
To post to this group, send email to epx-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David Bosworth

unread,
Mar 30, 2013, 9:16:50 PM3/30/13
to epx-dev...@googlegroups.com
Hello again,

I found myself on a train trip between Albuquerque and Chicago this past week, and updated my makemake.perl  to now handle automatically the construction of the sub-directories ('bin' for the executable and 'obj' for the .o and .mod file) so the necessity to insure that those directories in the energy plus source directory by hand is no longer necessary.  The 'make tidy' and 'make untidy' hack has also been removed for this more robust system.
I've also been compiling mixed C and Fortran source files into the standard EnergyPlus source code using gcc and gfortran, and this version of makemake.perl seems to handle it fine.

the link is the same as I sent before for the new makemake.perl file.

cheers
Dave
Reply all
Reply to author
Forward
0 new messages