Compilation of source code in Cygwin (Windows 10)
Hi, I am trying to compile GetDP source code (version 3.5.0) in Cygwin (version 3.3.6-1 on a Windows 10 system) with PETSc (with serial MUMPS), SLEPc, Python 3.9 (in Cygwin) and a minimal Gmsh library (without GUI and other features). I don't want MPI for the moment. The shell script that I am using is attached here myconf_getdp_cygwin.sh.
All the needed libraries (PETSc with serial MUMPS, SLEPC and Gmsh) have been successfully compiled within Cygwin using Cygwin 64-bit GNU compilers, namely gcc.exe, g++.exe and gfortran.exe, with their toolchain x86_64-pc-cygwin.
So, as first attempt, I tried to compile also GetDP with the same compilers. The CMake configuration was good, but then I got the following error at the very last stage of the building procedure (make
), while linking the executable getdp.exe (linking to what? which libraries? ...):
[100%] Linking CXX executable getdp.exe
g++: error: unrecognized command-line option ‘-municode’
make[2]: *** [CMakeFiles/getdp.dir/build.make:2013: getdp.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:222: CMakeFiles/getdp.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
I found that a guy had the same issue (trying to compile another software) here (stackoverflow), but I don't understand how he fixed it. I have asked there and I am waiting for an answer.
Searching in the net, I discovered that the problem is that the toolchain of the compilers (in this case x86_64-pc-cygwin) does not implement the UNICODE feature (sourgeforce-mingw-w64). So, I decided to try with the MINGW-w64 compilers available within Cygwin. In this case, the building process stops at the beginning due to many conflicting declaration errors and included files not found. This issue is related to the compilation of Python.h within Cygwin, thus I disabled the PYTHON option for GetDP in cmake (even if I want it!). Howevere, the building process gives errors again during the very last stage (linking executable getdp.exe). This time the error messagge is different (skipping incompatible files???):
[100%] Linking CXX executable getdp.exe
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: cannot find -llapack: No such file or directory
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lblas: No such file or directory
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: cannot find -ldl: No such file or directory
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/i686-w64-mingw32/sys-root/mingw/lib/libm.a when searching for -lm
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/i686-w64-mingw32/sys-root/mingw/lib/libadvapi32.a when searching for -ladvapi32
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/i686-w64-mingw32/sys-root/mingw/lib/libshell32.a when searching for -lshell32
...many similar ...
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/i686-w64-mingw32/sys-root/mingw/lib/libkernel32.a when searching for -lkernel32
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/getdp.dir/build.make:2007: getdp.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:222: CMakeFiles/getdp.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
I would like to compile with the Cygwin 64-bit GNU compilers, as I used them also to build all the needed libraries ad they don't complain about Python.h, but I don't know how to enable the -municode command in their toolchain. I don't even know if it is possible. Are there any ways to fix this problem?
Alternatively, how can I manage the building process with the MINGW-w64 compilers within Cygwin, also enabling python in cmake configuration?
I am quite sure that this is a compiler-related issue, but I decided to post it anyway, with the hope that someone can help me.