Skip to content
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

linker error during make check under macOS (duplicate symbol _d_randtest2) #2058

Open
jaganmn opened this issue Aug 27, 2024 · 5 comments
Open

Comments

@jaganmn
Copy link

jaganmn commented Aug 27, 2024

A colleague of mine is trying to check FLINT built under macOS. He does not hit #2048, perhaps because his architecture is x86_64 rather than aarch64 ... ? But he encounters a linker error at a later stage:

$ make check
<...>
   CC  mag/test/main.c
duplicate symbol '_d_randtest2' in:
     /private/var/folders/rr/q47s6xq93n1_lhj48t9rmqkr0000gn/T/main-4a8524.o
     ./libflint.a[85](double_interval_merged.o)
ld: 1 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)
make: *** [build/mag/test/main] Error 1

Indeed, I see d_randtest2 defined twice (in the double_interval module and again in the tests), but perhaps other linkers have ignored it. He is, like me, using the native Apple LLVM, not Homebrew LLVM ...

@albinahlback
Copy link
Collaborator

Thanks for noticing this! Looks like we should remove the one in double_interval.h as it is currently unused, but I'll let @fredrik-johansson decide when he gets back from vacation.

@jaganmn
Copy link
Author

jaganmn commented Aug 28, 2024

d_randtest2 seems to be used by di_randtest, defined just below. For now, I am working around this with:

diff -ruN flint-3.1.3/src/double_interval.h flint-3.1.3-patched/src/double_interval.h
--- flint-3.1.3/src/double_interval.h	2024-04-25 17:00:25
+++ flint-3.1.3-patched/src/double_interval.h	2024-08-28 10:47:50
@@ -183,6 +183,7 @@
 di_t arb_get_di(const arb_t x);
 void arb_set_di(arb_t res, di_t x, slong prec);
 
+static
 DOUBLE_INTERVAL_INLINE
 double d_randtest2(flint_rand_t state)
 {

@jaganmn
Copy link
Author

jaganmn commented Oct 28, 2024

Bump. It would be nice to avoid patching the sources in this way.

@albinahlback
Copy link
Collaborator

Sorry, I will fix it this weekend.

@albinahlback
Copy link
Collaborator

Will fix after #2085 is merged (or closed). I would like to avoid conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants