How to install MARS on a Windows PC.

Frequently asked questions

How to install MARS on a Windows PC.

Postby zhouxinwei » Tue Aug 22, 2017 8:00 pm

The Windows version currently only supports Open MP parallelization. MPI may be supported in the future.

The MARS windows library is compiled using Visual Studio 2017 Community on Windows 7. You also need a c++ compiler to build the final executable.

Step 1: Get Visual Studio 2017 Community (Free).

Download page: https://www.visualstudio.com/downloads/.

The default c++ compiler provided by Visual Studio is Visual C++ compiler (cl.exe).

Step 2: Download MARS library for Windows from our website.

Download page: http://mars.es3inc.com/protected/MARS/.

Step 3: Compile MARS.

Once we have the MARS library package, unzip it.

We have two options to compile MARS: 1) compile from command line; 2) use Visual Studio.

Option 1) is the recommended if you only use the standard MARS without developing user defined code.
Option 2) is the recommended if you intend to develop and debug user defined features.

Step 3.1: Compile MARS from the command line.

Once Visual Studio is installed, go to Windows Start Menu, find Develop Command Prompt for VS 2017 and click it. A command line window will start (with proper environmental variables initialized), and the Visual C++ compiler (cl.exe) becomes available.

Use cd command, change current folder to where the unzipped files, from the MARS library package, are located.

Use
Code: Select all
 nmake -f Makefile
to compile the debug version.

Use
Code: Select all
nmake -f Makefile OMP=1
to compile the OpenMP version

If the compilation succeeds, we will see marsD.exe (debug version) and marsO.exe (OpenMP version) under current folder.

Step 3.2: Compile MARS using Visual Studio.

Start Visual Studio, in its menu, choose File -> New -> Project. A new window pop up:
new_project.png
new_project.png (101.58 KiB) Viewed 7951 times

On the left, choose General under Visual C++; on the right, choose Empty Project. Name the project (e.g. mars). Uncheck "Create directory for solution". Click OK.

Now, open the folder where the Visual Studio project locates, and create a folder structure like below:
folder_structure.png
folder_structure.png (38.33 KiB) Viewed 7951 times

Unzip the MARS library package into folder MarsLib; put your user.cpp (or the one from the MARS library package if you don't have one) with other source files into folder src.

In Visual Studio, on the left, we see a solution called 'mars' is created in the Solution Explorer, right click mars, choose Add -> Existing Item..., choose proper files from MarsLib and src, so we have:
solution_structure.png
solution_structure.png (105.05 KiB) Viewed 7950 times


Right click Solution 'mars', choose Properties, a window like below will pop up.
property_window.png
property_window.png (163.42 KiB) Viewed 7951 times

We need to change several settings in the Configuration Properties.
  • Under C/C++ -> General, add MarsLib to Additional Include Directories.
  • Under C/C++ -> Preprocessor, add _CRT_SECURE_NO_WARNINGS to Preprocessor Definitions.
  • Under C/C++ -> Code Generation, set Runtime Library to Multi-threaded (/MT).
  • Under Linker -> Input, add Ws2_32.lib to Additional Dependencies.
  • Under Linker -> System, set SubSystem to Console (/SUBSYSTEM:CONSOLE).

Now, we should be able to build the final executable of MARS in Visual Studio (Build Menu -> Build Solution, or press F7).

Step 4: Set up Path environment variable.

In order to run MARS under any folder, we need to add the MARS executables to the Path environment variable.

First, locate the MARS executables, then follow the steps here: https://www.computerhope.com/issues/ch000549.htm.

Step 5: Get TetGen and Triangle.

Precompiled TetGen and Triangle can be downloaded from http://mars.es3inc.com/protected/MARS.

Follow step 4 and add them to Path so MARS can find them.

Step 6: Set up license.

You need to contact ES3 for a license file. When contacting us, please provide the MAC address of the ethernet adapter. See instructions here about finding MAC address on Windows: https://www.lifewire.com/finding-ip-mac ... ows-816525.

Once you have the license file, create an environment variable named MARS_LICENSE_PATH with the value being the absolute path of the license file (e.g. C:\mars_license.lic).

Step 7: Run MARS.

Similar to Mac and Linux, we can run MARS in command-line mode. First, go to Windows Start Menu, run cmd.exe, use cd command to change current folder, then execute MARS from the command line prompt (e.g. marsO -B run.mrs).

If MARS is built using Visual Studio, and we want to run MARS from there, in Visual Studio we need to set up Command Arguments (e.g. -B run.mrs) and Working Directory (where input files locate) under Configuration Properties / Debugging.
zhouxinwei
 
Posts: 208
Joined: Thu Jul 09, 2015 7:12 pm

Return to FAQs

Who is online

Users browsing this forum: No registered users and 1 guest

cron