6

Attempting to build the cardano-node on Mac OS Big Sur while following the instructions found here: https://developers.cardano.org/docs/get-started/installing-cardano-node/#macos

When I hit the cabal build all step I'm given the following error:

[ 14 of 193] Compiling PlutusCore.Pretty.Readable ( plutus-core/src/PlutusCore/Pretty/Readable.hs, dist/build/PlutusCore/Pretty/Readable.o, dist/build/PlutusCore/Pretty/Readable.dyn_o )
<command line>: dlopen(/Users/sanfordleach/.cabal/store/ghc-8.10.4/lib/libHScrdn-crypt-clss-2.0.0-a62d56db-ghc8.10.4.dylib, 5): Symbol not found: _sodium_free
  Referenced from: /Users/sanfordleach/.cabal/store/ghc-8.10.4/lib/libHScrdn-crypt-clss-2.0.0-a62d56db-ghc8.10.4.dylib
  Expected in: flat namespace
 in /Users/sanfordleach/.cabal/store/ghc-8.10.4/lib/libHScrdn-crypt-clss-2.0.0-a62d56db-ghc8.10.4.dylib

Note: I have the environmental vars. Not sure how to check that libsodium is installed correctly but I ran the steps in the instructions.

Please help? Thank you!

EDIT 1: I see the libsodium files in my /usr/local/lib so I believe it's installed correctly

EDIT 2: At this point I've already created a node on an Ubuntu instance and it's working fine... not sure if its an issue with Mac OS but I recommend doing the same if you run into this issue.

4
  • Do you have a libsodium.so file in your $LD_LIBRARY_PATH (/usr/local/lib)?
    – baocontact
    Commented Oct 22, 2021 at 23:28
  • I don't believe I do... is that something that's supposed to happen on the install? Commented Oct 25, 2021 at 1:03
  • I see libsodium.23.dylib, libsodium.dylib, libsodium.a, libsodium.la in my /usr/local/lib but not libsodium.so.... libsodium.pc is present in my pkgconfig Commented Oct 25, 2021 at 1:23
  • @sandy-leach did you find any solution?
    – Piyush
    Commented Apr 21, 2022 at 17:41

4 Answers 4

2

I was running into this problem on MacOS Monterey (M1 Pro) while building plutus-starter.

Just like OP, I seemed to have installed libsodium correctly as I had all the libs in my PATH. Then I stumbled upon this thread that solved it for me. What I needed was to add a cabal.project.local file in the root of my project with

package cardano-crypto-praos
  flags: -external-libsodium-vrf 

which I think makes the VRF not be bundled, and thus ignored as we can do without it anyway.

Also, before that, I rebuilt using libsodium-1.0.18-stable.tar.gz from https://download.libsodium.org/libsodium/releases/, which may also have helped.

Perhaps all of that is useful to someone!

1
  • I'm having the same issue but sadly this solution didn't work for me.
    – KugisMugis
    Commented Mar 21, 2022 at 19:37
1

If libsodium.so file is missing from /usr/local/lib, the problem here is that libsodium is not correctly installed on your Mac OS X environment.

0

Did you compile and install libsodium? Did you check environment variable to see that this is added?

1
  • Yep, env vars are there and I ran all of the steps to run libsodium that are in the instructions Commented Oct 22, 2021 at 22:51
0

I've been trying to run the leader logs script, which happens to depend on libsodium. I run on OSX and this problem has had me dweling on the same questions many asked above.

If you are using OS, you should use the .dylib files as reference. I've found a few open source examples that opted for a best effor library detection mechanism (see https://github.com/papacarp/pooltool.io/blob/master/leaderLogs/leaderLogs.py#L109), which points to using libsodium.23.dylib for OSX.

Unfortunately, I had an additional problem before being able to run the leaders log. I installed libsodium with brew, which installed the official libsodium project, but the code I needed to run required extra APIs that are only in the IOHK version of the library, so once I downloaded, compiled and installed the source code from this version, everything worked like a charm.

So, a couple of things:

  1. Make sure your configs point to the appropriate path of libdsodium (in OSX /usr/local/lib/libsodium.23.dylib).
  2. Depending on the version you had compiled and installed you might be missing APIs/functions. Check you have the correct version of the library.
1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jan 22, 2022 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.