Menu

#292 Windows mingw build failure

new
None
normal
major
Always
minor-fix
nextRelease
Bug
Windows 8.1
3.2
other
2015-10-20
2015-10-16
Paul
No

Build fails almost completely. See attached Allwmake.log for details. Should I be doing something different here? I followed the build notes to the tee.

1 Attachments

Discussion

  • Paul

    Paul - 2015-10-16

    Attached ThirdParty/mingw/build.log

     
  • Paul

    Paul - 2015-10-16

    Attaching createWindowsBinaryPackage.log

     
  • Hrvoje Jasak

    Hrvoje Jasak - 2015-10-16

    Can you please specify compiler type and OS. It looks like you are building 32-bit and we are missing an ifdef. If you want to try and hack it, please go to Hash.H and comment out second specialisation on line 101.

    Hrv

     
  • Martin Beaudoin

    Martin Beaudoin - 2015-10-16

    I have the exact same error messages while compiling on a 32-bit Arch Linux platform.
    Using gcc 5.2.0, which might play a role here too.

     
  • Paul

    Paul - 2015-10-16

    OS type is Windows 8.1 64-bit
    compiler is mingw-w64 (https://sourceforge.net/projects/mingw-w64/)
    Did I get the wrong compiler?

     
  • Martin Beaudoin

    Martin Beaudoin - 2015-10-18

    The trick for me was to move the definition of

    template<> class Hash<Foam::label>

    ahead of the definition of

    template<> class Hash<void*>

    in Hash.H

    The compilation is going fine now...
    Still trying to figure it out though...

     

    Last edit: Martin Beaudoin 2015-10-18
  • Martin Beaudoin

    Martin Beaudoin - 2015-10-18

    Ok. Got it. On a 32-bit platform, we have:

    typedef int intptr_t;
    typedef int Foam::label

    So before we can instantiate a Hash<intptr_t> in the definition of template<> class Hash<void*>, we need to make sure the specialized template Hash<Foam::label> (or Hash<int>) is defined first.

    So on a 32-bit platform, the definition of template<> class Hash<Foam::label> has to come before template<> class Hash<void*>.

    This is why the compiler is complaining with this error message : error: specialization of 'Foam::Hash<int>' after instantiation, which is exactly what we have with the current code.

    Luckily, the fix is very simple. Just swap the two class specializations in Hash.H

    Martin

     
  • Paul

    Paul - 2015-10-19

    I'm trying to compile to a 64 bit platform. g++ -v returns

    Using built-in specs.
    COLLECT_GCC=c:\tools\mingw64\bin\g++.exe
    COLLECT_LTO_WRAPPER=c:/tools/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.3/lto-wrapper.exe
    Target: x86_64-w64-mingw32
    Configured with: ../../../src/gcc-4.8.3/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw483/x86_64-483-posix-seh-rt_v3-rev0/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw483/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw483/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw483/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw483/prerequisites/x86_64-w64-mingw32-static --with-cloog=/c/mingw483/prerequisites/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw483/x86_64-483-posix-seh-rt_v3-rev0/mingw64/opt/include -I/c/mingw483/prerequisites/x86_64-zlib-static/include -I/c/mingw483/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw483/x86_64-483-posix-seh-rt_v3-rev0/mingw64/opt/include -I/c/mingw483/prerequisites/x86_64-zlib-static/include -I/c/mingw483/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw483/x86_64-483-posix-seh-rt_v3-rev0/mingw64/opt/lib -L/c/mingw483/prerequisites/x86_64-zlib-static/lib -L/c/mingw483/prerequisites/x86_64-w64-mingw32-static/lib'
    Thread model: posix
    gcc version 4.8.3 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 
    
     

    Last edit: Paul 2015-10-20
  • Paul

    Paul - 2015-10-19

    That change doesn't fix it for me. I moved template<> class Hash<Foam::label> above template<> class Hash<void*>, and I still get the specialization before instantiation error.

    Edit: I neglected the lnInclude/Hash.H, and changed it. That prevented that specific error, but didn't correct the many others I had.

    Again, am I missing something big here? Shall I post my prefs.sh.mingw and bashrc.mingw?

     

    Last edit: Paul 2015-10-19
  • Martin Beaudoin

    Martin Beaudoin - 2015-10-19

    Indeed, the modification I am suggesting will only affect 32-bit platforms. The Windows port is still targeting a 64-bit platform by default.

    When I worked on adapting the testHarness for the Windows platform, I had no problem with the compilation of foam-extend.

     
  • Paul

    Paul - 2015-10-20

    Thanks for your work, Martin. I believe that I followed the instructions in doc/buildInstructions/Windows/README.txt.
    Attached are the results of sourcing bashrc.mingw.

    Perhaps the issue here has been spaces in actual install directories. I used mklink to create no-space links, but perhaps that doesn't work.
    Edit: I don't think the spaces in original locations are the issue here.

     

    Last edit: Paul 2015-10-20

Log in to post a comment.