Installation issue with aesara

Hi,

I’m trying to install pymc on an ubuntu server, but I’m getting the following error with the simplest stuff (for instance adding a pm.Normal):

ERROR (aesara.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (aesara.graph.rewriting.basic): node: InplaceDimShuffle{}(TensorConstant{(1,) of 2})
ERROR (aesara.graph.rewriting.basic): TRACEBACK:
ERROR (aesara.graph.rewriting.basic): Traceback (most recent call last):
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/graph/rewriting/basic.py", line 1933, in process_node
    replacements = node_rewriter.transform(fgraph, node)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/graph/rewriting/basic.py", line 1092, in transform
    return self.fn(fgraph, node)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/tensor/rewriting/basic.py", line 1141, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/op.py", line 131, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/op.py", line 96, in make_c_thunk
    outputs = cl.make_thunk(
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py", line 1202, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py", line 1122, in __compile__
    thunk, module = self.cthunk_factory(
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py", line 1647, in cthunk_factory
    module = cache.module_from_key(key=key, lnk=self)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/cmodule.py", line 1229, in module_from_key
    module = lnk.compile_cmodule(location)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py", line 1546, in compile_cmodule
    module = c_compiler.compile_str(
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/cmodule.py", line 2640, in compile_str
    raise CompileError(
aesara.link.c.exceptions.CompileError: Compilation failed (return status=1):
/usr/bin/g++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -Wno-c++11-narrowing -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -march=skylake-avx512 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mavx512f -mno-avx512er -mavx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mavx512dq -mavx512bw -mavx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mclwb -mno-mwaitx -mno-clzero -mpku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=16384 -mtune=skylake-avx512 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -I/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/numpy/core/include -I/mountpoint/software/.pyenv/versions/3.8.10/include/python3.8 -I/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/c_code -L/mountpoint/software/.pyenv/versions/3.8.10/lib -fvisibility=hidden -o /home/ubuntu/.aesara/compiledir_Linux-5.4--generic-x86_64-with-glibc2.29-x86_64-3.8.10-64/tmpbdbclrtk/mba10987274f369529454d4a60996746c3927712a0b1b3928446a3c275151e2ee.so /home/ubuntu/.aesara/compiledir_Linux-5.4--generic-x86_64-with-glibc2.29-x86_64-3.8.10-64/tmpbdbclrtk/mod.cpp -lpython3.8
/usr/bin/ld: /mountpoint/software/.pyenv/versions/3.8.10/lib/libpython3.8.a(obmalloc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

I tried digging deeper and realized the issue raises from aesara. For example, the following simple code results in a similar error:

import numpy as np
import aesara
import aesara.tensor as at

x = at.vector()
y = at.vector()
z = x + x
z = z + y
f = aesara.function([x, y], z)
f(np.ones((2,)), np.ones((2,)))

The code above produced this error:

---------------------------------------------------------------------------
CompileError                              Traceback (most recent call last)
File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/vm.py:1246, in VMLinker.make_all(self, profiler, input_storage, output_storage, storage_map)
   1242 # no-recycling is done at each VM.__call__ So there is
   1243 # no need to cause duplicate c code by passing
   1244 # no_recycling here.
   1245 thunks.append(
-> 1246     node.op.make_thunk(node, storage_map, compute_map, [], impl=impl)
   1247 )
   1248 linker_make_thunk_time[node] = time.time() - thunk_start

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/op.py:131, in COp.make_thunk(self, node, storage_map, compute_map, no_recycling, impl)
    130 try:
--> 131     return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
    132 except (NotImplementedError, MethodNotDefined):
    133     # We requested the c code, so don't catch the error.

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/op.py:96, in COp.make_c_thunk(self, node, storage_map, compute_map, no_recycling)
     95         raise NotImplementedError("float16")
---> 96 outputs = cl.make_thunk(
     97     input_storage=node_input_storage, output_storage=node_output_storage
     98 )
     99 thunk, node_input_filters, node_output_filters = outputs

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1202, in CLinker.make_thunk(self, input_storage, output_storage, storage_map, cache, **kwargs)
   1201 init_tasks, tasks = self.get_init_tasks()
-> 1202 cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
   1203     input_storage, output_storage, storage_map, cache
   1204 )
   1206 res = _CThunk(cthunk, init_tasks, tasks, error_storage, module)

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1122, in CLinker.__compile__(self, input_storage, output_storage, storage_map, cache)
   1121 output_storage = tuple(output_storage)
-> 1122 thunk, module = self.cthunk_factory(
   1123     error_storage,
   1124     input_storage,
   1125     output_storage,
   1126     storage_map,
   1127     cache,
   1128 )
   1129 return (
   1130     thunk,
   1131     module,
   (...)
   1140     error_storage,
   1141 )

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1647, in CLinker.cthunk_factory(self, error_storage, in_storage, out_storage, storage_map, cache)
   1646         cache = get_module_cache()
-> 1647     module = cache.module_from_key(key=key, lnk=self)
   1649 vars = self.inputs + self.outputs + self.orphans

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/cmodule.py:1229, in ModuleCache.module_from_key(self, key, lnk)
   1228 location = dlimport_workdir(self.dirname)
-> 1229 module = lnk.compile_cmodule(location)
   1230 name = module.__file__

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1546, in CLinker.compile_cmodule(self, location)
   1545     _logger.debug(f"LOCATION {location}")
-> 1546     module = c_compiler.compile_str(
   1547         module_name=mod.code_hash,
   1548         src_code=src_code,
   1549         location=location,
   1550         include_dirs=self.header_dirs(),
   1551         lib_dirs=self.lib_dirs(),
   1552         libs=libs,
   1553         preargs=preargs,
   1554     )
   1555 except Exception as e:

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/cmodule.py:2640, in GCC_compiler.compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
   2636     # We replace '\n' by '. ' in the error message because when Python
   2637     # prints the exception, having '\n' in the text makes it more
   2638     # difficult to read.
   2639     # compile_stderr = compile_stderr.replace("\n", ". ")
-> 2640     raise CompileError(
   2641         f"Compilation failed (return status={status}):\n{' '.join(cmd)}\n{compile_stderr}"
   2642     )
   2643 elif config.cmodule__compilation_warning and compile_stderr:
   2644     # Print errors just below the command line.

CompileError: Compilation failed (return status=1):
/usr/bin/g++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=skylake-avx512 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mavx512f -mno-avx512er -mavx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mavx512dq -mavx512bw -mavx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mclwb -mno-mwaitx -mno-clzero -mpku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=16384 -mtune=skylake-avx512 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -I/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/numpy/core/include -I/mountpoint/software/.pyenv/versions/3.8.10/include/python3.8 -I/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/c_code -L/mountpoint/software/.pyenv/versions/3.8.10/lib -fvisibility=hidden -o /home/ubuntu/.aesara/compiledir_Linux-5.4--generic-x86_64-with-glibc2.29-x86_64-3.8.10-64/tmpizflz_2w/mcabf2bd1e4c59125db2f6fb79ec0a05a4d7b0d6cb98868fbc588ab8cedf60652.so /home/ubuntu/.aesara/compiledir_Linux-5.4--generic-x86_64-with-glibc2.29-x86_64-3.8.10-64/tmpizflz_2w/mod.cpp -lpython3.8
/usr/bin/ld: /mountpoint/software/.pyenv/versions/3.8.10/lib/libpython3.8.a(obmalloc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status


During handling of the above exception, another exception occurred:

CompileError                              Traceback (most recent call last)
Cell In [2], line 9
      7 z = x + x
      8 z = z + y
----> 9 f = aesara.function([x, y], z)
     10 f(np.ones((2,)), np.ones((2,)))

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/compile/function/__init__.py:317, in function(inputs, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input)
    311     fn = orig_function(
    312         inputs, outputs, mode=mode, accept_inplace=accept_inplace, name=name
    313     )
    314 else:
    315     # note: pfunc will also call orig_function -- orig_function is
    316     #      a choke point that all compilation must pass through
--> 317     fn = pfunc(
    318         params=inputs,
    319         outputs=outputs,
    320         mode=mode,
    321         updates=updates,
    322         givens=givens,
    323         no_default_updates=no_default_updates,
    324         accept_inplace=accept_inplace,
    325         name=name,
    326         rebuild_strict=rebuild_strict,
    327         allow_input_downcast=allow_input_downcast,
    328         on_unused_input=on_unused_input,
    329         profile=profile,
    330         output_keys=output_keys,
    331     )
    332 return fn

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/compile/function/pfunc.py:371, in pfunc(params, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input, output_keys, fgraph)
    357     profile = ProfileStats(message=profile)
    359 inputs, cloned_outputs = construct_pfunc_ins_and_outs(
    360     params,
    361     outputs,
   (...)
    368     fgraph=fgraph,
    369 )
--> 371 return orig_function(
    372     inputs,
    373     cloned_outputs,
    374     mode,
    375     accept_inplace=accept_inplace,
    376     name=name,
    377     profile=profile,
    378     on_unused_input=on_unused_input,
    379     output_keys=output_keys,
    380     fgraph=fgraph,
    381 )

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/compile/function/types.py:1759, in orig_function(inputs, outputs, mode, accept_inplace, name, profile, on_unused_input, output_keys, fgraph)
   1747     m = Maker(
   1748         inputs,
   1749         outputs,
   (...)
   1756         fgraph=fgraph,
   1757     )
   1758     with config.change_flags(compute_test_value="off"):
-> 1759         fn = m.create(defaults)
   1760 finally:
   1761     t2 = time.time()

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/compile/function/types.py:1652, in FunctionMaker.create(self, input_storage, trustme, storage_map)
   1649 start_import_time = aesara.link.c.cmodule.import_time
   1651 with config.change_flags(traceback__limit=config.traceback__compile_limit):
-> 1652     _fn, _i, _o = self.linker.make_thunk(
   1653         input_storage=input_storage_lists, storage_map=storage_map
   1654     )
   1656 end_linker = time.time()
   1658 linker_time = end_linker - start_linker

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/basic.py:254, in LocalLinker.make_thunk(self, input_storage, output_storage, storage_map, **kwargs)
    247 def make_thunk(
    248     self,
    249     input_storage: Optional["InputStorageType"] = None,
   (...)
    252     **kwargs,
    253 ) -> Tuple["BasicThunkType", "InputStorageType", "OutputStorageType"]:
--> 254     return self.make_all(
    255         input_storage=input_storage,
    256         output_storage=output_storage,
    257         storage_map=storage_map,
    258     )[:3]

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/vm.py:1255, in VMLinker.make_all(self, profiler, input_storage, output_storage, storage_map)
   1253             thunks[-1].lazy = False
   1254     except Exception:
-> 1255         raise_with_op(fgraph, node)
   1257 t1 = time.time()
   1259 if self.profile:

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/utils.py:534, in raise_with_op(fgraph, node, thunk, exc_info, storage_map)
    529     warnings.warn(
    530         f"{exc_type} error does not allow us to add an extra error message"
    531     )
    532     # Some exception need extra parameter in inputs. So forget the
    533     # extra long error message in that case.
--> 534 raise exc_value.with_traceback(exc_trace)

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/vm.py:1246, in VMLinker.make_all(self, profiler, input_storage, output_storage, storage_map)
   1241 thunk_start = time.time()
   1242 # no-recycling is done at each VM.__call__ So there is
   1243 # no need to cause duplicate c code by passing
   1244 # no_recycling here.
   1245 thunks.append(
-> 1246     node.op.make_thunk(node, storage_map, compute_map, [], impl=impl)
   1247 )
   1248 linker_make_thunk_time[node] = time.time() - thunk_start
   1249 if not hasattr(thunks[-1], "lazy"):
   1250     # We don't want all ops maker to think about lazy Ops.
   1251     # So if they didn't specify that its lazy or not, it isn't.
   1252     # If this member isn't present, it will crash later.

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/op.py:131, in COp.make_thunk(self, node, storage_map, compute_map, no_recycling, impl)
    127 self.prepare_node(
    128     node, storage_map=storage_map, compute_map=compute_map, impl="c"
    129 )
    130 try:
--> 131     return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
    132 except (NotImplementedError, MethodNotDefined):
    133     # We requested the c code, so don't catch the error.
    134     if impl == "c":

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/op.py:96, in COp.make_c_thunk(self, node, storage_map, compute_map, no_recycling)
     94         print(f"Disabling C code for {self} due to unsupported float16")
     95         raise NotImplementedError("float16")
---> 96 outputs = cl.make_thunk(
     97     input_storage=node_input_storage, output_storage=node_output_storage
     98 )
     99 thunk, node_input_filters, node_output_filters = outputs
    101 @is_cthunk_wrapper_type
    102 def rval():

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1202, in CLinker.make_thunk(self, input_storage, output_storage, storage_map, cache, **kwargs)
   1167 """Compile this linker's `self.fgraph` and return a function that performs the computations.
   1168 
   1169 The return values can be used as follows:
   (...)
   1199 
   1200 """
   1201 init_tasks, tasks = self.get_init_tasks()
-> 1202 cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
   1203     input_storage, output_storage, storage_map, cache
   1204 )
   1206 res = _CThunk(cthunk, init_tasks, tasks, error_storage, module)
   1207 res.nodes = self.node_order

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1122, in CLinker.__compile__(self, input_storage, output_storage, storage_map, cache)
   1120 input_storage = tuple(input_storage)
   1121 output_storage = tuple(output_storage)
-> 1122 thunk, module = self.cthunk_factory(
   1123     error_storage,
   1124     input_storage,
   1125     output_storage,
   1126     storage_map,
   1127     cache,
   1128 )
   1129 return (
   1130     thunk,
   1131     module,
   (...)
   1140     error_storage,
   1141 )

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1647, in CLinker.cthunk_factory(self, error_storage, in_storage, out_storage, storage_map, cache)
   1645     if cache is None:
   1646         cache = get_module_cache()
-> 1647     module = cache.module_from_key(key=key, lnk=self)
   1649 vars = self.inputs + self.outputs + self.orphans
   1650 # List of indices that should be ignored when passing the arguments
   1651 # (basically, everything that the previous call to uniq eliminated)

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/cmodule.py:1229, in ModuleCache.module_from_key(self, key, lnk)
   1227 try:
   1228     location = dlimport_workdir(self.dirname)
-> 1229     module = lnk.compile_cmodule(location)
   1230     name = module.__file__
   1231     assert name.startswith(location)

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/basic.py:1546, in CLinker.compile_cmodule(self, location)
   1544 try:
   1545     _logger.debug(f"LOCATION {location}")
-> 1546     module = c_compiler.compile_str(
   1547         module_name=mod.code_hash,
   1548         src_code=src_code,
   1549         location=location,
   1550         include_dirs=self.header_dirs(),
   1551         lib_dirs=self.lib_dirs(),
   1552         libs=libs,
   1553         preargs=preargs,
   1554     )
   1555 except Exception as e:
   1556     e.args += (str(self.fgraph),)

File /mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/cmodule.py:2640, in GCC_compiler.compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
   2632                 print(
   2633                     "Check if package python-dev or python-devel is installed."
   2634                 )
   2636     # We replace '\n' by '. ' in the error message because when Python
   2637     # prints the exception, having '\n' in the text makes it more
   2638     # difficult to read.
   2639     # compile_stderr = compile_stderr.replace("\n", ". ")
-> 2640     raise CompileError(
   2641         f"Compilation failed (return status={status}):\n{' '.join(cmd)}\n{compile_stderr}"
   2642     )
   2643 elif config.cmodule__compilation_warning and compile_stderr:
   2644     # Print errors just below the command line.
   2645     print(compile_stderr)

CompileError: Compilation failed (return status=1):
/usr/bin/g++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=skylake-avx512 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mavx512f -mno-avx512er -mavx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mavx512dq -mavx512bw -mavx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mclwb -mno-mwaitx -mno-clzero -mpku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=16384 -mtune=skylake-avx512 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -I/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/numpy/core/include -I/mountpoint/software/.pyenv/versions/3.8.10/include/python3.8 -I/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/aesara/link/c/c_code -L/mountpoint/software/.pyenv/versions/3.8.10/lib -fvisibility=hidden -o /home/ubuntu/.aesara/compiledir_Linux-5.4--generic-x86_64-with-glibc2.29-x86_64-3.8.10-64/tmpizflz_2w/mcabf2bd1e4c59125db2f6fb79ec0a05a4d7b0d6cb98868fbc588ab8cedf60652.so /home/ubuntu/.aesara/compiledir_Linux-5.4--generic-x86_64-with-glibc2.29-x86_64-3.8.10-64/tmpizflz_2w/mod.cpp -lpython3.8
/usr/bin/ld: /mountpoint/software/.pyenv/versions/3.8.10/lib/libpython3.8.a(obmalloc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Apply node that caused the error: Elemwise{add,no_inplace}(<TensorType(float64, (None,))>, <TensorType(float64, (None,))>, <TensorType(float64, (None,))>)
Toposort index: 0
Inputs types: [TensorType(float64, (None,)), TensorType(float64, (None,)), TensorType(float64, (None,))]

Backtrace when the node is created (use Aesara flag traceback__limit=N to make it longer):
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/ipykernel/zmqshell.py", line 528, in run_cell
    return super().run_cell(*args, **kwargs)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2885, in run_cell
    result = self._run_cell(
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2940, in _run_cell
    return runner(coro)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
    coro.send(None)
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3139, in run_cell_async
    has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3318, in run_ast_nodes
    if await self.run_code(code, result, async_=asy):
  File "/mountpoint/code/environments/venv_3.8.10/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3378, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "/tmp/ipykernel_2949523/3083763268.py", line 8, in <module>
    z = z + y

HINT: Use a linker other than the C linker to print the inputs' shapes and strides.
HINT: Use the Aesara flag `exception_verbosity=high` for a debug print-out and storage map footprint of this Apply node.

I’m not sure why I’m getting this error or how to fix it. I tried reinstalling everything but that didn’t help.

Please let me know if you know what’s going wrong.

Thanks

Just to update, in case anyone gets here. The only way I was able to solve this was with a complete reinstall from conda. That is, I deleted the virtualenv I had set up and reinstalled everything (including the python interpretter) once again.

I really think this isn’t a really pleasing experience. Hopefully, the installation will become easier in the future.

Sorry to hear this got so complicated, this doesn’t sound like this was fun – or how it is supposed to go.

This sounds like it was using the system compiler, but for some reason that wasn’t picking up shared libraries correctly. Not sure why this would have happened however.

Hopefully at some point in the not-so-distant future we will be able to get rid of the C backend (which is usually the culprit of issues like this) and switch to the numba backend. This should completely solve issues like this one.

2 Likes