-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix grovel for MacPorts #18
Conversation
@orivej Any chance on this one? Would help me on yitzchak/common-lisp-jupyter#32 |
I think that these changes do not belong in |
You have mentioned |
Awesome. Thanks! |
As I mentioned in yitzchak/common-lisp-jupyter#32 (comment), I added IMHO, this issue should not be closed. I am still investigating |
|
@orivej That commit is two years old and is already available in quicklisp. It doesn't appear to me that it is ever actually evaluated since right before it are implementation specific definitions for SBCL, etc. I think that it is actually fallback code for an unknown CL implementation. This goes right back to my original point, even CFFI's own libffi interface defines its own Darwin specific includes: |
Users should be able to pass custom compilation flags such as include directories via CFLAGS env var. It would be convenient for MacPorts users if software installed in /opt/local worked by default. Fixes orivej/pzmq#18
Users should be able to pass custom compilation flags such as include directories via CFLAGS env var. It would be convenient for MacPorts users if libraries installed in /opt/local worked by default. Fixes orivej/pzmq#18
Users should be able to pass custom compilation flags such as include directories via CFLAGS env var. It would be convenient for MacPorts users if libraries installed in /opt/local worked by default. (/opt/local/lib is supported since cffi#139.) Fixes orivej/pzmq#18
You are right,
Does every Lisp cffi library need to know all possible include directories on all operating systems? No, |
Le 18 juil. 2019 à 20:38, Tarn Burton ***@***.***> a écrit :
[…]
It doesn't appear to me that it is ever actually evaluated since right before it are implementation specific definitions for SBCL, etc. I think that it is actually fallback code for an unknown CL implementation.
Indeed, but the « -I /opt/local/include » for Darwin is only added in the « fallback » code.
If I’m not wrong, with sbcl, the ensure-toolchain-parameters function in cffi-toolchain will:
1. evaluate sbcl-toolchain-parameters _if_ the global variable *cc* is not set;
2. then evaluate default-toolchain-parameters _if_ the global variable *cc* is not set.
(defun ensure-toolchain-parameters ()
#+clisp (unless *cc* (clisp-toolchain-parameters))
#+ecl (unless *cc* (ecl-toolchain-parameters))
#+mkcl (unless *cc* (mkcl-toolchain-parameters))
#+sbcl (unless *cc* (sbcl-toolchain-parameters))
(unless *cc* (default-toolchain-parameters)))
However, the sbcl-toolchain-parameters function set *cc* and *cc-flags* based on variables declared in /opt/local/lib/sbcl/sbcl.mk:
CC=/usr/bin/clang
LD=ld
CFLAGS=-g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.14 -D_DARWIN_USE_64_BIT_INODE -arch x86_64 -fno-omit-frame-pointer
[…]
Therefore, default-toolchain-parameters is _never_ called and *cc* and *cc-flags* are:
$ sbcl --no-inform
* (require :cffi-toolchain)
NIL
* cffi-toolchain:*cc*
"/usr/bin/clang"
* cffi-toolchain:*cc-flags*
("-g" "-Wall" "-Wundef" "-Wsign-compare" "-Wpointer-arith" "-O3" "-g" "-Wall"
"-O2" "-fdollars-in-identifiers" "-mmacosx-version-min=10.14"
"-D_DARWIN_USE_64_BIT_INODE" "-arch" "x86_64" "-fno-omit-frame-pointer")
Comment the CC line in sbcl.mk then /opt/local/include is added:
$ sbcl --noinform
* (require :cffi-toolchain)
NIL
* cffi-toolchain:*cc*
"cc"
* cffi-toolchain:*cc-flags*
("-m64" "-I" "/opt/local/include/")
One quick fix is to set CC to /opt/local/bin/clang and add "-I /opt/local/include" to CFLAGS in /opt/local/sbcl/sbcl.mk. With that, common-lisp-jupyter compiled without a hitch.
Or, we could fix the {ensure,default}-toolchain-parameters functions in cffi-toolchain %-) Comments in default-toolchain-parameters makes it clear that it needs cleanup.
I can submit a patch for MacPorts’ sbcl, based on the quick fix, if it seems appropriate for you.
|
I have already opened cffi/cffi#146 |
Ok... :-)
… Le 18 juil. 2019 à 21:47, Orivej Desh ***@***.***> a écrit :
I have already opened cffi/cffi#146 <cffi/cffi#146>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#18?email_source=notifications&email_token=AABFIPALNJ5F5DYXEHUQOATQADCE7A5CNFSM4HF3G6J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2JSRCY#issuecomment-512960651>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABFIPDO4IYH3JIUYEPMGFTQADCE7ANCNFSM4HF3G6JQ>.
|
Users should be able to pass custom compilation flags such as include directories via CFLAGS env var. It would be convenient for MacPorts users if libraries installed in /opt/local worked by default. (/opt/local/lib is supported since cffi#139.) Fixes orivej/pzmq#18
Users should be able to pass custom compilation flags such as include directories via CFLAGS env var. It would be convenient for MacPorts users if libraries installed in /opt/local worked by default. (/opt/local/lib is supported since cffi#139.) Fixes orivej/pzmq#18
Users should be able to pass custom compilation flags such as include directories via CFLAGS env var. It would be convenient for MacPorts users if libraries installed in /opt/local worked by default. (/opt/local/lib is supported since cffi#139.) /usr/local/include/ was added for OpenBSD because cffi finds it useful in cc07246 Fixes orivej/pzmq#18
Grovel apparently doesn't know about
/opt/local/include
for MacPorts. Even in CFFI's own libfficc-flags
are explicitly specified. See yitzchak/common-lisp-jupyter#32I also added an explicit darwin case for
define-foreign-library
to prevent MacOS from falling into the unix case.