Issue compiling buildmcxcl.m MATLAB script

12 views
Skip to first unread message

ECA

unread,
May 8, 2026, 8:05:33 AM (7 days ago) May 8
to mcx-users
Dear Professor Fang,

Thank you for developing MCX and making it open-source!

Whilst MCXStudio seems to be working as expected, I am having some trouble using mcxlabcl in MATLAB 2026a. I am trying to compile the MEX file using the buildmcxcl.m script and current git repo version, and am able to make some progress, but the build fails with these errors.

```
mex cJSON.o mcx_host.o mcx_shapes.o mcx_tictoc.o mcx_utils.o mcxlabcl.o -output mcxcl -outdir ../mcxlabcl LINKLIBS='$LINKLIBS -lstdc++ -static 'C:\Windows\System32\OpenCL.dll' '
Building with 'MinGW64 Compiler (C)'.
Error using mex
C:/VSARM/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: mcx_utils.o: in function `mcx_prep_polarized':
mcxcl/src/mcx_utils.c:1501:(.text+0xce2): undefined reference to `Mie'
C:/VSARM/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: mcx_utils.o:mcx_utils.c:(.rdata$.refptr.translations[.refptr.translations]+0x0):
undefined reference to `translations'
C:/VSARM/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: mcx_utils.o:mcx_utils.c:(.rdata$.refptr.languagename[.refptr.languagename]+0x0):
undefined reference to `languagename'
collect2.exe: error: ld returned 1 exit status

Error in
buildmcxcl (line 110)
eval(sprintf('mex %s -output %scl -outdir ../%slabcl %s=''%s'' ', strjoin({fn.name}), pname, pname, linkvar, linkflags));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

Looking through the .c/.h files, I can't see why this would be the case and can only assume there's something in the environment that's causing problems. Am I missing something?

Thanks!

Qianqian Fang

unread,
May 8, 2026, 5:23:10 PM (7 days ago) May 8
to mcx-...@googlegroups.com, ECA

thanks for reporting this. the buildmcxcl.m script is missing some of the new files I added recently in order completely synchronize mcxcl with mcx - including the polarization, svmc support etc.

this has been fixed in this commit

https://github.com/fangq/mcxcl/commit/35c5b955a12e8a2b0ec85dfc87692eff3f591b83

please pull again and run

buildmcxcl('clean');
buildmcxcl

and see if that resolves the missing units.


On 5/7/26 12:28, ECA wrote:

You don't often get email from ecu...@gmail.com. Learn why this is important

--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/4011eee5-4e50-4bbc-89a4-9195a75086c2n%40googlegroups.com.

ECA

unread,
May 11, 2026, 4:55:23 AM (4 days ago) May 11
to mcx-users
Thank you for your prompt action, I am now able to compile the MEX file.
Reply all
Reply to author
Forward
0 new messages