[parsec-users] Trouble compiling ferret

James Paton paton at cs.wisc.edu
Mon Oct 31 09:51:15 EDT 2011

Thanks so much! I was able to get ferret to compile using your advice. The place to put the option is in config/gcc.bldconf in the variable CFLAGS. This will, of course, alter the builds for all the programs. You might be able to edit /pkgs/apps/ferret/parsec/gcc.bldconf instead to override it for just ferret.

-- Jim

On Oct 29, 2011, at 1:58 AM, Joseph Greathouse wrote:

> This is an issue with newer versions of GCC, where a combination of loop unrolling, loop unswitching (which is enabled by O3), and strict aliasing rules (enabled by O2) send the compiler off into la-la land for decorate.c.
> This file has a large number of nested loops, each with multiple if() statements at the lowest level that could be unswitched. This happens (ballooning up code paths), then GCC tries to unroll them (further ballooning code), and there you go.
> Passing "--param max-unswitch-level=2" in while trying to compile decorate.c should get it to compile in a shorter amount of time. I haven't looked into how to add this into the build scripts yet, so feel free to respond with directions if it works. :)
> -Joe
> On 10/29/2011 2:35 AM, James Paton wrote:
>> I am having trouble compiling ferret. Specifically, the compile process seems to stall on imagick/decorate.c. The last line in the make output is:
>> /bin/sh ./libtool --silent --tag=CC   --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I. -I./magick -I./wand -I/u/p/a/paton/PARSEC/parsec-2.1/pkgs/libs/imagick/src  -I./ltdl -I/u/p/a/paton/PARSEC/parsec-2.1/pkgs/libs/imagick/src/ltdl    -O5 -m64 -funroll-loops -fprefetch-loop-arrays /u/p/a/paton/dthreads-lib/libdthread.so -static-libgcc -Wl,--hash-style=both,--as-needed -DPARSEC_VERSION=2.1 -Wall -W -MT magick/magick_libMagick_la-decorate.lo -MD -MP -MF magick/.deps/magick_libMagick_la-decorate.Tpo -c -o magick/magick_libMagick_la-decorate.lo `test -f 'magick/decorate.c' || echo '/u/p/a/paton/PARSEC/parsec-2.1/pkgs/libs/imagick/src/'`magick/decorate.c
>> [After that, the process just hangs at about 100% CPU and the memory used by cc1 gradually increases. I also found this post https://lists.cs.princeton.edu/pipermail/parsec-users/2011-July/001158.html but it doesn't have an answer yet, so I thought I'd send out another message to see if anyone has the solution. Below is some more output from the build process:
>> ImageMagick is configured as follows. Please verify that this configuration
>> matches your expectations.
>> Host system type : x86_64-unknown-linux-gnu
>>                   Option                        Value
>> -------------------------------------------------------------------------------
>> Shared libraries  --enable-shared=no            no
>> Static libraries  --enable-static=yes           yes
>> Module support    --with-modules=no             no
>> GNU ld            --with-gnu-ld=yes             yes
>> Quantum depth     --with-quantum-depth=16       16
>> High Dynamic Range Imagery
>>                   --enable-hdri=no              no
>> Delegate Configuration:
>> BZLIB             --with-bzlib=no               no
>> DJVU              --with-djvu=no                no
>> DPS               --with-dps=no         no
>> FlashPIX          --with-fpx=no         no
>> FontConfig        --with-fontconfig=no          no
>> FreeType          --with-freetype=no            no
>> GhostPCL          None                          pcl6 (unknown)
>> Ghostscript       None                          gs (8.70)
>> result_ghostscript_font_dir='none'
>> Ghostscript fonts --with-gs-font-dir=default
>> Ghostscript lib   --with-gslib=no               no
>> Graphviz          --with-gvc=no
>> JBIG              --with-jbig=no                no
>> JPEG v1           --with-jpeg=yes               yes
>> JPEG-2000         --with-jp2=no         no
>> LCMS              --with-lcms=no                no
>> Magick++          --with-magick-plus-plus=no    no
>> OpenEXR           --with-openexr=no             no
>> PERL              --with-perl=no                no
>> PNG               --with-png=no         no
>> RSVG              --with-rsvg=no                no
>> TIFF              --with-tiff=no                no
>> result_windows_font_dir='none'
>> Windows fonts     --with-windows-font-dir=
>> WMF               --with-wmf=no         no
>> X11               --with-x=no                   no
>> XML               --with-xml=no         no
>> ZLIB              --with-zlib=no                no
>> X11 Configuration:
>>       X_CFLAGS        =
>>       X_PRE_LIBS      =
>>       X_LIBS          =
>>       X_EXTRA_LIBS    =
>> Options used to compile and link:
>>   PREFIX          = /u/p/a/paton/PARSEC/parsec-2.1/pkgs/libs/imagick/inst/amd64-linux.gcc-dthreads
>>   EXEC-PREFIX     = /u/p/a/paton/PARSEC/parsec-2.1/pkgs/libs/imagick/inst/amd64-linux.gcc-dthreads
>>   VERSION         = 6.3.6
>>   CC              = /usr/bin/gcc
>>   CFLAGS          = -O5 -m64 -funroll-loops -fprefetch-loop-arrays /u/p/a/paton/dthreads-lib/libdthread.so -static-libgcc -Wl,--hash-style=both,--as-needed -march=native -DPARSEC_VERSION=2.1 -Wall -W
>>   MAGICK_CFLAGS   = -O5 -m64 -funroll-loops -fprefetch-loop-arrays /u/p/a/paton/dthreads-lib/libdthread.so -static-libgcc -Wl,--hash-style=both,--as-needed -march=native -DPARSEC_VERSION=2.1 -Wall -W
>>   CPPFLAGS        = -I/u/p/a/paton/PARSEC/parsec-2.1/pkgs/libs/imagick/inst/amd64-linux.gcc-dthreads/include
>>   PCFLAGS         =
>>   DEFS            = -DHAVE_CONFIG_H
>>   LDFLAGS         = -L/usr/lib64 -L/usr/lib
>>   MAGICK_LDFLAGS  = -L/u/p/a/paton/PARSEC/parsec-2.1/pkgs/libs/imagick/inst/amd64-linux.gcc-dthreads/lib -L/usr/lib64 -L/usr/lib
>>   LIBS            = -lMagick -ljpeg -lm -lpthread
>>   CXX             = /usr/bin/g++
>>   CXXFLAGS        = -O5 -m64 -funroll-loops -fprefetch-loop-arrays -fpermissive -fno-exceptions /u/p/a/paton/dthreads-lib/libdthread.so -static-libgcc -Wl,--hash-style=both,--as-needed -march=native -DPARSEC_VERSION=2.1 -Wall -W
>> Thank you for your assistance.
>> -- Jim Paton
>> _______________________________________________
>> parsec-users mailing list
>> parsec-users at lists.cs.princeton.edu
>> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users

More information about the parsec-users mailing list