Table of Contents
|
EnhSim is programmed in C++ and it can be built to other platforms, as well as Windows. By default, EnhSim package includes Windows executables, which are ready to run. These ready built executables need SSE2 support from CPU. If you need to build EnhSim yourself, this page might be of some use to you.
Compile flags
HAVE_SSE2
SFMT will make use of SSE2 instructions if defined.
HAVE_ALTIVEC
SFMT will make use of AltiVec instructions if defined.
DEBUG
EnhSim executable will output combatlog.
NOTHREADS
Disable multithreading. This way you can avoid using ZThreads.
3rd party libraries
EnhSim uses ZThreads, SFMT and Boost Pool libraries. You need to build ZThreads and link it with EnhSim to succesfully build EnhSim. SFMT and Boost Pool are include only libraries. SFMT is already included in the EnhSim source, so you need to download Boost library and setup your compiler to find it.
Windows
Todo.
Linux
Todo.
Mac
This method uses the NOTHREADS compile flag, so you will get the single threaded version. If you know how to build with ZThreads, go ahead and be sure to contact me with the information :). This guide is courtesy of Malan.
- Invoke xCode (install from OS X cds under Developer Tools if you don't have it).
- Start a new project(Command Line Utility -> C++ Tool) (the name of the project will by default be the name of the binary that you have to run, so be concise). Immediately delete the main.cpp file when the project appears.
- Right click in the left panel of xCode on the name of the project and choose Add -> Existing Files, then browse to the source code for EnhSim and choose all the files, including the SFMT subdirectory.
- In the list of source files in xCode, un-check the box in the right-most column next to the test.c and SFMT.c files so that these are not included in the build.
- Edit the file enhsim.h (double click it) and add the text "#define NOTHREADS", then save the file. (CMD-S).
- In finder, unpack and then copy Boost (Should appear as something like 'boost_1_37_0' when unpacked) directly to the project path that you created in xCode. Do not do this *in* xCode, do it in Finder.
- In the main menu choose Project -> Edit Project Settings then the Build tab. Scroll down till you see the header that says "Search Paths". Double click the entry for "Header Search Paths", and in the dialog use the + button to add a new path. You must ensure that the 'Recursive' checkbox is cleared or the build will fail. Type in the relative path to the Boost folder you copied, it should look like: "boost_1_37_0" and then close the menu.
- In xCode choose Build. When its complete your binary executable for the sim will appear in [path to project]/[project name]/build/Release. You can copy the binary file to anywhere else in the system so that you can run it in Terminal with your config file.
You can run enhsim.exe in linux using wine.
My configs.
Ubuntu 8.10 Intrepid
Wine 1.1.10
Enhsim 1.5.0
Command line:
wine enhsim.exe config_lvl80.txt
I just run the command line. When I try to use the gui I get the error that said I need install the mono. If anyone know how to run .NET with wine, I'd like to know. So. cya.. bye
This method uses the NOTHREADS compile flag, so you will get the single threaded version. If you know how to build with ZThreads, go ahead and be sure to contact me with the information :). This guide is courtesy of Malan. Edited by ONebulus.
Invoke xCode (install from OS X cds under Developer Tools if you don't have it).
xCode resides in /Developer/Applications/Xcode.app and can be "invoked" with open /Developer/Applications/Xcode.app (or double click the icon XD )
Start a new project(Command Line Utility -> C++ Tool) (the name of the project will by default be the name of the binary that you have to run, so be concise). Immediately delete the main.cpp file when the project appears.
When deleting the main.cpp file you will be prompted… select delete files.
Right click in the left panel of xCode on the name of the project and choose Add -> Existing Files, then browse to the source code for EnhSim and choose all the files, including the SFMT subdirectory.
Be sure to select recursive when prompted.
In the list of source files in xCode, un-check the box in the right-most column next to the test.c and SFMT.c files so that these are not included in the build.
Edit the file enhsim.h (double click it) and add the text "#define NOTHREADS", then save the file. (CMD-S).
In finder, unpack and then copy Boost (Should appear as something like 'boost_1_37_0' when unpacked) directly to the project path that you created in xCode. Do not do this *in* xCode, do it in Finder.
For me this was already unpacked and residing as /boost within the enhsim folder. Copy it as directed above. Same folder as your xCode /build folder appears in… (you just chose the path for the xCode project)
In the main menu choose Project -> Edit Project Settings then the Build tab. Scroll down till you see the header that says "Search Paths". Double click the entry for "Header Search Paths", and in the dialog use the + button to add a new path. You must ensure that the 'Recursive' checkbox is cleared or the build will fail. Type in the relative path to the Boost folder you copied, it should look like: "boost_1_37_0" and then close the menu.
For me= Project-> Edit Project Settings -> Build Tab -> Collection selection = Search Paths. Double click "header Search Paths' Remove the path listed with the "-". Now to grab the proper path: Drag your xcode build folder from finder to the open "header search paths" options window … It will display the proper path ( "$(SRCROOT)/" in my case, this is likely universal). Now, DO click the recursive box. Close the menu.
In xCode choose Build. When its complete your binary executable for the sim will appear in [path to project]/[project name]/build/Release. You can copy the binary file to anywhere else in the system so that you can run it in Terminal with your config file.
For me the binary file ended up in a folder entitled Debug within folder Build. I opened a terminal window, dragged enshshammy into the terminal window, then dragged the txt file config.txt into the terminal window, hit enter and after a bit it reported data! Woot.
Edit the Config.txt file in text editor to match your shammy's stats.
trying to compiling EnhSim 1.5.8 on OSX, boost 1.38.0
I followed the Onebulus' instructions, but I get the following errors when building:
error: 'snprintf' is not a member of 'std'
in both consumables.cpp and effects.cpp
this is the incriminated line
I have no clue how to fix your error. I wish we had a place to just upload the OS X compiled version of this handy sim program.
ONebulus, if you want to upload OS X version to Google Code I can give you permissions to do that. Contact me with email.
I managed to get it to compile on mac. I followed ONeb's instructions, but when it didn't work I fiddled around with the Header thing and found the issue. It seems one of the files referenced is included in the "boost" folder included in the enhsim source folder but not in the boost_1_38_0 or whatever. So I copied it over. Problem solved. So here's a step-by-step.
In the main menu choose Project -> Edit Project Settings then the Build tab. Scroll down till you see the header that says "Search Paths". Double click the entry for "Header Search Paths".
Now, add 2 new entries with the + button. For the first, double click under the path heading and type "$(SRCROOT)/build" (with the quotes) and check the recursive box. For the second, type "$(SRCROOT)/boost_1_38_0" and make sure recursive is cleared.
Next, in Finder, copy the "config" file from (your project name)/boost or (enhsim source file)/boost to (your project name)/boost_1_38_0/
Click build in XCode and enjoy as it WORKS. YES, IT WORKS. I assume it works right, but I'm not sure. I can't double check, but if someone can side-by-side it with the windows release that would be epic. Thanks to all of you for making this project possible, and let's hope it works. Power to the mac people!
Many thanks, it worked.
Since version 1.5.6, I included the necessary boost files in the package. Guide hasn't been updated to these changes, but what it means is you shouldn't have to pay attention to boost at all, no downloading etc. Could someone test does it actually work? I tried to include only the necessary boost files, but haven't tested it on other systems than mine (Vista/Visual C++).
I was having issues building it, it seems that you need to include the Boost folder contained in the overall folder (I.E. boost_1_38_0/boost) in order to build properly. It is a large folder (about 40 mb), and you prob don't need it all, so open it up, take what you need, and include that in the next build. In the mean time, update this page.
INSTRUCTIONS:
Open XCode
Start a new project(Command Line Utility -> C++ Tool)
Immediately delete the main.cpp file when the project appears.
Right click the project in XCode, Add -> Existing Files, open the "source" folder for EnhSim and choose all the files.
Un-check the box next to the SFMT.c.
Double click Enhsim.h, type "#define NOTHREADS"
From the main menu bar, Project -> Edit Project Settings->Build
Scroll down to "Search Paths" and double click "Header Search Paths"
Drag your [project]/build and [project]/boost folders onto the window.
Check the box next to build, and make sure the box next to boost is unchecked.
Choose build, your executable will build to [project]/build/Release
To run your executable, open terminal, drag your executable file onto the terminal window, then your config file.
Updates:
I eliminated at least some unnecessary files from boost, taking it down to only 2 or so MB.
(link) http://uploading.com/files/XTIWMTBP/boost.zip.html
I posted a youtube screencast of how to compile it on mac if my written instructions were unclear.
(link) http://www.youtube.com/watch?v=SwLeq4oWlSk
I have started working on a GUI for Mac users based directly on the windows version. It's not done visually and none of the code is written, but it should be done as soon as I learn cocoa.
http://img12.imageshack.us/img12/3993/picture3s.png
http://img13.imageshack.us/img13/3695/picture4a.png
http://img7.imageshack.us/img7/6505/picture5r.png
http://img18.imageshack.us/img18/8458/picture6c.png
http://img8.imageshack.us/img8/59/picture7p.png
http://img9.imageshack.us/img9/6510/picture8r.png
http://img19.imageshack.us/img19/1236/picture10g.png
http://img12.imageshack.us/img12/851/picture11b.png
Not sure what I'm doing wrong here. Even after a fresh install of xCode (3.1.2), fresh EnhSim (1.5.9.1), and following the YouTube instructional, I still have the compile fail with 51 errors and 5 warnings, which is actually better than the 72 errors I was getting when I followed the original instructions. Anyway, I'm going to see if I can't get this thing to work using CrossOver.
Post preview:
Close preview