dragonegg polly support broken?

Duncan,
    Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
with...

GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"

The resulting dragonegg plugin works fine as...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c

but if I try to invoke polly with...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c

I get the error...

cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'

Clang gets a little further with...

clang -Xclang -load -Xclang /sw/opt/llvm-3.2/lib/LLVMPolly.dylib -O3 -mllvm -polly himenoBMTxpa.c
error: unable to load plugin '/sw/opt/llvm-3.2/lib/LLVMPolly.dylib': 'dlopen(/sw/opt/llvm-3.2/lib/LLVMPolly.dylib, 9): Symbol not found:
      __ZN4llvm10DataLayout2IDE
  Referenced from: /sw/opt/llvm-3.2/lib/LLVMPolly.dylib
  Expected in: flat namespace
in /sw/opt/llvm-3.2/lib/LLVMPolly.dylib'
clang (LLVM option parsing): Unknown command line argument '-polly'. Try: 'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Did you mean '-help'?

This is with llvm/clang/compiler-rt/polly/dragonegg all from svn 166382.
                 Jack

Duncan,
     Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
with...

GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"

The resulting dragonegg plugin works fine as...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c

but if I try to invoke polly with...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c

>

I get the error...

cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'

I think the website is wrong. You probably need to add a '-' before the 'load'. See the following:

"-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"

Please let me know if this works, such that I can update the website.

Clang gets a little further with...

clang -Xclang -load -Xclang /sw/opt/llvm-3.2/lib/LLVMPolly.dylib -O3 -mllvm -polly himenoBMTxpa.c
error: unable to load plugin '/sw/opt/llvm-3.2/lib/LLVMPolly.dylib': 'dlopen(/sw/opt/llvm-3.2/lib/LLVMPolly.dylib, 9): Symbol not found:
       __ZN4llvm10DataLayout2IDE
   Referenced from: /sw/opt/llvm-3.2/lib/LLVMPolly.dylib
   Expected in: flat namespace
  in /sw/opt/llvm-3.2/lib/LLVMPolly.dylib'
clang (LLVM option parsing): Unknown command line argument '-polly'. Try: 'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Did you mean '-help'?

This is with llvm/clang/compiler-rt/polly/dragonegg all from svn 166382.

As you realized yourself, Polly and clang need to be in sync. Otherwise incompatible symbols cause problems.

Tobi

Duncan,
     Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
with...

GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"

The resulting dragonegg plugin works fine as...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c

but if I try to invoke polly with...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c

>

I get the error...

cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'

I think the website is wrong. You probably need to add a '-' before the
'load'. See the following:

"-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"

Please let me know if this works, such that I can update the website.

Tobias,
   This solves the previous problem but exposes another...

[MacBookPro:~] howarth% /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c -v
Using built-in specs.
COLLECT_GCC=/sw/lib/gcc4.7/bin/gcc-4
COLLECT_LTO_WRAPPER=/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ../gcc-4.7.2/configure --prefix=/sw --prefix=/sw/lib/gcc4.7 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.7/info --enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.7 --enable-cloog-backend=isl
Thread model: posix
gcc version 4.7.2 (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-fplugin=/sw/lib/gcc4.7/lib/dragonegg.so' '-O3' '-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib' '-v' '-mtune=core2'
/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1 -quiet -v -iplugindir=/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/plugin -D__DYNAMIC__ himenoBMTxpa.c -iplugindir=/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/plugin -fPIC -quiet -dumpbase himenoBMTxpa.c -mmacosx-version-min=10.7.4 -mtune=core2 -auxbase himenoBMTxpa -O3 -version -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib -o /var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccfQ1CgD.s
GNU C (GCC) version 4.7.2 (x86_64-apple-darwin11.4.2)
  compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Versions of loaded plugins:
dragonegg: 3.2svn
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../../../x86_64-apple-darwin11.4.2/include"
#include "..." search starts here:
#include <...> search starts here:
/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/include
/sw/lib/gcc4.7/include
/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
End of search list.
GNU C (GCC) version 4.7.2 (x86_64-apple-darwin11.4.2)
  compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Versions of loaded plugins:
dragonegg: 3.2svn
Compiler executable checksum: d413f6ce20b86abf66faf4823487889a
himenoBMTxpa.c: In function ‘main’:
himenoBMTxpa.c:79:5: warning: incompatible implicit declaration of built-in function ‘strcpy’ [enabled by default]
himenoBMTxpa.c: In function ‘set_param’:
himenoBMTxpa.c:226:5: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
himenoBMTxpa.c: In function ‘newMat’:
himenoBMTxpa.c:239:5: warning: incompatible implicit declaration of built-in function ‘malloc’ [enabled by default]
himenoBMTxpa.c: In function ‘clearMat’:
himenoBMTxpa.c:248:5: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
dyld: lazy symbol binding failed: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
dyld: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
gcc-4: internal compiler error: Trace/BPT trap: 5 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I'll open a bugzilla for this one.
            Jack

Duncan,
      Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
with...

GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"

The resulting dragonegg plugin works fine as...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c

but if I try to invoke polly with...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c

I get the error...

cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'

I think the website is wrong. You probably need to add a '-' before the
'load'. See the following:

"-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"

Please let me know if this works, such that I can update the website.

Tobias,
    This solves the previous problem but exposes another...

Great, I checked in the website fix in:

https://llvm.org/svn/llvm-project/polly/trunk@166396

[MacBookPro:~] howarth% /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c -v
himenoBMTxpa.c:248:5: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
dyld: lazy symbol binding failed: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
dyld: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
gcc-4: internal compiler error: Trace/BPT trap: 5 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I'll open a bugzilla for this one.

Yes, please do. This is an interesting problem. I have no solution of the top of my head.

Tobi

Duncan,
      Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
with...

GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"

The resulting dragonegg plugin works fine as...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c

but if I try to invoke polly with...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c

I get the error...

cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'

I think the website is wrong. You probably need to add a '-' before the
'load'. See the following:

"-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"

Please let me know if this works, such that I can update the website.

Tobias,
    This solves the previous problem but exposes another...

Great, I checked in the website fix in:

https://llvm.org/svn/llvm-project/polly/trunk@166396

[MacBookPro:~] howarth% /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c -v
himenoBMTxpa.c:248:5: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
dyld: lazy symbol binding failed: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
dyld: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
gcc-4: internal compiler error: Trace/BPT trap: 5 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I'll open a bugzilla for this one.

Yes, please do. This is an interesting problem. I have no solution of
the top of my head.

Done... http://llvm.org/bugs/show_bug.cgi?id=14140. I'll ping the MacPorts maintainers of their llvm-3.2 package to update
it to contain polly as well. This, with a rebuild of their dragonegg-3.2 package, should provide the Apple programmers with
pre-built binaries to debug this issue without tainting themselves with GPLv3 code.

Can you take a look at lvm.org/bugs/show_bug.cgi?id=14135 as well? We need to avoid using LLVM_SHLIBEXT in the test
subdirectory because this is defined to '.dylib' on darwin while Polly correctly builds the loadable module with the
'.so' suffix causing almost all of the testsuite to fail with 'make test-polly'. Thanks in advance.
          Jack

Duncan,
       Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
with...

GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"

The resulting dragonegg plugin works fine as...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c

but if I try to invoke polly with...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c

I get the error...

cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'

I think the website is wrong. You probably need to add a '-' before the
'load'. See the following:

"-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"

Please let me know if this works, such that I can update the website.

Tobias,
     This solves the previous problem but exposes another...

Great, I checked in the website fix in:

https://llvm.org/svn/llvm-project/polly/trunk@166396

[MacBookPro:~] howarth% /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c -v
himenoBMTxpa.c:248:5: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
dyld: lazy symbol binding failed: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
dyld: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
gcc-4: internal compiler error: Trace/BPT trap: 5 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I'll open a bugzilla for this one.

Yes, please do. This is an interesting problem. I have no solution of
the top of my head.

Done... http://llvm.org/bugs/show_bug.cgi?id=14140. I'll ping the MacPorts maintainers of their llvm-3.2 package to update
it to contain polly as well. This, with a rebuild of their dragonegg-3.2 package, should provide the Apple programmers with
pre-built binaries to debug this issue without tainting themselves with GPLv3 code.

Thanks.

Can you take a look at lvm.org/bugs/show_bug.cgi?id=14135 as well? We need to avoid using LLVM_SHLIBEXT in the test
subdirectory because this is defined to '.dylib' on darwin while Polly correctly builds the loadable module with the
'.so' suffix causing almost all of the testsuite to fail with 'make test-polly'. Thanks in advance.

I would prefer to build Polly with the native extension on darwin. The native extension seems to be '.dylib', no? Do you know if a autoconf build gets it right?

Tobi

Duncan,
       Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
with...

GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"

The resulting dragonegg plugin works fine as...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c

but if I try to invoke polly with...

/sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c

I get the error...

cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'

I think the website is wrong. You probably need to add a '-' before the
'load'. See the following:

"-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"

Please let me know if this works, such that I can update the website.

Tobias,
     This solves the previous problem but exposes another...

Great, I checked in the website fix in:

https://llvm.org/svn/llvm-project/polly/trunk@166396

[MacBookPro:~] howarth% /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c -v
himenoBMTxpa.c:248:5: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
dyld: lazy symbol binding failed: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
dyld: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
gcc-4: internal compiler error: Trace/BPT trap: 5 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I'll open a bugzilla for this one.

Yes, please do. This is an interesting problem. I have no solution of
the top of my head.

Done... http://llvm.org/bugs/show_bug.cgi?id=14140. I'll ping the MacPorts maintainers of their llvm-3.2 package to update
it to contain polly as well. This, with a rebuild of their dragonegg-3.2 package, should provide the Apple programmers with
pre-built binaries to debug this issue without tainting themselves with GPLv3 code.

Thanks.

Can you take a look at lvm.org/bugs/show_bug.cgi?id=14135 as well? We need to avoid using LLVM_SHLIBEXT in the test
subdirectory because this is defined to '.dylib' on darwin while Polly correctly builds the loadable module with the
'.so' suffix causing almost all of the testsuite to fail with 'make test-polly'. Thanks in advance.

I would prefer to build Polly with the native extension on darwin. The
native extension seems to be '.dylib', no? Do you know if a autoconf
build gets it right?

Tobias,
   I would note that '.so' is a valid suffix for shared modules on darwin as witnessed by
their use in /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
for the python shared modules on both Lion and Mountain Lion. So we aren't deviating from
convention here.
        Jack

>>>>>> Duncan,
>>>>>> Is the documentation for using Polly support in dragonegg correct? I built llvm/polly/dragonegg
>>>>>> using the documentation at http://polly.llvm.org/example_load_Polly_into_dragonegg.html
>>>>>> with...
>>>>>>
>>>>>> GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-DENABLE_LTO -I/sw/include"
>>>>>>
>>>>>> The resulting dragonegg plugin works fine as...
>>>>>>
>>>>>> /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 himenoBMTxpa.c
>>>>>>
>>>>>> but if I try to invoke polly with...
>>>>>>
>>>>>> /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c
>>>>>>
>>>>>>
>>>>>> I get the error...
>>>>>>
>>>>>> cc1: Unknown command line argument 'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'
>>>>>
>>>>> I think the website is wrong. You probably need to add a '-' before the
>>>>> 'load'. See the following:
>>>>>
>>>>> "-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"
>>>>>
>>>>> Please let me know if this works, such that I can update the website.
>>>>
>>>> Tobias,
>>>> This solves the previous problem but exposes another...
>>>
>>> Great, I checked in the website fix in:
>>>
>>> https://llvm.org/svn/llvm-project/polly/trunk@166396
>>>
>>>>
>>>> [MacBookPro:~] howarth% /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3 -fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib himenoBMTxpa.c -v
>>>> himenoBMTxpa.c:248:5: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
>>>> dyld: lazy symbol binding failed: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
>>>> dyld: fast lazy bind offset out of range (39257, max=7640) in image /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
>>>> gcc-4: internal compiler error: Trace/BPT trap: 5 (program cc1)
>>>> Please submit a full bug report,
>>>> with preprocessed source if appropriate.
>>>> See <http://gcc.gnu.org/bugs.html> for instructions.
>>>>
>>>> I'll open a bugzilla for this one.
>>>
>>> Yes, please do. This is an interesting problem. I have no solution of
>>> the top of my head.
>>
>> Done... http://llvm.org/bugs/show_bug.cgi?id=14140. I'll ping the MacPorts maintainers of their llvm-3.2 package to update
>> it to contain polly as well. This, with a rebuild of their dragonegg-3.2 package, should provide the Apple programmers with
>> pre-built binaries to debug this issue without tainting themselves with GPLv3 code.
>
> Thanks.
>
>> Can you take a look at lvm.org/bugs/show_bug.cgi?id=14135 as well? We need to avoid using LLVM_SHLIBEXT in the test
>> subdirectory because this is defined to '.dylib' on darwin while Polly correctly builds the loadable module with the
>> '.so' suffix causing almost all of the testsuite to fail with 'make test-polly'. Thanks in advance.
>
> I would prefer to build Polly with the native extension on darwin. The
> native extension seems to be '.dylib', no? Do you know if a autoconf
> build gets it right?

Tobias,
   I would note that '.so' is a valid suffix for shared modules on darwin as witnessed by
their use in /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
for the python shared modules on both Lion and Mountain Lion. So we aren't deviating from
convention here.
        Jack

Also see http://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm which describes the convention
for shared modules on darwin as being named with the .bundle or .so suffix. So the flaw is
limited to the test subdirectory in polly. Polly correctly produces a LLVMPolly.so but
incorrectly tries to test polly with a non-existent LLVMPolly.dylib.
          Jack

Thanks. I just found the same page.

Does attached patch work for you?

Tobi

0001-cmake-Use-suffix-for-shared-modules-instead-of-the-o.patch (1.12 KB)

...

Does attached patch work for you?

Tobi

Tobi,
  Yes, with this patch current llvm/polly svn builds and runs 'make polly-test'
without issues in finding LLVMPolly.so. Thanks for fixing this so quickly.
  Do you have any comments on failing tests we are seeing on x86_64-apple-darwin11?

Failing Tests (5):
    Polly :: CodeGen/do_pluto_matmult.ll
    Polly :: CodeGen/single_do_loop_int_max_iterations.ll
    Polly :: CodeGen/single_do_loop_scev_replace.ll
    Polly :: IslCodeGen/single_loop_param_less_equal.ll
    Polly :: IslCodeGen/single_loop_param_less_than.ll

Are these darwin-specific or due to the fact that I am using isl 0.10 and
cloog 0.17 rather than their the upstream development svn? Let me know if
any of those merit a bugzilla of their own.
          Jack

...

Does attached patch work for you?

Tobi

Tobi,
   Yes, with this patch current llvm/polly svn builds and runs 'make polly-test'
without issues in finding LLVMPolly.so. Thanks for fixing this so quickly.

Thanks for the nice bugreport. I committed a fix in 166402

   Do you have any comments on failing tests we are seeing on x86_64-apple-darwin11?

Failing Tests (5):
     Polly :: CodeGen/do_pluto_matmult.ll
     Polly :: CodeGen/single_do_loop_int_max_iterations.ll
     Polly :: CodeGen/single_do_loop_scev_replace.ll

I have some guesses for these, but it would be good to get run

llvm-lit -v on these three test cases.

     Polly :: IslCodeGen/single_loop_param_less_equal.ll
     Polly :: IslCodeGen/single_loop_param_less_than.ll

This is due to the use of an old isl version. I will change configure to fail if the isl version used is too old.

Are these darwin-specific or due to the fact that I am using isl 0.10 and
cloog 0.17 rather than their the upstream development svn? Let me know if
any of those merit a bugzilla of their own.

Let's see why the first three are failing.

Cheers
Tobi

...

Does attached patch work for you?

Tobi

Tobi,
   Yes, with this patch current llvm/polly svn builds and runs 'make polly-test'
without issues in finding LLVMPolly.so. Thanks for fixing this so quickly.

Thanks for the nice bugreport. I committed a fix in 166402

   Do you have any comments on failing tests we are seeing on x86_64-apple-darwin11?

Failing Tests (5):
     Polly :: CodeGen/do_pluto_matmult.ll
     Polly :: CodeGen/single_do_loop_int_max_iterations.ll
     Polly :: CodeGen/single_do_loop_scev_replace.ll

I have some guesses for these, but it would be good to get run

llvm-lit -v on these three test cases.

     Polly :: IslCodeGen/single_loop_param_less_equal.ll
     Polly :: IslCodeGen/single_loop_param_less_than.ll

Tobias,
   I am unclear on how I should modify the 'make polly-test' run in order
for 'llvm-lit -v' to take effect and where to look for the additional information.
Thanks in advance for any clarifications.

This is due to the use of an old isl version. I will change configure to
fail if the isl version used is too old.

Are these darwin-specific or due to the fact that I am using isl 0.10 and
cloog 0.17 rather than their the upstream development svn? Let me know if
any of those merit a bugzilla of their own.

It looks like MacPorts could easily switch their llvm-3.2 packaging to build polly
except that, unlike fink which uses cmake, they are still using configure for the
build. This fails against isl 0.10 due to the test...

checking for isl: isl/ast.h in /opt/local/include, and libisl in /opt/local/lib... configure: error: isl required but not found

Is there a schedule for releasing updated tarballs for isl and cloog?
        Jack

...

Does attached patch work for you?

Tobi

Tobi,
    Yes, with this patch current llvm/polly svn builds and runs 'make polly-test'
without issues in finding LLVMPolly.so. Thanks for fixing this so quickly.

Thanks for the nice bugreport. I committed a fix in 166402

    Do you have any comments on failing tests we are seeing on x86_64-apple-darwin11?

Failing Tests (5):
      Polly :: CodeGen/do_pluto_matmult.ll
      Polly :: CodeGen/single_do_loop_int_max_iterations.ll
      Polly :: CodeGen/single_do_loop_scev_replace.ll

I have some guesses for these, but it would be good to get run

llvm-lit -v on these three test cases.

      Polly :: IslCodeGen/single_loop_param_less_equal.ll
      Polly :: IslCodeGen/single_loop_param_less_than.ll

Tobias,
    I am unclear on how I should modify the 'make polly-test' run in order
for 'llvm-lit -v' to take effect and where to look for the additional information.
Thanks in advance for any clarifications.

After you run 'make polly-test' once, you can just run

$ llvm-lit -v ${POLLY_SRC}/test

Like this you can easily pass the verbose flag.

This is due to the use of an old isl version. I will change configure to
fail if the isl version used is too old.

Are these darwin-specific or due to the fact that I am using isl 0.10 and
cloog 0.17 rather than their the upstream development svn? Let me know if
any of those merit a bugzilla of their own.

It looks like MacPorts could easily switch their llvm-3.2 packaging to build polly
except that, unlike fink which uses cmake, they are still using configure for the
build. This fails against isl 0.10 due to the test...

>

checking for isl: isl/ast.h in /opt/local/include, and libisl in /opt/local/lib... configure: error: isl required but not found

cmake should fail the same way (if it is reconfigured). I just committed this changes to make ensure the isl version we are using
contains all the features Polly is using.

Is there a schedule for releasing updated tarballs for isl and cloog?

I am not aware of a concrete schedule, but I believe Sven (copied) was planning to release a new version of isl at some point not too far away.

Cheers
Tobi

Tobi,
   I can confirm that your polly changes now prevents cmake from building against isl 0.10.
After updating my isl/cloog packages to the current git commit level, the failures are reduced
to...

Failing Tests (3):
    Polly :: CodeGen/do_pluto_matmult.ll
    Polly :: CodeGen/single_do_loop_int_max_iterations.ll
    Polly :: CodeGen/single_do_loop_scev_replace.ll

  Expected Passes : 125
  Expected Failures : 29
  Unsupported Tests : 2
  Unexpected Failures: 3

The output of 'llvm-lit -v' is attached to the bugzilla I opened...

http://llvm.org/bugs/show_bug.cgi?id=14142

Let me know if I should have provided more than that from the 'llvm-lit -v' run.
          Jack

Probably some time next month.

skimo

> >Is there a schedule for releasing updated tarballs for isl and cloog?
>
> I am not aware of a concrete schedule, but I believe Sven (copied)
> was planning to release a new version of isl at some point not too
> far away.

Probably some time next month.

Thanks. I'll also test isl/cloog git against gcc trunk to make sure graphite
hasn't regressed. It already has frayed a bit without any isl/cloog updates...

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54886
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54967

Skimo,
   Are you close to a release of new cloog and isl tarballs to go along with
the polly release in llvm 3.2? It would be nice to have those out so that
I can submit a patch to FSF gcc to bump their cloog and isl versions for
FSF gcc 4.8 (as I currently have to use --disable-cloog-version-check
--disable-isl-version-check in the gcc trunk bootstrap against cloog/isl git
required for polly 3.2).
                 Jack