[postgis-tickets] [PostGIS] #2333: Can't compile under mingw64 (neither mingw64 or mingw32)
PostGIS
trac at osgeo.org
Wed Jun 4 22:48:18 PDT 2014
#2333: Can't compile under mingw64 (neither mingw64 or mingw32)
--------------------+-------------------------------------------------------
Reporter: robe | Owner: colivier
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.2.0
Component: sfcgal | Version: trunk
Keywords: |
--------------------+-------------------------------------------------------
Comment(by robe):
Bah for some reason I can't submit a ticket to github on SFCGALwith my
patch. submit button is disabled. I could be imagining things.
Anyrate. Just tried compiling sfcgal on my mingw-w64 64-bit gcc 4.8.0 and
ran into same issue during link phase:
{{{
Linking CXX shared library libSFCGAL.dll
c:/ming64gcc48/projects/CGAL/rel-
mpfr-3.1.2w64gcc48/lib/libmpfr.a(init2.o):init2.c:(.text+0x70): undefined
reference to `__gmp_get_memory_functions'
c:/ming64gcc48/projects/CGAL/rel-
mpfr-3.1.2w64gcc48/lib/libmpfr.a(clear.o):clear.c:(.text+0x1e): undefined
reference to `__gmp_get_memory_functions'
c:/ming64gcc48/projects/CGAL/rel-
mpfr-3.1.2w64gcc48/lib/libmpfr.a(div.o):div.c:(.text+0x234): undefined
reference to `__gmpn_divrem'
c:/ming64gcc48/projects/CGAL/rel-
mpfr-3.1.2w64gcc48/lib/libmpfr.a(round_prec.o):round_prec.c:(.text+0xa76):
undefined reference to `__gmp_get_memory_functions'
c:/ming64gcc48/projects/CGAL/rel-
mpfr-3.1.2w64gcc48/lib/libmpfr.a(mulders.o):mulders.c:(.text+0x5c2):
undefined reference to `__gmpn_divrem'
c:/ming64gcc48/projects/CGAL/rel-
mpfr-3.1.2w64gcc48/lib/libmpfr.a(mulders.o):mulders.c:(.text+0x94c):
undefined reference to `__gmpn_divrem'
c:/ming64gcc48/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
c:/ming64gcc48/projects/CGAL/rel-
mpfr-3.1.2w64gcc48/lib/libmpfr.a(mulders.o): bad reloc address 0x0 in
section `.pdata'
collect2.exe: error: ld returned 1 exit status
}}}
I was able to fix by changing the src/CMakeLists.txt file packaged with
sfcgal 1.0.4 by swapping the order of MPFR and GMP (basically moving MPFR
above GMP)
So changing from
{{{
if( ${SFCGAL_WITH_GMP} )
target_link_libraries( SFCGAL ${GMP_LIBRARIES} )
endif( ${SFCGAL_WITH_GMP} )
if( ${SFCGAL_WITH_MPFR} )
target_link_libraries( SFCGAL ${MPFR_LIBRARIES} )
endif( ${SFCGAL_WITH_MPFR} )
}}}
To:
{{{
if( ${SFCGAL_WITH_MPFR} )
target_link_libraries( SFCGAL ${MPFR_LIBRARIES} )
endif( ${SFCGAL_WITH_MPFR} )
if( ${SFCGAL_WITH_GMP} )
target_link_libraries( SFCGAL ${GMP_LIBRARIES} )
endif( ${SFCGAL_WITH_GMP} )
}}}
I'll close this out once I've successfully posted the issue to github
sfcgal issue tracker.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2333#comment:10>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list