Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Can't compile under MingW need to move MPFR check before GMP #59

Closed
robe2 opened this issue Sep 14, 2014 · 4 comments
Closed

Can't compile under MingW need to move MPFR check before GMP #59

robe2 opened this issue Sep 14, 2014 · 4 comments

Comments

@robe2
Copy link
Contributor

robe2 commented Sep 14, 2014

I mentioned this in PostGIS ticket - http://trac.osgeo.org/postgis/ticket/2333

The issues still persists in 1.0.5. Even though its mingw I'm trying to compile on, I read on the GMP or was it MPFR that this is an issue on other platforms. So might be more because I have custom paths for GMP/MPFR why I notice this.

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

To fix the issue, I always have to edit the src/CMakeLists.txt
changing the order of GMP and MPFR changes so MPFR gets checked before GMP like so:

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} )

@vmora
Copy link
Contributor

vmora commented Sep 15, 2014

Hi robe, would you mind sending a PR ?

@robe2
Copy link
Contributor Author

robe2 commented Sep 15, 2014

What's a PR?

@vmora
Copy link
Contributor

vmora commented Sep 15, 2014

PR: Pull Request

1 - fork this repo on your github (top right of this page), to create your own github sfcgal repo
2 - then clone your fork on your machine
3 - make your changes, test and commit your changes to your github sfcgal repo
4 - on you github repo, you will then have a "create pull request"

robe2 added a commit to robe2/SFCGAL that referenced this issue Sep 24, 2014
…ned reference to `__gmp_get_memory_functions`. Issue is described in http://www.mpfr.org/faq.html#undef_ref2 with some platforms and suggested it should always be first -  Oslandia#59
vmora pushed a commit that referenced this issue Dec 9, 2014
…ned reference to `__gmp_get_memory_functions`. Issue is described in http://www.mpfr.org/faq.html#undef_ref2 with some platforms and suggested it should always be first -  #59
@vmora
Copy link
Contributor

vmora commented Dec 9, 2014

Your PR as been merged (cherry-picked). Thanks.

@vmora vmora closed this as completed Dec 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants