Solved Require LLVM_CONFIG variable in port

David Kalliecharan

New Member


Messages: 5

Hello,

I am looking at porting over llvmlite, and numba for python. It builds just fine with the documentation provided, however it is required to pass LLVM_CONFIG:
LLVM_CONFIG=/usr/local/bin/llvm-config37 python setup.py

Which works fine as an install for myself. However as a port, I wasn't sure how to add that. It could be done as setting LLVM_CONFIG globally ahead of time but, I think the port should do this.

Otherwise I get a Runtime error from python, which states that LLVM_CONFIG is not set

I am unsure of what specifically to look for in the porters handbook, still getting familiar with it.

Thanks or any help!
 

tobik@

Daemon
Developer

Reaction score: 1,372
Messages: 1,909

You should be able to pass env variables to setup.py via MAKE_ENV:
Code:
MAKE_ENV= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config37
I am unsure of what specifically to look for in the porters handbook, still getting familiar with it.
I haven't seen it in the porters handbook but in /usr/ports/Mk/Uses/python.mk:
Code:
.if !target(do-build)
do-build:
        @(cd ${BUILD_WRKSRC}; ${SETENV} [b]${MAKE_ENV}[/b] ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_BUILD_TARGET} ${PYDISTUTILS_BUILDA$
.endif
This is all assuming your port is structured like what's described in the handbook: https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/using-python.html
 
Top