--
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 on the web visit https://groups.google.com/d/msgid/mcx-users/f63d7c8b-8a9f-483f-8d3e-801edc1df73an%40googlegroups.com.
hi Charlotte,
it has always been a struggle to build cuda programs under windows. a big part of the issue is that nvidia only supports Visual Studio on windows. This makes many common libraries, such as zlib, unnecessarily difficult to install. After pouring days or even weeks of my time to get everything to work on windows as I wanted, I have to say - I hate it a lot ...
nonetheless, we know windows users compose of over 80% of the downloads of mcx, so we have to make it work.
here are a few things that we did manage to make it work
1. first, you can check out our pmcx Python module github action script written for windows
https://github.com/fangq/mcx/blob/master/.github/workflows/build_windows_wheel.yml
the default github action windows runner (pre-configured virtual
machines running on github servers) has a bunch of tools
preinstalled (see software
list), but what we need is mingw64, cmake and VS (if you
want to build mex, you need to have matlab and make mex.bat in
your PATH)
aside from those, we need the below powershell commands to
install cuda and zlib
you see that it includes some unzipping, and setting some
environment variables.
once this environment is setup, you should be able to download mcx source code, and build everything using cmake command
cd mcx/src
mkdir build && cd build
cmake ../
make
2. the above github action script was designed for only building
Python windows wheels, so it does not produce mcx/mcx.mex. I am
currently working on a separate action script to build all the
other binary packages - with a hope that it will replace
nightly-build in the future. it is not entirely working, but I
have most of the tools (octave, matlab, cuda, vs etc) set-up
complete, see my current command settings
https://github.com/fangq/mcx/blob/master/.github/workflows/build_all.yml
you can see segments of commands for system set up. I will
continue working on this, hopefully will get everything to work -
currently Linux can build with no problem, but mac/windows are
failing
https://github.com/fangq/mcx/actions/runs/4493734116/jobs/7905319784
3. both of the above two scripts were based on pre-configured github windows vm (runners), for most of our past releases and nightly builds, we have been using one of my windows machines to create binaries, our nightly build script can be found also in our source codes
https://github.com/fangq/mcx/blob/master/deploy/buildmcx.sh
this is a bash script that can run in mingw64 on windows, but some of the paths (cuda, matlab) were hard coded for my machine settings. you can try it, but very likely you will need to update all hard-coded paths. My environment variable settings were also not included in this script.
overall, it can be done, but it is difficult to be streamlined
and reproducible (due to different VS/cuda versions, software
paths settings on windows are also quite chaotic)
try it, let me know if I can be of further help.
Qianqian
Hi Dr. Fang,
Thank you for the quick reply. We will definitely try to modify the source codes and add the radiance output but for now we are struggling with the compiling steps.
We are trying to compile the mcx src from Windows 10 using Visual Studio 2017 and MinGW32.
Even after a few tweaks (manually put the folders in some failing include), we don't manage to compile, it seems that the mcx_utils.o doesn't compile:$ make mex
/usr/bin/sh: line 0: [: too many arguments
cc -std=c99 -g -Wall -Izmat -Izmat/easylzma -I/usr/local/cuda/include -Iubj -fopenmp -fPIC -DMCX_CONTAINER -DMATLAB_MEX_FILE -c -o mcx_utils.o mcx_utils.c
process_begin: CreateProcess(NULL, cc -std=c99 -g -Wall -Izmat -Izmat/easylzma -I/usr/local/cuda/include -Iubj -fopenmp -fPIC -DMCX_CONTAINER -DMATLAB_MEX_FILE -c -o mcx_utils.o mcx_utils.c, ...) failed.
make (e=2): Le fichier spÚcifiÚ est introuvable.
make: *** [Makefile:264: mcx_utils.o] Error 2Eventually, at some point, we got something related to the platform type x86 instead of x64. What do you recommend to do in this case. MingW64 doesn't seem to see the PATH updates from windows...
We also tried to compile with Visual Studio 2017 but the zlib or zmatlib is having issues with many things undeclared.
So we start being hopeless and your help would be greatly appreciated. For example, a step by step install guide to run the compilation would be helpful (the one on the website doesn't seem up to date).
Thanks a lot for your precious time,
Charlotte