flatironinstitute / FMM3D

Flatiron Institute Fast Multipole Libraries --- This codebase is a set of libraries to compute N-body interactions governed by the Laplace and Helmholtz equations, to a specified precision, in three dimensions, on a multi-core shared-memory machine.
https://fmm3d.readthedocs.io
Other
91 stars 36 forks source link

Windows matlab compile issue #46

Open AsIlll223 opened 7 months ago

AsIlll223 commented 7 months ago

Dear all,

when I compile the fmm3d to the mex file in matlab, here is an issue:

I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x3614): undefined reference to `hndiv' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_2577111801590582_27384\fmm3d.obj:fmm3d.c:(.text+0x5d61): undefined reference to hfmm3d_ndiv__' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_2577111801590582_27384\fmm3d.obj:fmm3d.c:(.text+0x694b): undefined reference toh3ddirectcp_' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x73bb): undefined reference to `h3ddirectdp' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x7fbc): undefined reference to `h3ddirectcdp' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x8b62): undefined reference to `h3ddirectcg' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x97a2): undefined reference to `h3ddirectdg' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0xa5c3): undefined reference to `h3ddirectcdg' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0xaee4): undefined reference to `lndiv' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_2577111801590582_27384\fmm3d.obj:fmm3d.c:(.text+0xd1ed): undefined reference to lfmm3d_ndiv__' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_2577111801590582_27384\fmm3d.obj:fmm3d.c:(.text+0xdbd4): undefined reference tol3ddirectcp_' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0xe484): undefined reference to `l3ddirectdp' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0xee61): undefined reference to `l3ddirectcdp' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0xf89c): undefined reference to `l3ddirectcg' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x1030c): undefined reference to `l3ddirectdg' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x10ebe): undefined reference to `l3ddirectcdg' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x11a69): undefined reference to `l3ddirectch' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x12639): undefined reference to `l3ddirectdh' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x13395): undefined reference to `l3ddirectcdh' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x14fc4): undefined reference to `emfmm3d' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x16b1f): undefined reference to `em3ddirect' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x184e7): undefined reference to `stfmm3d' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x19239): undefined reference to `st3ddirectstokg' I:/Msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Admin\AppData\Local\Temp\mex_257711180159058227384\fmm3d.obj:fmm3d.c:(.text+0x1a1e6): undefined reference to `st3ddirectstokstrsg' collect2.exe: error: ld returned 1 exit status

image image

Could anyone help me ?

lu1and10 commented 7 months ago

@AsIlll223 I guess you modified the makefile.windows for powershell? makefile.windows has not been updated for a while. And it seems that you also replaced https://github.com/flatironinstitute/FMM3D/blob/31173b219a6f3a730f1454e7edfaeeb47f4d675c/makefile.windows#L75-L94 with https://github.com/flatironinstitute/FMM3D/blob/31173b219a6f3a730f1454e7edfaeeb47f4d675c/makefile#L94-L122 ? And OBJS = $(COMOBJS) $(HOBJS) $(LOBJS) $(STOBJS) $(EMOBJS) should be used in your makefile, right?

Could you try clean all the src/Common/*.o, src/Helmholtz/*.o, src/Laplace/*.o, src/Maxwell/*.o, Stokes/*.o and the libfmm3d.a. And rerun the make matlab. Weirdly it seems using the libfmm3d.a missing the symbols.