parthenon-hpc-lab / athenapk

AthenaPK: a performance portable version of Athena++ built on Parthenon and Kokkos
BSD 3-Clause "New" or "Revised" License
56 stars 13 forks source link

cannot open source file "filesystem" and "experimental/filesystem" #103

Closed wolfram-schmidt closed 8 months ago

wolfram-schmidt commented 8 months ago

CMake fails with

CMake Error at external/parthenon/cmake/FindFilesystem.cmake:254 (message): Cannot Compile simple program using std::filesystem

using Intel compilers/mpi 2021.2 with the config file

message(STATUS "Loading machine configuration for HLRN-IV supercomputer using Intel modules.")

# Kokkos settings
set(Kokkos_ARCH_SKX ON CACHE BOOL "Target Skylake")

# Intel compiler
set(CMAKE_CXX_COMPILER mpiicpc CACHE STRING "")
set(CMAKE_C_COMPILER mpiicc CACHE STRING "")

Complete output in build directory is attached.

build-mpi.tar.gz

pgrete commented 8 months ago

Not sure why this fails. Following https://github.com/vector-of-bool/CMakeCM/blob/master/modules/FindFilesystem.cmake maybe adding a -lstdc++fs parameter, i.e., -DCMAKE_CXX_FLAGS=-lstdc++fs might help. Alternatively, it may be worth to try the new Intel stack, i.e., icpx as compiler.

wolfram-schmidt commented 8 months ago

Seems that there is no stdc++fs library:

/sw/tools/oneapi/2022.2/mpi/2021.6.0/bin/mpiicpc  -qopenmp-simd -lstdc++fs  CMakeFiles/cmTC_7e8e2.dir/testCXXCompiler.cxx.o -o cmTC_7e8e2 
    ld: cannot find -lstdc++fs
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Something to request from the software admins?

Also tried icp and icpx, but that doesn't change anything.

forrestglines commented 8 months ago

Probably something to ask from the admins?

You could try looking for that library in the directory where you find your intel compiler.

find /usr/lib/ -name "*c++fs*"

Some ancient documentation suggests that library used to be called just c++fs for llvm8.0 (see https://releases.llvm.org/8.0.0/projects/libcxx/docs/UsingLibcxx.html), so you could see if linking to that works

ld -lc++fs
wolfram-schmidt commented 8 months ago

Turned out that stdc++fs is only available in a separate module (gcc on top of intel, which seems counter-intuitive). So the issue is solved.

pgrete commented 8 months ago

Great. I'm happy to hear this is resolved.