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

Compile acts/master on my mac #3900

Open
qgl90 opened this issue Nov 23, 2024 · 9 comments · May be fixed by #3905
Open

Compile acts/master on my mac #3900

qgl90 opened this issue Nov 23, 2024 · 9 comments · May be fixed by #3905

Comments

@qgl90
Copy link

qgl90 commented Nov 23, 2024

I have tried to compile on my mac the latest acts master branch.

It turned out that it was not able to compile due to the find_package(FileSystem REQUIRED)

. What i did has been to change in CMakeLists.txt, adding filesystem from boost

            COMPONENTS program_options unit_test_framework filesystem

        find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS filesystem)

and fully comment out the

# find_package(Filesystem REQUIRED)

With those 2 changes the code compile on my mac, after having installed with brew both eigen and boost

Mac os version :

$|=>clang --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: arm64-apple-darwin23.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Apple M3 Pro, MacOS 14.3 (23D56)

@paulgessinger
Copy link
Member

Hey @qgl90,

thanks for the report!

We do build on macOS 14 in our CI, and std::filesystem is fully supported on macOS at this time.

Can you share the error that you get? I'm guessing it's some failure in the FindFilesystem.cmake which runs a number of test compiles to try to figure out how to load std::filesystem.

@qgl90
Copy link
Author

qgl90 commented Nov 23, 2024

Hi, @paulgessinger ,

Here is what i get with cmake ../

[ Renatos-MacBook-Pro.local ] renato @ ~/Desktop/tracking/acts/build (main)
$|=>cmake ../
-- The CXX compiler identification is AppleClang 15.0.0.15000100
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting default build type: RelWithDebInfo
-- Using compiler flags: -Wall -Wextra -Wpedantic -Wshadow -Wzero-as-null-pointer-constant -Wold-style-cast -Wfloat-conversion -Wnull-dereference 
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Failed
-- Performing Test CXX_FILESYSTEM_STDCPPFS_NEEDED
-- Performing Test CXX_FILESYSTEM_STDCPPFS_NEEDED - Failed
-- Performing Test CXX_FILESYSTEM_CPPFS_NEEDED
-- Performing Test CXX_FILESYSTEM_CPPFS_NEEDED - Failed
CMake Error at cmake/FindFilesystem.cmake:286 (message):
  Cannot run simple program using std::filesystem
Call Stack (most recent call first):
  CMakeLists.txt:312 (find_package)


-- Configuring incomplete, errors occurred!

@AJPfleger
Copy link
Contributor

@stephenswat we stumbled over a std::filesystem problem during our spack-session on Friday. Can you remember how we solved it or where it came from?

@paulgessinger
Copy link
Member

@qgl90 Can you try running CMake with --debug-trycompile? That might give us a clue why the test compilation fails.

@stephenswat
Copy link
Member

When I saw this bug with @AJPfleger on Friday, we were able to resolve it by passing -DCMAKE_CXX_STANDARD=20 at configuration time.

@paulgessinger
Copy link
Member

@stephenswat @AJPfleger could be that the default is being applied too late, and that's why it fails to compile. Would be good to double check this with @qgl90's --debug-trycompile output.

@qgl90
Copy link
Author

qgl90 commented Nov 24, 2024

Hi, sorry for the late,

[ Renatos-MacBook-Pro.local ] renato @ ~/Desktop/tracking/acts/build (main)
$|=>cmake --debug-trycompile ../
debug trycompile on
-- The CXX compiler identification is AppleClang 15.0.0.15000100
-- Detecting CXX compiler ABI info
CMake Debug Log at /opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:74 (try_compile):
  Executing try_compile (CMAKE_CXX_ABI_COMPILED) in:

    /Users/renato/Desktop/tracking/acts/build/CMakeFiles/CMakeScratch/TryCompile-kcBBN8
Call Stack (most recent call first):
  /opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:14 (project)


-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting default build type: RelWithDebInfo
-- Using compiler flags: -Wall -Wextra -Wpedantic -Wshadow -Wzero-as-null-pointer-constant -Wold-style-cast -Wfloat-conversion -Wnull-dereference 
-- Looking for C++ include filesystem
CMake Debug Log at /opt/homebrew/share/cmake/Modules/CheckIncludeFileCXX.cmake:98 (try_compile):
  Executing try_compile (_CXX_FILESYSTEM_HAVE_HEADER) in:

    /Users/renato/Desktop/tracking/acts/build/CMakeFiles/CMakeScratch/TryCompile-xRiY01
Call Stack (most recent call first):
  cmake/FindFilesystem.cmake:154 (check_include_file_cxx)
  CMakeLists.txt:312 (find_package)


-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
CMake Debug Log at /opt/homebrew/share/cmake/Modules/Internal/CheckSourceRuns.cmake:99 (try_run):
  Executing try_compile (CXX_FILESYSTEM_NO_LINK_NEEDED_COMPILED) in:

    /Users/renato/Desktop/tracking/acts/build/CMakeFiles/CMakeScratch/TryCompile-dwPM9w
Call Stack (most recent call first):
  /opt/homebrew/share/cmake/Modules/CheckCXXSourceRuns.cmake:52 (cmake_check_source_runs)
  cmake/FindFilesystem.cmake:119 (check_cxx_source_runs)
  cmake/FindFilesystem.cmake:231 (_cmcm_check_cxx_source)
  CMakeLists.txt:312 (find_package)


-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Failed
-- Performing Test CXX_FILESYSTEM_STDCPPFS_NEEDED
CMake Debug Log at /opt/homebrew/share/cmake/Modules/Internal/CheckSourceRuns.cmake:99 (try_run):
  Executing try_compile (CXX_FILESYSTEM_STDCPPFS_NEEDED_COMPILED) in:

    /Users/renato/Desktop/tracking/acts/build/CMakeFiles/CMakeScratch/TryCompile-fhNH6K
Call Stack (most recent call first):
  /opt/homebrew/share/cmake/Modules/CheckCXXSourceRuns.cmake:52 (cmake_check_source_runs)
  cmake/FindFilesystem.cmake:119 (check_cxx_source_runs)
  cmake/FindFilesystem.cmake:239 (_cmcm_check_cxx_source)
  CMakeLists.txt:312 (find_package)


-- Performing Test CXX_FILESYSTEM_STDCPPFS_NEEDED - Failed
-- Performing Test CXX_FILESYSTEM_CPPFS_NEEDED
CMake Debug Log at /opt/homebrew/share/cmake/Modules/Internal/CheckSourceRuns.cmake:99 (try_run):
  Executing try_compile (CXX_FILESYSTEM_CPPFS_NEEDED_COMPILED) in:

    /Users/renato/Desktop/tracking/acts/build/CMakeFiles/CMakeScratch/TryCompile-1jBLUM
Call Stack (most recent call first):
  /opt/homebrew/share/cmake/Modules/CheckCXXSourceRuns.cmake:52 (cmake_check_source_runs)
  cmake/FindFilesystem.cmake:119 (check_cxx_source_runs)
  cmake/FindFilesystem.cmake:244 (_cmcm_check_cxx_source)
  CMakeLists.txt:312 (find_package)


-- Performing Test CXX_FILESYSTEM_CPPFS_NEEDED - Failed
CMake Error at cmake/FindFilesystem.cmake:286 (message):
  Cannot run simple program using std::filesystem
Call Stack (most recent call first):
  CMakeLists.txt:312 (find_package)


-- Configuring incomplete, errors occurred!

this is what i get

@paulgessinger
Copy link
Member

Thanks @qgl90.

Indeed

-- Using compiler flags: -Wall -Wextra -Wpedantic -Wshadow -Wzero-as-null-pointer-constant -Wold-style-cast -Wfloat-conversion -Wnull-dereference 

looks like it's not using the C++20 flag if it's not explicitly given.

@paulgessinger paulgessinger linked a pull request Nov 25, 2024 that will close this issue
@paulgessinger
Copy link
Member

@qgl90 see #3905.

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

Successfully merging a pull request may close this issue.

4 participants