-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MPIR:x64-linux] build failure (static linking) #13827
Comments
@amakhno, thanks for reporting this issue! The x64-linux triplet default is static. Relate to upstream issue wbhart/mpir#286 Failure |
@PhoebeHui , Do have any ideas on how to deal with this problem? If I change the MPIR portfile.cmake to: (add -fPIC) string(APPEND VCPKG_CXX_FLAGS " -Wno-implicit-function-declaration -fPIC") It changes nothing So I also changed the dependencies of MPFR and CGAL to GMP but there is no real difference in the result
|
@amakhno Could this be coming from the
I know mpir provides some gmp headers but I think it uses different lib names? |
No, when you build mpir it also creates libgmp* libraries (for compatibility, probably) I've found a stupid workaround for using the system GMP from libgmp3-dev. After installation of all dependencies I manually (bash script) remove all gmp/mpir files from With CMake files generation I have CGAL static references to VCPKG and a dynamic reference to GMP in PATH There are also dozens of the same GMP bug reports (__gmp_binvert_limb_table) online, but the only workaround I've found is using dynamic linking. This means that I cannot build CGAL even with GMP using vcpkg easily. |
hmmm interesting:
Strange that they don't do that for Windows builds ¯\_(ツ)_/¯
As you filed a defect report upstream let's see what they do with it. |
Any info on when this will be resolved? |
@one-thunder It's reported upstream as wbhart/mpir#286 |
I was able to reproduce your issue, with diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake
index b4acb3047..2138744fc 100644
--- a/ports/gmp/portfile.cmake
+++ b/ports/gmp/portfile.cmake
@@ -49,6 +49,7 @@ vcpkg_configure_make(
OPTIONS
${OPTIONS}
--enable-cxx
+ --with-pic^M
)
set(tool_names bases fac fib jacobitab psqr trialdivtab)
diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json
index 8393feed1..12a6e0d43 100644
--- a/ports/gmp/vcpkg.json
+++ b/ports/gmp/vcpkg.json
@@ -1,7 +1,7 @@
{
"name": "gmp",
"version": "6.2.1",
- "port-version": 9,
+ "port-version": 10,
"description": "The GNU Multiple Precision Arithmetic Library",
"homepage": "https://gmplib.org",
"supports": "!(windows & (arm | arm64))", @PhoebeHui Do you think that patch would be acceptable? |
I don't believe that is correct: switches like |
(Also, if it's anything related to gmp, it is not this bug.) |
You are right. And actually |
I have tried to add I have created a new pull-request #25209 that adds I have verified that this issue #13827 is fixed, on Linux. |
Host Environment
To Reproduce
Steps to reproduce the behavior:
Failure logs
vcpkg install works perfectly but I have an error during the project build (linking)
Additional context
There is no such a problem when you try to buld it with a dynamic library or a console application.
I've tried to reinstall vcpkg completely but it didn't help.
The same project works like a charm with :windows-x64-static on my Windows machine.
As I googled, it's likely that linux default triplet is x64-linux which is static, but I couln't find any reasons why it doesn't work
The problem is probably in MPIR but I'm not sure
The text was updated successfully, but these errors were encountered: