Skip to content
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

macos replace xcode clang with pkgsrc #371

Closed
smurfd opened this issue Dec 30, 2023 · 1 comment
Closed

macos replace xcode clang with pkgsrc #371

smurfd opened this issue Dec 30, 2023 · 1 comment

Comments

@smurfd
Copy link

smurfd commented Dec 30, 2023

Hey,

Really appreciate the work you do.

Ive been trying to get clang to work on macos on and off a ton of times.
Is there anyone using the binary packages for clang on macos as main compiler? (meaning replacing the xcode's clang)
What options have you set to get it to work!?
Installed from : https://pkgsrc.joyent.com/install-on-macos/

$ uname -a
Darwin brr.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:51 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6030 arm64

Ofcource adding /opt/pkg/bin first in PATH
after adding a symlink to ld -> lld in /opt/pkg/bin (otherwise it would try to use /usr/bin/ld)

#include <stdio.h>

int main() {
  return 0;
}

If i'd add a printf("hi\n"); i get this:

error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  printf("hi\n");

This is the errors i get (added macos sdk include to try to get rid of the printf error above):
$ PATH=/opt/pkg/bin:$PATH LDFLAGS="-L/opt/pkg/lib -Wl,-rpath,/opt/pkg/lib" CPPFLAG="-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ -I/opt/pkg/include -I/opt/pkg/include/c++/v1/" /opt/pkg/bin/clang -Wimplicit-function-declaration -v c.c

clang version 16.0.6
Target: x86_64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /opt/pkg/bin
 "/opt/pkg/bin/clang-16" -cc1 -triple x86_64-apple-macosx14.0.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name c.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -ffp-contract=on -fno-rounding-math -funwind-tables=2 -fcompatibility-qualified-id-block-type-checking -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=lldb -target-linker-version 1015.7 -v -fcoverage-compilation-dir=/Users/willygorilla/dev -resource-dir /opt/pkg/lib/clang/16 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/local/include -internal-isystem /opt/pkg/lib/clang/16/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include -Wimplicit-function-declaration -fdebug-compilation-dir=/Users/willygorilla/dev -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcolor-diagnostics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /var/folders/qz/b881qqrj15s4ftjcv08kdngh0000gn/T/c-6b495e.o -x c c.c
clang -cc1 version 16.0.6 based upon LLVM 16.0.6 default target x86_64-apple-darwin23.2.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /opt/pkg/lib/clang/16/include
End of search list.
 "/opt/pkg/bin/ld" -demangle -lto_library /opt/pkg/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -platform_version macos 14.0.0 14.0.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -o a.out /var/folders/qz/b881qqrj15s4ftjcv08kdngh0000gn/T/c-6b495e.o -lSystem
ld: error: unknown argument '-no_deduplicate'
ld: error: unknown argument '-dynamic', did you mean '-Bdynamic'
ld: error: unknown argument '-arch'
ld: error: unknown argument '-platform_version'
ld: error: unknown argument '-syslibroot'
ld: error: unable to find library -lto_library
ld: error: /opt/pkg/lib/libLTO.dylib: unknown file type
ld: error: cannot open x86_64: No such file or directory
ld: error: cannot open macos: No such file or directory
ld: error: cannot open 14.0.0: No such file or directory
ld: error: cannot open 14.0.0: No such file or directory
ld: error: cannot open /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk: No such file or directory
ld: error: /var/folders/qz/b881qqrj15s4ftjcv08kdngh0000gn/T/c-6b495e.o: unknown file type
ld: error: unable to find library -lSystem
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

I have seen this question asked around, could be good to add to a documentation
Thanks in advance.

@smurfd smurfd changed the title macos replace xcode/homebrew clang with pkgsrc macos replace xcode clang with pkgsrc Dec 30, 2023
@smurfd
Copy link
Author

smurfd commented Jan 3, 2024

Solved it,
First i linked the current Xcode Command line tools SDK to 11.3
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk
Then added these two lined to my ~.zshrc

alias clang="/opt/pkg/bin/clang --target=aarch64-apple-darwin23.2.0 -fuse-ld=lld"
alias clang++="/opt/pkg/bin/clang++ --target=aarch64-apple-darwin23.2.0 -fuse-ld=lld"
$ clang -v c.c
clang version 16.0.6
Target: aarch64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /opt/pkg/bin
 "/opt/pkg/bin/clang-16" -cc1 -triple arm64-apple-macosx14.0.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name c.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fcompatibility-qualified-id-block-type-checking -fvisibility-inlines-hidden-static-local-var -target-cpu apple-m1 -target-feature +v8.5a -target-feature +crc -target-feature +crypto -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +lse -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +neon -target-feature +zcm -target-feature +zcz -target-feature +fullfp16 -target-feature +sm4 -target-feature +sha3 -target-feature +sha2 -target-feature +aes -target-abi darwinpcs -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=lldb -target-linker-version 1015.7 -v -fcoverage-compilation-dir=/Users/willygorilla/dev -resource-dir /opt/pkg/lib/clang/16 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/local/include -internal-isystem /opt/pkg/lib/clang/16/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include -fdebug-compilation-dir=/Users/willygorilla/dev -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcolor-diagnostics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /var/folders/qz/b881qqrj15s4ftjcv08kdngh0000gn/T/c-7d327c.o -x c c.c
clang -cc1 version 16.0.6 based upon LLVM 16.0.6 default target x86_64-apple-darwin23.2.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /opt/pkg/lib/clang/16/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks (framework directory)
End of search list.
 "/opt/pkg/bin/ld64.lld" -demangle -no_deduplicate -dynamic -arch arm64 -platform_version macos 14.0.0 14.0.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -o a.out /var/folders/qz/b881qqrj15s4ftjcv08kdngh0000gn/T/c-7d327c.o -lSystem
$ file a.out 
a.out: Mach-O 64-bit executable arm64
$ ./a.out 
hi

@smurfd smurfd closed this as completed Jan 3, 2024
jperkin pushed a commit that referenced this issue Mar 4, 2024
## Version 3.1.11 (February 28, 2024)

Patch release with small build fix:

- Add explicit `std::` namespace for `isfinite` in `ImathFun.cpp`

This release also introduces the practice of signing release artifacts
via [sigstore](https://www.sigstore.dev).

### Merged Pull Requests
* \[[#371](AcademySoftwareFoundation/Imath#371]
ImathFun.cpp: add std:: to isfinite in remaining cases (#371)
* \[[#369](AcademySoftwareFoundation/Imath#369]
Add workflow to sign release artifacts with Sigstore
* \[[#368](AcademySoftwareFoundation/Imath#368]
Add std:: to isfinite in ImathFun.cpp
jperkin pushed a commit that referenced this issue Mar 4, 2024
v0.17.0 is a new release with a lot of features, bug fixes, and specifically a
patch fixing a very annoying Spotify API bug.

This release also marks a big milestone for the project: 1k ⭐ 🥳🥳🥳 .
Thanks everyone for contributing, using, and starring the project!

What's Changed
    Add custom text input widget with cursor, to use in search page by @micleo2 in #329
    chore: update github actions by @LucasFA in #339
    reset buffered playback upon handling GetCurrentPlayback request by @aome510 in #341
    docs: fixes keymap command name by @massivebird in #342
    chore(docs): Remove unneeded explicit link by @LucasFA in #344
    Wait for the copy command to exit. by @Fuyukai in #346
    build: use cross for cross-compilation, locally and in CD by @LucasFA in #343
    feat: Souvlaki 0.7.0 and Linux Dbus volume control support by @LucasFA in #348
    extend capabilities for ShowActionsOn* commands by @aome510 in #352
    handle title padding with hidden borders by @aome510 in #351
    update dependencies, bump lyric_finder to v0.1.5 by @aome510 in #353
    Add miscellaneous UI code changes by @aome510 in #354
    update issue templates by @aome510 in #366
    fix clippy warning by @aome510 in #367
    re-create a new session when restarting the integrated client by @aome510 in #370
    Don't create streaming connections for non-streaming instances by @Schnouki in #371
    Remove winit from compilation on Linux by @LucasFA in #372
    Explicit cargo-binstall support by @LucasFA in #377
    Add popup for creating new playlist by @aome510 in #379
    Make Daemon feature imply streaming feature by @LucasFA in #376
    use liked icon's length to configure the column's width by @aome510 in #380
    Patch spotify API bugs by @aome510 in #386
jperkin pushed a commit that referenced this issue Apr 9, 2024
ContourPy 1.2.1 is a compatibility release to support NumPy 2.

This release supports Python 3.9 to 3.12.

Thanks to new contributor @motoro and core maintainer @ianthomas23.

Compatibility:

    Support NumPy 2 (#331, #371, #372)

Code improvements:

    Fix a few f-strings (#332)

Documentation improvements:

    Clarify use of quotes in pip install (#349)

Build, testing and CI improvements:

    Improved linting (#322, #323, #333, #337)
    Update cppcheck to 2.11 (#324)
    Support running tests on unicore hosts (#327)
    Improved tests against nightly wheels (#329, #373)
    Update to chromium 118 for Bokeh renderer tests (#325)
    Add CI run using earliest supported numpy (#347)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant