Error while compiling with gfortran

1,203 views
Skip to first unread message

Haythem

unread,
May 3, 2012, 7:47:59 AM5/3/12
to tango-...@googlegroups.com
Hello everybody,

I tried to compile igenpack with gfortran on Linux and I got a lot of errors.
I didn't touch the code, I just compiled it, and I obtain this:

trafalgar@trafalgar:~/Documents/igenpack$ ./compile.sh
algencanma.f:11.72:

      integer probid,nrec,r,ncir,                                      
                                                                        1
Error: Invalid character in name at (1)
COMPILATION ERROR
OptionsReader.f95:35.28:

       (/ 'BEST_BOUND_RULE','BREADTH_FIRST','DEPTH_FIRST','SWITCH_DF_BBR' /)
                            1
Error: Different CHARACTER lengths (15/13) in array constructor at (1)
OptionsReader.f95:42.31:

       (/ 'LOWEST_INDEX_FIRST','MOST_FRACTIONAL','RANDOM_VARIABLE', &
                               1
Error: Different CHARACTER lengths (18/15) in array constructor at (1)
OptionsReader.f95:50.26:

       (/ 'BEST_FEASIBLE','FIRST_FEASIBLE' /)
                          1
Error: Different CHARACTER lengths (13/14) in array constructor at (1)
OptionsReader.f95:57.19:

       (/ 'GENCAN','ASA' /)
                   1
Error: Different CHARACTER lengths (6/3) in array constructor at (1)
OptionsReader.f95:474.26:

       if(value .eq. trim(BOX_CONSTRAINED_SOLVERS_STRINGS(i))) then
                          1
Error: Function 'box_constrained_solvers_strings' at (1) has no IMPLICIT type
OptionsReader.f95:472.50:

    do i = 1, size(BOX_CONSTRAINED_SOLVERS_STRINGS)
                                                  1
Error: Symbol 'box_constrained_solvers_strings' at (1) has no IMPLICIT type
OptionsReader.f95:443.26:

       if(value .eq. trim(MULTI_START_STRINGS(i))) then
                          1
Error: Function 'multi_start_strings' at (1) has no IMPLICIT type
OptionsReader.f95:441.38:

    do i = 1, size(MULTI_START_STRINGS)
                                      1
Error: Symbol 'multi_start_strings' at (1) has no IMPLICIT type
OptionsReader.f95:412.26:

       if(value .eq. trim(BRANCHING_RULE_STRINGS(i))) then
                          1
Error: Function 'branching_rule_strings' at (1) has no IMPLICIT type
OptionsReader.f95:410.41:

    do i = 1, size(BRANCHING_RULE_STRINGS)
                                         1
Error: Symbol 'branching_rule_strings' at (1) has no IMPLICIT type
OptionsReader.f95:381.26:

       if(value .eq. trim(NODE_SELECTION_STRINGS(i))) then
                          1
Error: Function 'node_selection_strings' at (1) has no IMPLICIT type
OptionsReader.f95:379.41:

    do i = 1, size(NODE_SELECTION_STRINGS)
                                         1
Error: Symbol 'node_selection_strings' at (1) has no IMPLICIT type
OptionsReader.f95:202.39:

             write(*,300) trim(adjustl(NODE_SELECTION_STRINGS(i)))
                                       1
Error: Function 'node_selection_strings' at (1) has no IMPLICIT type
OptionsReader.f95:201.46:

          do i = 1,size(NODE_SELECTION_STRINGS)
                                              1
Error: Symbol 'node_selection_strings' at (1) has no IMPLICIT type
OptionsReader.f95:221.39:

             write(*,300) trim(adjustl(BRANCHING_RULE_STRINGS(i)))
                                       1
Error: Function 'branching_rule_strings' at (1) has no IMPLICIT type
OptionsReader.f95:220.46:

          do i = 1,size(BRANCHING_RULE_STRINGS)
                                              1
Error: Symbol 'branching_rule_strings' at (1) has no IMPLICIT type
OptionsReader.f95:240.39:

             write(*,300) trim(adjustl(MULTI_START_STRINGS(i)))
                                       1
Error: Function 'multi_start_strings' at (1) has no IMPLICIT type
OptionsReader.f95:239.43:

          do i = 1,size(MULTI_START_STRINGS)
                                           1
Error: Symbol 'multi_start_strings' at (1) has no IMPLICIT type
OptionsReader.f95:306.39:

             write(*,300) trim(adjustl(BOX_CONSTRAINED_SOLVERS_STRINGS(i)))
                                       1
Error: Function 'box_constrained_solvers_strings' at (1) has no IMPLICIT type
OptionsReader.f95:305.55:

          do i = 1,size(BOX_CONSTRAINED_SOLVERS_STRINGS)
                                                       1
Error: Symbol 'box_constrained_solvers_strings' at (1) has no IMPLICIT type
Problems.f95: In function ‘createproblem’:
Problems.f95:80: warning: ‘p.geninfofather’ may be used uninitialized in this function
Problems.f95:80: warning: ‘p.geninfo’ may be used uninitialized in this function
MINLP.f95:7.19:

  use OptionsReader
                   1
Fatal Error: Can't open module file 'optionsreader.mod' for reading at (1):
No such file or directory
COMPILATION ERROR
gfortran: algencanma.o:
No such file or directory
gfortran: OptionsReader.o: No such file or directory
gfortran: MINLP.o: No such file or directory
COMPILATION ERROR

Can someone help me to solve this problem?

Thanks a lot,
Haythem


Ernesto G. Birgin

unread,
May 3, 2012, 1:28:53 PM5/3/12
to tango-...@googlegroups.com
Dear Haythem,

Thank you very much for your interest in our work.

The errors you reported were related to a lack of compatibility of the current version of gfortran with the one used at the time igenpack was developed.

A new version of igenpack was delivered that can be safely compiled with the current version of gfortran.

I hope it helps.

Regards,
Ernesto.

Haythem

unread,
May 4, 2012, 10:05:28 AM5/4/12
to tango-...@googlegroups.com

Thank you Ernesto,

I thought I was using the latest version, which I downloaded from here: http://www.ime.usp.br/~egbirgin/sources/igenpack/
Where can I find this new version of igenpack?


Best regards,
Haythem


Rafael D. Lobato

unread,
May 4, 2012, 4:44:47 PM5/4/12
to tango-...@googlegroups.com
Dear Haythem:

You can find the new version at http://www.ime.usp.br/~egbirgin/sources/igenpack/. We have just updated the code.

Sincerely,
Rafael

Rafael D. Lobato

unread,
May 7, 2012, 5:34:27 PM5/7/12
to tango-...@googlegroups.com
Dear Haythem:

I assume that the region where you want to pack the photovoltaic
panels is S = {(x,y) | g(x,y) <= 0}, where

g(x,y) = (x^2 + y^2)^2 - 55x^3 - 17xy^2.

Notice that your derivative of g with respect to y is wrong. It should
be

dwdp2(1) = 4.0d0 * p(2) * (p(1) ** 2.0d0 + p(2) ** 2.0d0) - &
           34.0d0 * p(1) * p(2)

instead of

dwdp2(1) = 4.0d0 * p(2) * (p(1) ** 2.0d0 + p(2) ** 2.0d0) - &
           55.0d0 * p(1) ** 3.0d0 - 34.0d0 * p(1) * p(2)

Moreover, the values you have chosen for xmin and ymin are wrong. The
values xmin, xmax, ymin and ymax should define a region

R ={(x,y) | xmin <= x <= xmax, ymin <= y <= ymax}

such that S is contained in R. Therefore, a possible choice for these
values is

xmin =   0.0d0
xmax =  55.0d0
ymin = -20.0d0
ymax =  20.0d0

Furthermore, you must change the subroutine drawsol() in order to draw
the region defined by S. The variable "scale" you will find while
adapting this subroutine to your problem can be set to 0.25d0, for
example.

Sincerely,
Rafael

> Hello Rafael,
>
> I'm Haythem, I was in touch with Ernesto about igenpack algorithm.
>
> I have a roof with an oval shape (55m=major axe and 38 m=minor axe), this
> roof has to be covered with photovoltaic panels.
> I need to know the maximum number of panels, that can be installed and the
> configuration.
>
> So the equation of the shape is this one: (x²+y²)²=55.x³+17*x*y²
> Dimensions of photovoltaic panels: 5.2m*0.5m
>
> I made the following changes in the code:
>
> Evalw:
>
>      else if ( probid .eq. 7 ) then
>
>          w(1) = (p(1) ** 2.0d0 + p(2) ** 2.0d0) ** 2.0d0 - 55.0d0 * p(1) **
> 3.0d0 - &
>                 17*p(1)*p(2)**2
>
> Evaldw:
>
>       else if ( probid .eq. 7 ) then
>
>          dwdp1(1) =   4.0d0 * p(1) * (p(1) ** 2.0d0 + p(2) ** 2.0d0) - &
>               165.0d0 * p(1) ** 2.0d0 - 17.0d0 * p(2) ** 2.0d0
>
>          dwdp2(1) =   4.0d0 * p(2) * (p(1) ** 2.0d0 + p(2) ** 2.0d0) - &
>               55.0d0 * p(1) ** 3.0d0 - 34.0d0 * p(1) * p(2)
>
> defpro
>
>       else if ( probid .eq. 7 ) then
>
>          dx = 0.5d0 * 5.2d0
>          dy = 0.5d0 * 0.5d0
>
>          lx = - 40.0d+99
>          ux =   40.0d+99
>          ly = - 20.0d+99
>          uy =   20.0d+99
>
>          xmin = 0.0d0
>          xmax = 40.0d0
>          ymin = 0.0d0
>          ymax = 60.0d0
>
>          r = 1
>
> Ernesto told me the values of lx, ux, ... were wrong.
> I can only pack 5 rectangles... You'll find the drawing solution
>
> I can't draw the oval too.
>
> Can you please help me solving these problems?
>
>
> Thanks,
> Best regards

>

On Friday, May 4, 2012 11:05:28 AM UTC-3, Haythem wrote:

Haythem

unread,
May 9, 2012, 8:00:51 AM5/9/12
to tango-...@googlegroups.com
Thank you Rafael and Ernesto!
It works well now!

Haythem

Rafael D. Lobato

unread,
May 9, 2012, 12:48:01 PM5/9/12
to tango-...@googlegroups.com
Dear Haythem:

You could also try the method described in

E. G. Birgin, J. M. Martínez, F. H. Nishihara and D. P. Ronconi,
"Orthogonal packing of rectangular items within arbitrary convex
regions by nonlinear optimization", Computers & Operations Research
33, pp. 3535-3548, 2006.

This method considers only 90-degree rotations of each rectangle and
its implementation is available at

http://www.ime.usp.br/~egbirgin/sources/genpack-rectangles/

All you have to do is to modify the file genpack.f in the same way you
modified file Packing.f95.

Sincerely,
Rafael
Reply all
Reply to author
Forward
0 new messages