0

I am on an M1 Mac and I have Homebrew GCC installed. I am trying to multithread using OpenMP.

I have a setup.py file containing:

                  sources = ['pyTsetlinMachineParallel/ConvolutionalTsetlinMachine.c', 'pyTsetlinMachineParallel/MultiClassConvolutionalTsetlinMachine.c', 'pyTsetlinMachineParallel/Tools.c'],
                  include_dirs=['pyTsetlinMachineParallel'],
                  extra_compile_args=['-fopenmp'],
                  extra_link_args=['-L/usr/local/Cellar/gcc/11.2.0_3/lib/gcc/11 -lgomp' ])  

When I build the file, I get the error:

ld: warning: directory not found for option '-L/usr/local/Cellar/gcc/11.2.0_3/lib/gcc/11 -lgomp'

In /usr/local/Cellar/gcc/11.2.0_3/lib/gcc/11 I have these files: libgomp.1.dylib libgomp.a libgomp.dylib libgomp.spec

What am I getting wrong?

  • Did you try replacing the `extra_link_args=['-L/usr/local/Cellar/gcc/11.2.0_3/lib/gcc/11 -lgomp' ]` by just `extra_link_args=['-fopenmp']`? – Gilles Apr 06 '22 at 08:13
  • @Gilles I tried that just now and it gave me ```OSError: dlopen(/Users/Saram/Desktop/University/Individual Project/Code Directory/pyTsetlinMachineParallel/TsetlinVenv/lib/python3.7/site-packages/pyTsetlinMachineParallel-0.2.1-py3.7-macosx-12-x86_64.egg/libTM.cpython-37m-darwin.so, 0x0006): symbol not found in flat namespace '___kmpc_for_static_fini'``` – Saram Abbas Apr 06 '22 at 19:52

0 Answers0