ciel-lang/CIEL

Error when compiling jpeg-turbo on Apple Silicon with Homebrew

Closed this issue · 5 comments

I am running into compilation errors on Apple Silicon when trying to (ql:quickload :ciel): A compilation error occurs when running:

; clang -o                                                                          
/Users/dot/.cache/common-lisp/sbcl-2.4.6-macosx-arm64/Users/dot/quicklisp/dists/ult\
ralisp/software/shamazmazum-jpeg-turbo-20201121072458/src/grovel__grovel-tmpDMIL0RV\
K.o -c -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall                 
-fdollars-in-identifiers -fno-omit-frame-pointer -I/usr/local/include -fPIC         
-I/Users/dot/quicklisp/local-projects/cffi/                                         
/Users/dot/.cache/common-lisp/sbcl-2.4.6-macosx-arm64/Users/dot/quicklisp/dists/ult\
ralisp/software/shamazmazum-jpeg-turbo-20201121072458/src/grovel__grovel.c          
;                                                                                   
; compilation unit aborted                                                          
;   caught 1 fatal ERROR condition       

Backtrace

Backtrace:
 0: (CFFI-GROVEL:GROVEL-ERROR "~a" #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR              
{700AE17C03}>)
 1: ((FLET "THUNK" :IN CFFI-GROVEL:PROCESS-GROVEL-FILE))
 2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<FUNCTION (FLET "THUNK" :IN                 
CFFI-GROVEL:PROCESS-GROVEL-FILE) {105CA21FB}>)
 3: (CFFI-GROVEL:PROCESS-GROVEL-FILE                                                
#P"/Users/dot/quicklisp/dists/ultralisp/software/shamazmazum-jpeg-turbo-20201121072\
458/src/grovel.lisp"                                                                
#P"/Users/dot/.cache/common-lisp/sbcl-2.4.6-macosx-arm64/Users/..
 4: ((:METHOD ASDF/ACTION:PERFORM (CFFI-GROVEL::PROCESS-OP                          
CFFI-GROVEL:GROVEL-FILE)) #<CFFI-GROVEL::PROCESS-OP > #<CFFI-GROVEL:GROVEL-FILE     
"jpeg-turbo" "src/grovel">) [fast-method]
 5: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument>        
#<CFFI-GROVEL::PROCESS-OP > #<CFFI-GROVEL:GROVEL-FILE "jpeg-turbo" "src/grovel">)

Any suggestions on what may be the problem?
jpeg-turbo is installed via homebrew, if that makes any difference.

  • quicklisp => "2023-10-21"
  • ultralisp => "20240718171000"
  • asdf => "3.3.7"

Hello, thanks for the report.

I think this comes from our nodgui dependency (I'm not 100% sure where it comes from).

Could you try by cloning and loading the latest nodgui ?

the jpeg library in question: https://github.com/shamazmazum/jpeg-turbo

To build this wrapper make sure that both libjpeg-turbo library and headers are installed (on FreeBSD this is done by installing graphics/libjpeg-turbo port).

Do you have the headers? (on Debian, the "-dev" package)

Thanks for the swift response.

I tried cloning the latest nodgui and use that to no avail.

I have the header file turbojpeg.h, but because of homebrew include dir location, they are not readily available to clang, as far as I can tell. Unfortunately, I don't have a lot of experience with compiling C, let alone on MacOS, and which env vars should be set to include header files located at irregular places, so I tested CIEL on FreeBSD instead, and it works fine. So, I'll just stick to that.

Hmmm, seems it is working now:
export CPATH=/opt/homebrew/include

Seems to pick up turbojpeg.h.

Nice! Would you like to mention this on the README?

We removed the nodgui dependency. We have yet to test the shiny new nodgui-lite.

see #56