Topic: Compilation under Windows

Mikael,
recentrly (for now I'm sorry I cannot be more precise on how much time...) we have strong difficulties to compile under windows from your GitHub repo.

I can list a series of code issues below:

1. MSVC does not support "__attribute__((unused))" - see classFactory.C, lines 142-175

2. there are troubles with math functions in heap.C (pow) and in other (recently added) files; argument type mismatch;

3. in grid.C the variable Inf is defined with a division by zero;

4. in intelline1intpen.C the FloatArrays are initialized with the braces, which seems to be currently unsupported in MSVC.

5.        ( I will update the list as soon I discover other things ..... )

Since in some cases I cannot understand how to correct the code to make it compile (i.e. I'm not sure what does the actual code mean in intelline1intpen.C ...), I kindly ask you to give some hints.

IMHO, it would be good if the compatibility with MSVC is preserved.

Re: Compilation under Windows

1.
I will check to see if there are any good alternatives. There probably aren't anything better than an ifdef/define hack for windows here.


2.
Whenever this happens, it usually just means that there is a missing include

#include "mathfem.h"

If you can list the scripts, I/someone will add it no problem.

3.
Yes this is poor code, it should be changed as it will probably cause undefined behavior.

4.
This is a simply fix.
I will change to this:

interp->evalN( N, FloatArray{lcoords.at(1) * 2. + 1.}, FEIElementGeometryWrapper(this) );

It's just a 1 element array (evalN always takes coordinate as a vector, but the line interpolator only has 1 coordinate).

Re: Compilation under Windows

To Borek: today I tried to update my repo with yours (the official oofem.git), but after I re-run Cmake to include the new files, there are broken references to removed functions (most of them in interpolation functions ...).
Sorry I can't be more precise than that, I immediatly reverted the pulled commits.

Does the current Git code is expected to compile or we must wait for additional modifications?
Or simply I'm messing the code and the problem is only on my side? Just to know

4

Re: Compilation under Windows

The repository version is supposed to compile and pass all tests. I have tested it on my computer and also my students use it and there seems to be no problems. Hard to say, what can be wrong, but perhaps after cmaking you could try "make clean" before compiling. If the problem persists, please attach your build log.

5 (edited by johnnyontheweb 19-12-2016 10:45:54)

Re: Compilation under Windows

Borek, thanks for the reply, we have some messing since we're mixing the original repo and Mikael's one, our fault.