KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ rand.q problem

  • rand.q problem

    Posted by Pooas on September 1, 2024 at 1:04 pm

    I'm encountering an error when trying to load a rand.q kdb+ script from https://github.com/kxcontrib/optionpricing The error message is:

    evaluation error: dlopen(/opt/homebrew/anaconda3/envs/kdb/q/m64/rand.so, 0x0002): tried: '/opt/homebrew/anaconda3/envs/kdb/q/m64/rand.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/anaconda3/envs/kdb/q/m64/rand.so' (no such file), '/opt/homebrew/anaconda3/envs/kdb/q/m64/rand.so' (no such file) [3] /Users/pooyac/Developer/KDB/BSModel/optionpricing/q/rand.q:1: sobolrand::rand 2:(sobolrand;2) /;1).

    
    

    This error seems to be related to the rand.so file, which is not found in the expected location. I'm using a Homebrew-installed Anaconda environment for kdb+.

    **MY DEVICE IS M2 MACBOOK**

    My question is:

    How can I fix this error and ensure that the rand.so file is loaded correctly? Is there a specific location where I should place this file, or are there any configuration settings I need to adjust?

    Pooas replied 2 months, 2 weeks ago 2 Members · 4 Replies
  • 4 Replies
  • choppergrip

    Member
    September 2, 2024 at 10:23 am

    To create the shared object files for the number generators and distribution functions the below must be run:

    make && make install && make clean
    

    • Pooas

      Member
      September 2, 2024 at 4:51 pm

      Thanks! How I do fix this problem(arm64)?

      gcc -shared -o rand.so rand.o mt19937arcok.o SobolSeq1024.o

      Undefined symbols for architecture arm64:

      "_ja", referenced from:

      _mtrand1 in rand.o

      _mtrand2 in rand.o

      _mtrand3 in rand.o

      "_krr", referenced from:

      _sobolrand in rand.o

      _mtinit in rand.o

      _mtrand1 in rand.o

      _mtrand2 in rand.o

      _mtrand3 in rand.o

      "_ktn", referenced from:

      _sobolrand in rand.o

      _mtrand1 in rand.o

      _mtrand2 in rand.o

      _mtrand3 in rand.o

      ld: symbol(s) not found for architecture arm64

      clang: error: linker command failed with exit code 1 (use -v to see invocation)

      make: *** [rand.so] Error 1


      • choppergrip

        Member
        September 2, 2024 at 5:49 pm

        The repo that you are using is behind the original one exactly on one commit that should fix MAC installation.

        Use this repo below, install all dependencies, set QHOME.
        https://github.com/dmorgankx/optionpricing

        Unfortunately, I can’t guarantee that it will work with your processor, but at least the installation problem will be solved

  • Pooas

    Member
    September 3, 2024 at 6:33 am

    Thank you so much for your help! Your solution worked perfectly, and I really appreciate the time you took to assist me. It made a big difference!

Log in to reply.