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

C++17 filesystem support for x86_64-apple-darwin14-clang++ #1263

Closed
peremato opened this issue Feb 23, 2023 · 4 comments
Closed

C++17 filesystem support for x86_64-apple-darwin14-clang++ #1263

peremato opened this issue Feb 23, 2023 · 4 comments

Comments

@peremato
Copy link

While trying to upgrade to latest version Geant4 I encountered the following problem. The code snippet to check the availability of filesystem library fails with the error:

# /opt/bin/x86_64-apple-darwin14-libgfortran5-cxx11/x86_64-apple-darwin14-clang++ -std=c++17 /workspace/srcdir/geant4-v11.1.1/cmake/Modules/check_cxx_filesystem.cc 
Undefined symbols for architecture x86_64:
  "__ZNSt3__14__fs10filesystem11__canonicalERKNS1_4pathEPNS_10error_codeE", referenced from:
      __ZNSt3__14__fs10filesystem9canonicalERKNS1_4pathE in check_cxx_filesystem-acb0f7.o
ld: symbol(s) not found for architecture x86_64
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

the file is:

# cat  /workspace/srcdir/geant4-v11.1.1/cmake/Modules/check_cxx_filesystem.cc 
// Check that trivial use of <filesystem> works
// - https://en.cppreference.com/w/cpp/filesystem
#include <iostream>
#include <filesystem>

namespace fs = std::filesystem;

int main( int argc, char* argv[] ) {
  fs::path p{ argv[0] };
  std::cout << p << ", " << fs::canonical( p ) << std::endl;
}

The compiler x86_64-apple-darwin14-clang++ does support c++17 standard however filesystem seems to be missing from the libc++ library. Any suggestion to overcome the problem?

@giordano
Copy link
Member

Substantially duplicate of #863 and all other issues referencing that one.

However there's a work around, manually use a newer SDK: https://github.com/JuliaPackaging/Yggdrasil/blob/4533b19ff5314ecc9de92b63f48f05ac5ceba3c0/C/Ccache/build_tarballs.jl#L13-L14 and
https://github.com/JuliaPackaging/Yggdrasil/blob/4533b19ff5314ecc9de92b63f48f05ac5ceba3c0/C/Ccache/build_tarballs.jl#L21-L29. This isn't pretty and in the not-so-distant future we should have a solution to make this more straightforward, but it does the job for the time being.

@giordano giordano closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2023
@peremato
Copy link
Author

Thanks very much @giordano . But following the recipe I get tons of errors if I delete/modify anything in /opt/${target}/${target}/sys-root. It seems that the filesystem is readonly. Did I miss anything?

@giordano
Copy link
Member

Not sure what you're doing, we use that trick extensively.

I don't know your setup (are you using Docker on macOS by any chance? I'm not familiar with that setup), you may want to consider using GitHub Codespaces: https://docs.binarybuilder.org/stable/#GitHub-Codespaces

@peremato
Copy link
Author

Yes, I am using Docker on MacOS. I'll use a Linux system later.

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

2 participants