Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#14 Linker error while creating windows dll

developer
open
5
2014-10-02
2010-06-28
Anonymous
No

Hi,

I would like to check out whether ATLAS can help me to accelerate calculations done with www.r-project.org. For that I would like to build a windows dll using ATLAS 3.9.25, the ones provided at www.r-project.org are quite dated.

The result is:

--- snip ---
gcc-4 -fomit-frame-pointer -mfpmath=sse -msse3 -O2 -march=core2 -O3 -fopenmp -m3
2 -mpreferred-stack-boundary=2 -DL2SIZE=4194304 -I/cygdrive/c/ATLAS/build/inclu
de -I/cygdrive/c/ATLAS/build/..//include -I/cygdrive/c/ATLAS/build/..//include/c
ontrib -DAdd_ -DF77_INTEGER=int -DStringSunStyle -DATL_OS_WinNT -DATL_ARCH_Core2
-DATL_CPUMHZ=2667 -DGCCWIN -DUseClock -DATL_SSE3 -DATL_SSE2 -DATL_SSE1 -DATL_GA
S_x8632 -DPentiumCPS=2667 -DATL_DYLIBS -DATL_NCPU=2 -c -o ATL_itlaenv.o -DATL_US
EPTHREADS \ /cygdrive/c/ATLAS/build/..//src/lapack/ATL_ilaenv.c
ar r /cygdrive/c/ATLAS/build/lib/libatlas.a ATL_itlaenv.o
echo /cygdrive/c/ATLAS/build/lib/libatlas.a
/cygdrive/c/ATLAS/build/lib/libatlas.a
touch tenvlib.grd
make[3]: Leaving directory `/cygdrive/c/ATLAS/build/src/lapack'
make[2]: Leaving directory `/cygdrive/c/ATLAS/build/bin'
DONE STAGE 5-1-0 at 16:42

BEGIN STAGE 5-2-0: DYNAMIC/SHARED LIBRARY UPDATE at 16:42
make -f Makefile IBuildDyLibs 2>&1 | ./xatlas_tee INSTALL_LOG/LIBDYBUILD.LOG
make[2]: Entering directory `/cygdrive/c/ATLAS/build/bin'
cd /cygdrive/c/ATLAS/build ; make dylibs
make[3]: Entering directory `/cygdrive/c/ATLAS/build'
cd lib ; make shared_all
make[4]: Entering directory `/cygdrive/c/ATLAS/build/lib'
make dlls
make[5]: Entering directory `/cygdrive/c/ATLAS/build/lib'
ld -mi386pe -shared -soname /usr/local/atlas/lib/libatlas.dll \ -o libatlas.dll -rpath-link /usr/local/atlas/lib \ --whole-archive libatlas.a --no-whole-archive -lc -lpthread -lkernel3
2 -lm
/usr/lib/libc.a(t-d001212.o):(.text+0x2): undefined reference to `_imp__malloc'
/usr/lib/libc.a(t-d000937.o):(.text+0x2): undefined reference to `_imp__free'
/usr/lib/libc.a(t-d000750.o):(.text+0x2): undefined reference to `_imp__clock'
/usr/lib/libc.a(t-d001318.o):(.text+0x2): undefined reference to `_imp__printf'
/usr/lib/libc.a(t-d001750.o):(.text+0x2): undefined reference to `_imp__vprintf'

/usr/lib/libc.a(t-d000865.o):(.text+0x2): undefined reference to `_imp__exit'
/usr/lib/libc.a(t-d001230.o):(.text+0x2): undefined reference to `_imp__memcpy'
/usr/lib/libc.a(t-d001744.o):(.text+0x2): undefined reference to `_imp__vfprintf
'
/usr/lib/libc.a(t-d000898.o):(.text+0x2): undefined reference to `_imp__fflush'
/usr/lib/libpthread.a(t-d001361.o):(.text+0x2): undefined reference to `_imp__pt
hread_mutex_init'
/usr/lib/libpthread.a(t-d001338.o):(.text+0x2): undefined reference to `_imp__pt
hread_cond_init'
/usr/lib/libpthread.a(t-d001355.o):(.text+0x2): undefined reference to `_imp__pt
hread_join'
/usr/lib/libpthread.a(t-d001362.o):(.text+0x2): undefined reference to `_imp__pt
hread_mutex_lock'
/usr/lib/libpthread.a(t-d001339.o):(.text+0x2): undefined reference to `_imp__pt
hread_cond_signal'
/usr/lib/libpthread.a(t-d001365.o):(.text+0x2): undefined reference to `_imp__pt
hread_mutex_unlock'
/usr/lib/libpthread.a(t-d001321.o):(.text+0x2): undefined reference to `_imp__pt
hread_attr_destroy'
/usr/lib/libpthread.a(t-d001328.o):(.text+0x2): undefined reference to `_imp__pt
hread_attr_init'
/usr/lib/libpthread.a(t-d001329.o):(.text+0x2): undefined reference to `_imp__pt
hread_attr_setdetachstate'
/usr/lib/libpthread.a(t-d001333.o):(.text+0x2): undefined reference to `_imp__pt
hread_attr_setscope'
/usr/lib/libpthread.a(t-d001347.o):(.text+0x2): undefined reference to `_imp__pt
hread_create'
/usr/lib/libpthread.a(t-d001341.o):(.text+0x2): undefined reference to `_imp__pt
hread_cond_wait'
/usr/lib/libm.a(t-d000913.o):(.text+0x2): undefined reference to `_imp__floor'
/usr/lib/libm.a(t-d001604.o):(.text+0x2): undefined reference to `_imp__sqrt'
make[5]: *** [libatlas.dll] Error 1
make[5]: Leaving directory `/cygdrive/c/ATLAS/build/lib'
make[4]: *** [shared_all] Error 2
make[4]: Leaving directory `/cygdrive/c/ATLAS/build/lib'
make[3]: *** [dylibs] Error 2
make[3]: Leaving directory `/cygdrive/c/ATLAS/build'
make[2]: *** [IBuildDyLibs] Error 2
make[2]: Leaving directory `/cygdrive/c/ATLAS/build/bin'
DONE STAGE 5-2-0 at 16:42

ATLAS install complete. Examine
ATLAS/bin/<arch>/INSTALL_LOG/SUMMARY.LOG for details.
make[1]: Leaving directory `/cygdrive/c/ATLAS/build'
make clean
make[1]: Entering directory `/cygdrive/c/ATLAS/build'
rm -f *.o x* config?.out *core*
make[1]: Leaving directory `/cygdrive/c/ATLAS/build'
--- /snip ---

My configure call was:
$ ../configure -b 32 -Fa alg -fPIC -D c -DPentiumCPS=2667 -m 2667 -t 2 -Fa al "-march=core2 -O3 -fopenmp" --shared

I also tried this one, but with the same result: ../configure -b 32 -Fa alg -fPIC

I'm using an up-to-date cygwin default install (with only additional packages gcc-g++, gcc-g77, make) on Windows XP SP3 32bit.
gcc version is: gcc (GCC) 4.3.4 20090804 (release) 1

I carefully reread the FAQ and install documentation but could not find where my mistake is, could you please point me into the right direction.

By checking past bug tracker entries I realized that people have encountered windows build problems before. So I would kindly suggest to provide a sample command sequence for Windows in the FAQ like there already is for Linux.

Keep up the good work.

Discussion

  • In general, it is a bad idea to change the flags yourself. ATLAS's flags are tuned for the core2, and your command above is likely to slightly hurt performance. Also, why are you throwing the -fopenmp flag? ATLAS does not use OpenMP by default.

    You are right that at the moment my ability to meaningfully support Windows is almost nill. I am still trying to figure out all the dynamic lib stuff even on Linux (I'm a static lib user myself).

    However, all you missing symbols appear to me to be *imp*, which means there is at least the hope they might go away if you didn't throw the -fopenmp flag. Can you try a default install w/o changing the compiler flags at all, and tell me what happens then?

    I am moving this to the windows support tracker (the tracker of futility, for me :).

    Thanks,
    Clint

     
    • assigned_to: nobody --> rwhaley
    • milestone: 148063 -->
    • labels: 360153 --> Problems with linking
     
    • milestone: --> developer
     
  • johnd87
    johnd87
    2010-07-07

    Hi Clint, thanks for your fast reply.

    As stated in my original report I already tried without manual compiler flag modification.

    Just to make sure I reran on another computer with:
    ../configure -b 32 -Fa alg -fPIC -D c -DPentiumCPS=1830 -m 1830 -t 2 --shared

    This gives me the same error message.

    Adding "-fopenmp" to the compiler flag happened after I saw that src\threads\blas\level3\omp\*.c contains OpenMP directives.

    Daniel

     
  • Probably won't fix things, but you might try 3.9.28. That one seems to fix a lot of the dynamic issues on linux. I don't think it will fix these threaded symbols, but we might get lucky . . .

    Cheers,
    Clint

     
  • 2fZ3Hv <a href="http://stfrfeerbamu.com/">stfrfeerbamu</a>, [url=http://gfcklucpixpj.com/]gfcklucpixpj[/url], [link=http://lyexmwmpspjd.com/]lyexmwmpspjd[/link], http://qswhzrdjboaz.com/

     
  • 2fZ3Hv <a href="http://stfrfeerbamu.com/">stfrfeerbamu</a>, [url=http://gfcklucpixpj.com/]gfcklucpixpj[/url], [link=http://lyexmwmpspjd.com/]lyexmwmpspjd[/link], http://qswhzrdjboaz.com/

     
  • 2fZ3Hv <a href="http://stfrfeerbamu.com/">stfrfeerbamu</a>, [url=http://gfcklucpixpj.com/]gfcklucpixpj[/url], [link=http://lyexmwmpspjd.com/]lyexmwmpspjd[/link], http://qswhzrdjboaz.com/

     
  • 2fZ3Hv <a href="http://stfrfeerbamu.com/">stfrfeerbamu</a>, [url=http://gfcklucpixpj.com/]gfcklucpixpj[/url], [link=http://lyexmwmpspjd.com/]lyexmwmpspjd[/link], http://qswhzrdjboaz.com/

     
  • Hi,

    I am very sorry for the looong delay, but I think I have gotten Windows fully supported in ATLAS 3.9.79. Using it, you can build 32-bit libs using either the cygwin compilers or the MinGW compilers, though you still need cygwin installed. The ATLAS installation guide that comes with the tarfile has Windows-specific installation instructions.

    Can you try 3.9.79 and let me know if it works for you?

    Many thanks,
    Clint