ArrayFire and MinGW

[Old posts from the commercial version of ArrayFire] Issues and comments for download and installation. Getting up and running.

Moderators: melonakos, pavanky

ArrayFire and MinGW

Postby marvell » Sat May 17, 2014 10:29 am

Dear all,
I am trying to set up ArrayFire for MinGW on Windows 7. I have added %AF_PATH%\lib64 to PATH.
When I try to compile helloworld.cpp, I get this :

Code: Select all
Setting up environment for using MinGW with GCC from D:\Programmes\TDM-GCC-64\.

D:\Users\Hugo\Documents>cd Programmation

D:\Users\Hugo\Documents\Programmation>gcc helloworld.cpp
helloworld.cpp:2:23: fatal error: arrayfire.h: No such file or directory
 #include <arrayfire.h>
                       ^
compilation terminated.

D:\Users\Hugo\Documents\Programmation>gcc helloworld.cpp
helloworld.cpp:2:23: fatal error: arrayfire.h: No such file or directory
 #include <arrayfire.h>
                       ^
compilation terminated.

D:\Users\Hugo\Documents\Programmation>gcc -I$AF_PATH/include -L$AF_PATH/lib64 -l
afcl -lstdc++ -DAFCL helloworld.cpp
helloworld.cpp:2:23: fatal error: arrayfire.h: No such file or directory
 #include <arrayfire.h>
                       ^
compilation terminated.

D:\Users\Hugo\Documents\Programmation>gcc -ID:\Programmes\ArrayFire\v2.1\include
 -LD:\Programmes\ArrayFire\v2.1\lib64 -lafcl -lstdc++ -DAFCL helloworld.cpp
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x5b): undefined reference to `__imp__Z
N2af9devicesetEi'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x69): undefined reference to `__imp__Z
N2af4infoEb'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x96): undefined reference to `__imp__Z
N2af5randuEjjNS_5dtypeE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0xad): undefined reference to `__imp__Z
N2af5arrayC1ERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0xc7): undefined reference to `__imp__Z
N2af6_printEPKcNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0xda): undefined reference to `__imp__Z
N2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x10e): undefined reference to `__imp__
ZN2af3sinERKNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x12f): undefined reference to `__imp__
ZNK2af5arrayplERKd'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x142): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x159): undefined reference to `__imp__
ZN2af5arrayC1ERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x173): undefined reference to `__imp__
ZN2af6_printEPKcNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x186): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x1ab): undefined reference to `__imp__
ZN2af3fftERKNS_5arrayEi'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x1c1): undefined reference to `__imp__
ZN2af5arrayC1ERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x1db): undefined reference to `__imp__
ZN2af6_printEPKcNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x1ee): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x203): undefined reference to `__imp__
ZN2af3endE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x22c): undefined reference to `__imp__
ZN2af5arrayC1ERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x246): undefined reference to `__imp__
ZN2af6_printEPKcNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x259): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x26e): undefined reference to `__imp__
ZN2af3endE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x2a0): undefined reference to `__imp__
ZN2af3seqC1Eddd'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x2b7): undefined reference to `__imp__
ZN2af4spanE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x2cb): undefined reference to `__imp__
ZNK2af5arrayclERKNS_3seqES3_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x2e1): undefined reference to `af::arr
ay& af::array::operator=<int>(int)'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x2f2): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x335): undefined reference to `__imp__
ZN2af3seqC1Ed'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x37c): undefined reference to `__imp__
ZNK2af5arraymlERKd'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x3a2): undefined reference to `__imp__
ZN2af3seqC1Ed'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x3df): undefined reference to `__imp__
ZN2af5arrayaSERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x3f2): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x405): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x418): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x42f): undefined reference to `__imp__
ZN2af5arrayC1ERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x449): undefined reference to `__imp__
ZN2af6_printEPKcNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x45c): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x4ce): undefined reference to `af::arr
ay::array<float>(unsigned int, unsigned int, float const*, af::af_source_t, unsi
gned int)'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x4e3): undefined reference to `__imp__
ZN2af5arrayC1ERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x4fd): undefined reference to `__imp__
ZN2af6_printEPKcNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x510): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x525): undefined reference to `__imp__
ZN2af3endE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x56e): undefined reference to `__imp__
ZN2af5arrayaSERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x581): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x594): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x5ab): undefined reference to `__imp__
ZN2af5arrayC1ERKS0_'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x5c5): undefined reference to `__imp__
ZN2af6_printEPKcNS_5arrayE'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x5d8): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x5e6): undefined reference to `float*
af::array::host<float>() const'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x5fe): undefined reference to `__imp__
ZN2af5array4freeEPKv'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x60e): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x61e): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x62d): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x63d): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x64d): undefined reference to `__imp__
ZN2af5arrayD1Ev'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x6b4): more undefined references to `_
_imp__ZN2af5arrayD1Ev' follow
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x93b): undefined reference to `__cxa_e
nd_catch'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x95c): undefined reference to `__cxa_b
egin_catch'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x9a7): undefined reference to `__cxa_r
ethrow'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x9c7): undefined reference to `std::io
s_base::Init::~Init()'
D:\TEMP\cclRevN8.o:helloworld.cpp:(.text+0x9f7): undefined reference to `std::io
s_base::Init::Init()'
d:/programmes/tdm-gcc-64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86
_64-w64-mingw32/bin/ld.exe: D:\TEMP\cclRevN8.o: bad reloc address 0x0 in section
 `.data'
collect2.exe: error: ld returned 1 exit status

If I copy the files and folders included in D:\Programmes\ArrayFire\v2.1\include (\af, \CL, \clmath, and arrayfire.h) to D:\Programmes\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++, I get this at compile time :

Code: Select all
D:\Users\Hugo\Documents\Programmation>gcc helloworld.cpp
In file included from d:\programmes\tdm-gcc-64\lib\gcc\x86_64-w64-mingw32\4.8.1\
include\c++\af/array.h:2:0,
                 from d:\programmes\tdm-gcc-64\lib\gcc\x86_64-w64-mingw32\4.8.1\
include\c++\arrayfire.h:153,
                 from helloworld.cpp:2:
d:\programmes\tdm-gcc-64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\af/defines
.h:103:18: fatal error: cuda.h: No such file or directory
 #include <cuda.h>
                  ^
compilation terminated.

D:\Users\Hugo\Documents\Programmation>gcc -lafcl -lstdc++ -DAFCL helloworld.cpp
d:/programmes/tdm-gcc-64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86
_64-w64-mingw32/bin/ld.exe: cannot find -lafcl
collect2.exe: error: ld returned 1 exit status

Could someone explain me how to compile with MinGW?
Thanks.
marvell
 
Posts: 1
Joined: Sat May 17, 2014 10:06 am

Re: ArrayFire and MinGW

Postby pavanky » Mon May 19, 2014 1:26 pm

Hi,

There are a couple of problems.

1) We compile windows version of our library using Visual Studio 2008. You can not use ArrayFire's C++ API because C++ compilers mangle the symbol names in a way that can not be read easily by other compilers. You can read more about it here: http://stackoverflow.com/questions/2472 ... from-mingw

2) Even if we did support mingw, just using "gcc helloworld.cpp" will not work. Please read the section about using mingw to compile with external projects from here: http://www.mingw.org/wiki/HOWTO

We will try to support mingw in the future. Sorry about the inconvenience.
Pavan Yalamanchili,
ArrayFire
--
~ If it is not broken, you have not tried hard enough ~
User avatar
pavanky
Site Admin
 
Posts: 1123
Joined: Mon Mar 15, 2010 7:39 pm
Location: Atlanta, GA


Return to [archive-commercial] Download & Installation