OpenXcom Forum

Contributions => Builds & Ports => Topic started by: Xtendo-com on April 09, 2016, 07:30:51 pm

Title: Advice for choosing the compilation way
Post by: Xtendo-com on April 09, 2016, 07:30:51 pm
In UFOpaedia (https://www.ufopaedia.org/index.php/Compiling_%28OpenXcom%29) there are several ways to compile openxcom. As windows user, you can use an IDE Visual Studio or a compiler MinGW with some batch scripts or use a virtual machine with GNU/Linux distributive. As I understand developers of OXC uses a visual studio 2010 or 2013, but OXCE or OXCE+ a visual studio 2015.

Questions:
Q) Is there are any advantage to use complicated MinGW way to compile? Or complicated way like compile window binary in GNU/Linux?
A) Yes, that way compiles a executable file with less dependencies and less additional files than visual studio. More details (https://openxcom.org/forum/index.php/topic,4502.msg61934.html#msg61934)
I tried to make compile environment process of window binary less complicated in GNU/Linux using Xubuntu 14.04 LTS. You can download scripts here (https://openxcom.org/forum/index.php/topic,4502.msg62089.html#msg62089).

Q) Is there are a reason to use a newest version of VS if an old version can complete a task?
A) In order to compile OXC there are no special reason to use newest version, but you can't compile OXCE or OXCE+ without rewriting the code.

Q) If I want to compile OXCE or OXCE+ without spending time to re-adaptation to VS 2010 I need a visual studio 2015?
A) Yes, because VS2015 supports C++11 that is used in these forks.

Q) In UFOpaedia there are no precompiled dependencies for VS2015
A) Check this (https://openxcom.org/forum/index.php/topic,4416.msg60554.html#msg60554). Read carefully, because these dependencies are not enough to make a successfully build.
Title: Re: Advice for choosing the compilation way
Post by: Meridian on April 09, 2016, 07:42:31 pm
OXCE and OXCE+ cannot be compiled on visual studio 2010 or 2013 anymore, because they don't support C++11, which is required.

Compilation under something else than visual studio 2015 has the advantage that it (the result) works for everyone, not only for 98% of people.

If it however works for you, feel free to compile on visual studio 2015... I do that for myself too; and only compile differently when I want to share it publicly.
Title: Re: Advice for choosing the compilation way
Post by: yrizoud on April 09, 2016, 08:35:53 pm
Mingw is completely free and open.
Visual Studio is expensive, so you can either find a special offer (I heard it can be free for students) or get the "Express" version which has some limitations - I don't know which ones, I work as a developer and my employer pays for the full versions.
Title: Re: Advice for choosing the compilation way
Post by: Yankes on April 09, 2016, 09:06:52 pm
Mingw is completely free and open.
Visual Studio is expensive, so you can either find a special offer (I heard it can be free for students) or get the "Express" version which has some limitations - I don't know which ones, I work as a developer and my employer pays for the full versions.
Express is now community edition that is exactly same as normal paid version. IIRC up to 5 developer VS is free, after that you need buy it normally.
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 09, 2016, 09:35:34 pm
Now I understand that I need VS2010 or VS2013 for OXC and VS2015 for OXCE or OXCE+ if I don't want to spend hours and days in order to setup a compilation system that works fine with current project and forks. We can download a community edition of VS2010 and VS2015, so there are no reason to use a complicated GNU/Linux way to compile a windows binary.

and only compile differently when I want to share it publicly.
What a difference you mean? Is it a code changes or project setting that provides maximum running compatibility with old OS like WinXP?
Title: Re: Advice for choosing the compilation way
Post by: Meridian on April 09, 2016, 09:43:49 pm
What a difference you mean?

When I compile under vs2015... I get:
1. one EXE
2. and a bunch of DLLs
3. and a prerequisite for MSVC++15 32-bit which people have to download and install
4. and even then it doesn't work for everyone...

When I compile under Mingw, I get one single EXE and nothing else... that's it... and it works for everyone so far.
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 09, 2016, 10:17:57 pm
When I compile under Mingw, I get one single EXE and nothing else... that's it... and it works for everyone so far.
From this point of view MinGW looks more interesting. Do you apply any code changes to source when you try to compile the code with MinGW after working in VS2015?
Title: Re: Advice for choosing the compilation way
Post by: Meridian on April 09, 2016, 10:33:55 pm
From this point of view MinGW looks more interesting. Do you apply any code changes to source when you try to compile the code with MinGW after working in VS2015?

No, the source code is exactly the same.
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 10, 2016, 10:24:57 am
Modified a main post with question answered.
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 11, 2016, 06:25:52 am
A method where Yankes or Meridian uses Makefile.mxe (https://openxcom.org/forum/index.php/topic,2915.msg61144.html#msg61144) in order to build windows binary in GNU/Linux also works with usually OXC without source code modifications, if you downgrade yaml-cpp to 0.5.1 and include boost library (current version 1.60.0 works fine).
Also since the only reason to use C++11 was yaml-cpp, I think that by downgrading yaml-cpp to 0.5.1 you can compile OXCE and OXCE+ in old visual studio.
Title: Re: Advice for choosing the compilation way
Post by: Meridian on April 11, 2016, 10:24:53 am
Also since the only reason to use C++11 was yaml-cpp, I think that by downgrading yaml-cpp to 0.5.1 you can compile OXCE and OXCE+ in old visual studio.

Why do you think it's only yaml-cpp?
OXCE uses C++11 too...
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 11, 2016, 02:29:48 pm
Why do you think it's only yaml-cpp?
OXCE uses C++11 too...
Just blind belief after reading about yaml-cpp updates (fixed my post to prevent mislead), but I didn't check that since I only preparing compile environment in xubuntu and I didn't tried to compile with visual studio.

Later I will attach some scripts that automatically prepares compile environment in xubuntu 14.04 LTS (download sources, prepares necessary packages and etc). May work in other editions like ubuntu, kubuntu and etc, since the only difference is desktop environment, but I didn't check. Includes OXC, OXCE and OXCE+ and you can compile windows binary from the start.
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 11, 2016, 07:05:30 pm
Later I will attach some scripts that automatically prepares compile environment in xubuntu 14.04 LTS (download sources, prepares necessary packages and etc). May work in other editions like ubuntu, kubuntu and etc, since the only difference is desktop environment, but I didn't check. Includes OXC, OXCE and OXCE+ and you can compile windows binary from the start.
1) Scripts has comments inside. Read them.
2) Execute script with terminal in order to see output.
3) Output directory - %your home directory%/Project
Title: Re: Advice for choosing the compilation way
Post by: Yankes on April 11, 2016, 07:34:50 pm
btw, default configuration of sdl_mixer in mxe don't have enabled flat file formats, if someone want it I have commit that enable it:
https://github.com/Yankes/mxe
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 11, 2016, 10:42:46 pm
btw, default configuration of sdl_mixer in mxe don't have enabled flat file formats, if someone want it I have commit that enable it:
https://github.com/Yankes/mxe
Usually open source software don't include formats like mp3 by default but this something new... flac is open source... strange.

Also... I forget to thank everybody who payed attention to my posts. Now I will try to fork but no sure what. OXC or extended? Not sure. My aim is to include more advanced options that already implemented by community but never used, like advanced scanner (https://openxcom.org/forum/index.php/topic,2391.0.html), throw trajectory (https://openxcom.org/forum/index.php?topic=1532.0), manual control of civilians (https://openxcom.org/forum/index.php/topic,3553.msg42680.html#msg42680) and etc. So you will get tons of experimental user decide options.
Title: Re: Advice for choosing the compilation way
Post by: Meridian on April 11, 2016, 10:49:09 pm
Now I will try to fork but no sure what. OXC or extended? Not sure. My aim is to include more advanced options that already implemented by community but never used, like advanced scanner (https://openxcom.org/forum/index.php/topic,2391.0.html), throw trajectory (https://openxcom.org/forum/index.php?topic=1532.0), manual control of civilians (https://openxcom.org/forum/index.php/topic,3553.msg42680.html#msg42680) and etc. So you will get tons of experimental user decide options.

You can only fork OXC... you cannot fork Extended, because it is already a fork... thanks Github.

Anyway, fork whatever YOU want... people will either like it or not. Btw. I will be looking at throw trajectory and motion scanner in oxce+ too, soon.
Title: Re: Advice for choosing the compilation way
Post by: DoxaLogos (JG) on April 11, 2016, 11:49:31 pm
You can only fork OXC... you cannot fork Extended, because it is already a fork... thanks Github.


Actually, I think you can "fork", but it's using git itself to implement it by adding remote repos.  It's outside of Github for adding another fork of the same repo.  I did this while working on Shoe's fork before it was merged upstream.  I had forked OXC and then added his fork as a another remote repo to my fork and pulled it into a branch.
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 12, 2016, 11:15:44 am
Thanks, I will try to learn git features before implementing anything else. My unoriginal nickname was already taked in github, so I changed my nickname to someone else.
Title: Re: Advice for choosing the compilation way
Post by: Xtendo-com on April 16, 2016, 07:24:46 am
I will be looking at throw trajectory and motion scanner in oxce+ too, soon.
motion scanner easy to include using this diff (https://github.com/redv/OpenXcom/commit/892a3caace0fa8b17a1e8c8ea466acc0abeea87b) but not easy to fix issue (https://openxcom.org/forum/index.php/topic,2391.msg62151.html#msg62151) that spoil a level since it uses a render code that checks title by title, level by level "if current title contain unit" and "if unit is scanned in that turn", so I'm trying to found a way to manually change level to lowest for rendering scan result in battlescape.

Fixed (https://github.com/Xtendo-com/OpenXcom/commit/4403417635bcaeac17cc694a26464781708272e0), but spends more not necessary cycles.