@sschaer Thanks alot, nice to see there are other approaches, though C++ has been a bit outside of my knowledge. I could not run the code on my set-up (/bin/sh: 1: g++: not found
, detailed below), but it runs fine on Google Colab.
- What would I need in order to get around the error?
Details on (`/bin/sh: 1: g++: not found`)
On my setup, this line:
gpp_make_shared(src, "cyl_bessel_k.cpp")
Produces this message:
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
Cell In[2], line 1
----> 1 gpp_make_shared(src, "cyl_bessel_k.cpp")
Cell In[1], line 15, in gpp_make_shared(src, filename)
12 file.write(src)
14 cmd = f"g++ -shared -fPIC -o {filename.replace('.cpp', '.so')} {filename} -lm"
---> 15 subprocess.run(cmd, shell=True, check=True)
File /srv/conda/envs/notebook/lib/python3.10/subprocess.py:526, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
524 retcode = process.poll()
525 if check and retcode:
--> 526 raise CalledProcessError(retcode, process.args,
527 output=stdout, stderr=stderr)
528 return CompletedProcess(process.args, retcode, stdout, stderr)
CalledProcessError: Command 'g++ -shared -fPIC -o cyl_bessel_k.so cyl_bessel_k.cpp -lm' returned non-zero exit status 127.
- Also: I plan on running the scalar-input version of
kv
on several workers in parallel. Regarding this, I have an obstacle detailed here:. If you have any experience with runningctypes.CFUNCTYPE.<locals>.CFunctionType
then I would be very interested in your take on this.