rand.q problem

https://learninghub.kx.com/forums/topic/rand-q-problem

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?

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

``` make && make install && make clean

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


```

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

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!