0

I'm currently trying to install a custom version of pyyaml linked with libyaml to test how my code execution time might benefit from the extra performance offered (as suggested in https://pyyaml.org/wiki/PyYAMLDocumentation). I've installed libyaml as described in the documentation

./bootstrap && ./configure --prefix /my/install/location

but when I run the install for pyyaml

python setup.py --with-libyaml install

I get

creating build/temp.linux-x86_64-2.7/ext
/usr/bin/gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/bin/python2.7 -c ext/_yaml.c -o build/temp.linux-x86_64-2.7/ext/_yaml.o
gcc: error: ext/_yaml.c: No such file or directory
gcc: fatal error: no input files

How do I point the install to /my/install/location? Is there a way to extend the search path to include the extra location, or is there another way that this should be brought together?

Ray Barrett
  • 73
  • 3
  • 10
  • This question is more about what options there are for solving this problem in a module agnostic sense, pyyaml is only being used as an example scenario. Is there a mechanism that allows for specifying dependencies in custom install locations rather than how can I get this to work for pyyaml specifically. – Ray Barrett Nov 26 '18 at 15:01
  • Modify `setup.py` with [preprocessor options](https://docs.python.org/3/distutils/setupscript.html#preprocessor-options). Or pass the paths in environment. But different libraries and different compilers require different environment variables. For `gcc/g++` the environment variables are `CFLAGS`, `CPPFLAGS`, `CXXFLAGS` and `LDFLAGS`. – phd Nov 26 '18 at 15:56
  • Unfortunately I've been unable to get this to work. If I have success in the future then I'll update with my findings. Thanks for the comments! – Ray Barrett Dec 17 '18 at 11:52

0 Answers0