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

dyld: Symbol not found: _util_malloc_ #16

Closed
DanielLenz opened this issue Sep 19, 2018 · 14 comments
Closed

dyld: Symbol not found: _util_malloc_ #16

DanielLenz opened this issue Sep 19, 2018 · 14 comments
Assignees

Comments

@DanielLenz
Copy link
Contributor

DanielLenz commented Sep 19, 2018

Great paper presentation today, looking forward to diving into it and using the code! Will have to debug this first, though.

Just copying the issues from damonge/NaMaster#24, where several people have run into the following:

First executing the following, which works fine.

./configure
make
make install

Then running make check gives the following:

EST 16/53 nmt:he_beams [OK]
TEST 17/53 nmt:he_alm2cl dyld: lazy symbol binding failed: Symbol not found: _util_malloc_
  Referenced from: /Users/dlenz/software/pymodules/NaMaster/.libs/libnmt.0.dylib
  Expected in: flat namespace

dyld: Symbol not found: _util_malloc_
  Referenced from: /Users/dlenz/software/pymodules/NaMaster/.libs/libnmt.0.dylib
  Expected in: flat namespace

/bin/sh: line 1: 62678 Abort trap: 6           ${dir}$tst
FAIL: test/check_nmt

I get the very same error when trying to run the namaster executable.

It might make sense to add a travis build that uses a typical MacOS build, to catch this and similar errors.

@fjaviersanchez
Copy link
Collaborator

@DanielLenz I think this is a Mac specific issue. For some reason it is not finding one of the libraries. Does it work if you do export PATH=$PATH:/Users/dlenz/software/NaMaster/.libs?

Please, let us know of the outcome so we can add instructions to the README.

@DanielLenz
Copy link
Contributor Author

Does it work if you do export PATH=$PATH:/Users/dlenz/software/NaMaster/.libs?

I'm afraid not.

@fjaviersanchez
Copy link
Collaborator

I'm afraid not.

Thanks! I'll look deeper into it.

@fjaviersanchez fjaviersanchez self-assigned this Sep 19, 2018
@damonge
Copy link
Collaborator

damonge commented Sep 21, 2018

@DanielLenz What compiler (and version) did you use to compile this? And was it the same that you used to install libsharp and any other libraries?

@damonge
Copy link
Collaborator

damonge commented Sep 21, 2018

Also, could you check if the problem gets fixed if you do:

export LD_LIBRARY_PATH=/path/to/where/the/libsharp/libraries/are:$LD_LIBRARY_PATH

?

@DanielLenz
Copy link
Contributor Author

DanielLenz commented Sep 21, 2018

Thank for helping me to debug this!

What compiler (and version) did you use to compile this?

NaMaster [master●] which gcc
gcc: aliased to /usr/local/bin/gcc-7
NaMaster [master●] gcc --version
gcc-7 (Homebrew GCC 7.2.0) 7.2.0

And was it the same that you used to install libsharp and any other libraries?

Good point, I might have used clang or gcc-6 to do that. I can fetch the latest libshard and fftw3 and fix that.
Is there a possibility to include these dependencies in NaMaster, as it is done e.g. in healpy (which includes e.g. healpix, cfitsio, and libsharp)?
Ironically, there are similar issues with the latest version, related to using different compilers: healpy/healpy#455

Also, could you check if the problem gets fixed if you do:
export LD_LIBRARY_PATH=/path/to/where/the/libsharp/libraries/are:$LD_LIBRARY_PATH

I'm afraid that didn't work.

@fjaviersanchez
Copy link
Collaborator

fjaviersanchez commented Sep 21, 2018

@DanielLenz I did a little bit of digging and it turns out that the c_utils library from libsharp wasn't being linked to libnmt.dylib (when linking libnmt.dylib for some reason the flags -lfftpack -lc_utils are missing). One solution consists on doing export LDFLAGS="-lfftpack -lc_utils" before running ./configure. Please, let me know if this works for you :)

@fjaviersanchez
Copy link
Collaborator

@damonge has just prepared a fix with which you don't even need to export these flags. Please, check it out at the dylib_fix branch.

@damonge
Copy link
Collaborator

damonge commented Sep 21, 2018

Please let us know if it works, and we'll merge it

@DanielLenz
Copy link
Contributor Author

DanielLenz commented Sep 21, 2018

Awesome, thanks for fixing this so rapidly!

One little issue popped up, everything else passed:

TEST 43/53 nmt:bins_flat_binning [FAIL]
  ERR: test/nmt_test_bins_flat.c:72  expected 0.000e+00, got 2.557e-04 (diff -2.557e-04, tol 1.000e-10)

Now looking into the python wrapper...

@DanielLenz
Copy link
Contributor Author

Installing python didn't raise any issues, all the unittests I ran with python -m unittest -v passed as well. Thanks again!

@damonge
Copy link
Collaborator

damonge commented Sep 21, 2018

Yeah, @fjaviersanchez mentioned that one. It's weird, because travis doesn't pick it up, and all tests have passed for me in the past. I think it may be a compiler-specific floating point thing related to the issue that caused the first problem to begin with. It's even wierder because python is supposed to be running the same test.

I'll have a quick look, but I wouldn't worry.

Many kudos to @fjaviersanchez for figuring this one out!

@damonge damonge mentioned this issue Sep 22, 2018
@damonge
Copy link
Collaborator

damonge commented Sep 22, 2018

Tagging @anicola and @NicolettaK , since they had this problem too

@anicola
Copy link

anicola commented Sep 23, 2018

Thank you very much @fjaviersanchez and @damonge! Now everything works for me as well. As Daniel, I also run into a one little issue:


TEST 41/53 nmt:bins_flat_binning [FAIL]
  ERR: test/nmt_test_bins_flat.c:72  expected 0.000e+00, got 2.652e+00 (diff -2.652e+00, tol 1.000e-10) 

Apart from that, everything works like a charm! Thanks again!

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

4 participants