[Gmsh] Version of MINGW GCC used in CYGWIN to compile?

Artur Palha artur.palha at gmail.com
Wed May 2 17:47:09 CEST 2018


Dear John,

I am sorry for not replying before I was unable to check the computer where
I did this.

This was the cmake command I managed to use:

cmake -DCMAKE_INSTALL_PREFIX=your_gmsh_install_dir
-DCMAKE_BUILD_TYPE=Release -DENABLE_BUILD_DYNAMIC=1 -DENABLE_CAIRO=0
-DENABLE_CHACO=0 -DENABLE_FLTK=0 -DENABLE_GETDP=0 -DENABLE_GMM=0
-DENABLE_GRAPHICS=0 -DENABLE_MED=0 -DENABLE_METIS=0 -DENABLE_MPEG_ENCODE=0
-DENABLE_NATIVE_FILE_CHOOSER=0 -DENABLE_NETGEN=0 -DENABLE_PETSC4PY=0
-DENABLE_OCC=0 -DENABLE_ONELAB=0 -DENABLE_ONELAB_METAMODEL=0
-DENABLE_OPTHOM=0 -DENABLE_PETSC=0 -DENABLE_PLUGINS=0 -DENABLE_POST=0
-DENABLE_POPPLER=0 -DENABLE_SALOME=0  your_gmsh_source_dir

I was getting many problems with compiling petsc and metis (although I
managed to install it with apt-cyg, so there should be a way of saying to
gmsh that petsc already is installed and to use it maybe Christophe can
clarify this).

Then I had to do the following changes in the root CMakeLists.txt file:

In this part around lines 158/165

if(APPLE)
  set(GMSH_OS "MacOSX")
elseif(CYGWIN)
  set(GMSH_OS "Windows")
  # add_definitions(-DWIN32) # recent mingw compiler doesn't define it
<--- THIS IS THE COMMENTED LINE
else(APPLE)
  set(GMSH_OS "${CMAKE_SYSTEM_NAME}")
endif(APPLE)

Then around lines 238/244

if(ENABLE_CXX11)
  # in recent cmake versions we could do e.g. set(CMAKE_CXX_STANDARD 11)
  check_cxx_compiler_flag("-std=gnu++11" STDCXX11)           <----- THIS
WAS CHANGED FROM -std=c++11 to -std=gnu++11
  if(STDCXX11)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")     <----- THIS
WAS CHANGED FROM -std=c++11 to -std=gnu++11
  endif(STDCXX11)
endif(ENABLE_CXX11)

Then for some strange reason I had to change the variable names in some
functions (_C not valid, I do not know why):

Mesh\meshGFaceLloyd.cpp

Line 846:
double _C[2]   -------> double aC[2]

Line 851:
circumcenterXY(_x1, _x2, _x3, _C)  ----->  circumcenterXY(_x1, _x2, _x3, aC)

Line 852:
C = SPoint2(_C[0], _C[1])   ----->  C = SPoint2(aC[0], aC[1])

Common\StringUtils.cpp

Around line 72

This line

cygwin_conv_to_win32_path(in.c_str(), tmp);

Had to be substituted by:

ssize_t size = cygwin_conv_path( CCP_POSIX_TO_WIN_A, in.c_str(), NULL, 0);
cygwin_conv_path( CCP_POSIX_TO_WIN_A, in.c_str(), tmp, size);

The reason being that  cygwin_conv_to_win32_path was deprecated in the
latest version of Cygwin... I found the solution somewhere online, I am not
an expert in Cygwin so do not know if there is a better alternative.

I think this is it. Let me know if this works. If not just send the error
log.

-artur palha


On Mon, Apr 30, 2018 at 7:37 PM John Staples <john.f.staples at gmail.com>
wrote:

> Greetings,
>
> I will try to replicate the messages this evening and provide description
> tomorrow.
>
> Thank you.
>
> John
>
>
> On Mon, Apr 30, 2018 at 2:38 AM, Christophe Geuzaine <geuzaine at gmail.com>
> wrote:
>
>>
>> Hi John,
>>
>> We currently use Mingw GCC 5.4.0. What kind of errors do you get?
>>
>> Christophe
>>
>> > On 30 Apr 2018, at 05:21, John Staples <john.f.staples at gmail.com>
>> wrote:
>> >
>> > Greetings,
>> > I remember seeing that the MINGW GCC-4.5.3 compiler in CYGWIN shell
>> was used to compile GMSH for windows.  I'm experiencing  numerous warnings
>> and now errors trying to compile with the latest version of GCC avail with
>> the CYGWIN installation.  Just was wondering if I'm using too recent a
>> version?
>> >
>> > Regards,
>> > John
>> > _______________________________________________
>> > gmsh mailing list
>> > gmsh at onelab.info
>> > http://onelab.info/mailman/listinfo/gmsh
>>
>>
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20180502/0d8709ff/attachment.html>


More information about the gmsh mailing list