Trouble with installation dealii v9.6.1 on Mac: C++17 support is disabled.

104 views
Skip to first unread message

akash ahmed

unread,
Dec 31, 2024, 11:10:42 AM12/31/24
to deal.II User Group
Dear all,
My MacBook Pro has a chip Apple M2 max and macOS Sonoma,

Apple clang version 16.0.0 (clang-1600.0.26.6)

cmake version 3.31.2. However, I got the following error:

./candi.sh -j 8 --packages="dealii"

Building dealii v9.6.1

-- This is CMake 3.31.3

-- 

.............................................

-- Include /Users/mmohebuj/dealii-candi/tmp/unpack/deal.II-v9.6.1/cmake/checks/check_01_cxx_features.cmake

-- C++17 support is disabled.

CMake Error at cmake/checks/check_01_cxx_features.cmake:368 (message):

  


  The current version of deal.II requires a compiler with enabled C++17

  support.  Make sure to use a modern enough compiler (GCC version 9 onwards,

  Clang version 10 onwards, or Microsoft MS VS 2019 onwards) and check that

  the compiler flag "-std=" is either unset, or set to at least c++17.

  Similarly, please make sure that the CMake variable CMAKE_CXX_STANDARD is

  either unset, or set at least to 17.



Call Stack (most recent call first):

  cmake/macros/macro_verbose_include.cmake:18 (include)

  CMakeLists.txt:116 (verbose_include)


-- Configuring incomplete, errors occurred!

Failure with exit status: 1

Exit message: There was a problem configuring dealii v9.6.1.

zsh: exit 1     ./candi.sh -j 8 --packages="dealii"


It would be a great help if you please share your thoughts on resolving this issue. 

Thank you in advance.

Jaman

Matthias Maier

unread,
Dec 31, 2024, 2:16:21 PM12/31/24
to dea...@googlegroups.com
We saw this lately.

The problem was that, for whatever reason, the Xcode compiler toolchain
forgot to install the C++ standard library (clang/llvm's libc++).


Can you try reinstalling the toolchain as described here?

https://mac.install.guide/commandlinetools/7


Best,
Matthias



On Sat, Dec 28, 2024, at 01:41 CST, akash ahmed <ahme...@gmail.com> wrote:

> Dear all,
> My MacBook Pro has a chip Apple M2 max and macOS Sonoma,
>
> Apple clang version 16.0.0 (clang-1600.0.26.6)
>
> cmake version 3.31.2. However, I got the following error:
>
> ./candi.sh -j 8 --packages="dealii"
>
> *Building dealii v9.6.1*
>
> -- This is CMake 3.31.3
>
> --
>
> .............................................
>
> -- Include
> /Users/mmohebuj/dealii-candi/tmp/unpack/deal.II-v9.6.1/cmake/checks/check_01_cxx_features.cmake
>
> -- C++17 support is disabled.
>
> CMake Error at cmake/checks/check_01_cxx_features.cmake:368 (message):
>
>
>
>
> The current version of deal.II requires a compiler with enabled C++17
>
> support. Make sure to use a modern enough compiler (GCC version 9
> onwards,
>
> Clang version 10 onwards, or Microsoft MS VS 2019 onwards) and check that
>
> the compiler flag "-std=" is either unset, or set to at least c++17.
>
> Similarly, please make sure that the CMake variable CMAKE_CXX_STANDARD is
>
> either unset, or set at least to 17.
>
>
>
> Call Stack (most recent call first):
>
> cmake/macros/macro_verbose_include.cmake:18 (include)
>
> CMakeLists.txt:116 (verbose_include)
>
>
> -- Configuring incomplete, errors occurred!
>
> *Failure with exit status: 1*
>
> *Exit message: There was a problem configuring dealii v9.6.1.*

akash ahmed

unread,
Jan 1, 2025, 2:51:51 PM1/1/25
to dea...@googlegroups.com
Dear Dr. Maier:

Happy New Year. Thank you so much for your response. I appreciate it.
I have followed the instructions given in the link and tried to install the dealii. However, the problem still exists. Here is the updated status:

(base) mmohebuj@CASTFX0F4V2Math ~ % brew doctor

Your system is ready to brew.

(base) mmohebuj@CASTFX0F4V2Math ~ % xcode-select -p

/Applications/Xcode.app/Contents/Developer

(base) mmohebuj@CASTFX0F4V2Math ~ % ls -l /Library/Developer/CommandLineTools

total 0

drwxr-xr-x  5 root  wheel  160 Dec  7 01:09 Library

drwxr-xr-x  7 root  wheel  224 Dec 31 17:07 SDKs

drwxr-xr-x  7 root  wheel  224 Dec  7 01:12 usr

(base) mmohebuj@CASTFX0F4V2Math ~ % ls -l /Library/Developer/CommandLineTools

total 0

drwxr-xr-x  5 root  wheel  160 Dec  7 01:09 Library

drwxr-xr-x  7 root  wheel  224 Dec 31 17:07 SDKs

drwxr-xr-x  7 root  wheel  224 Dec  7 01:12 usr

(base) mmohebuj@CASTFX0F4V2Math ~ % xcode-select --install

xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

(base) mmohebuj@CASTFX0F4V2Math ~ % xcode-select -p

/Applications/Xcode.app/Contents/Developer

(base) mmohebuj@CASTFX0F4V2Math ~ % git --version

git version 2.39.5 (Apple Git-154)

(base) mmohebuj@CASTFX0F4V2Math ~ % brew config

HOMEBREW_VERSION: 4.4.14

ORIGIN: https://github.com/Homebrew/brew

HEAD: f84082963da8af8c9ccd6dffbe932eba457e2b78

Last commit: 2 days ago

Branch: stable

Core tap JSON: 01 Jan 00:49 UTC

Core cask tap JSON: 01 Jan 00:49 UTC

HOMEBREW_PREFIX: /opt/homebrew

HOMEBREW_CASK_OPTS: []

HOMEBREW_MAKE_JOBS: 12

Homebrew Ruby: 3.3.6 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby

CPU: dodeca-core 64-bit arm_blizzard_avalanche

Clang: 16.0.0 build 1600

Git: 2.39.5 => /Applications/Xcode.app/Contents/Developer/usr/bin/git

Curl: 8.7.1 => /usr/bin/curl

macOS: 14.7.2-arm64

CLT: 16.2.0.0.1.1733547573

Xcode: 16.2

Rosetta 2: false

(base) mmohebuj@CASTFX0F4V2Math ~ % cmake --version

cmake version 3.31.3


CMake suite maintained and supported by Kitware (kitware.com/cmake).


./candi.sh -j 8 --packages="hdf5 p4est trilinos dealii"

-- Include /Users/mmohebuj/dealii-candi/tmp/unpack/deal.II-v9.6.1/cmake/setup_compiler_flags.cmake

-- Performing Test DEAL_II_HAVE_USABLE_USER_FLAGS_DEBUG

-- Performing Test DEAL_II_HAVE_USABLE_USER_FLAGS_DEBUG - Success

-- Performing Test DEAL_II_HAVE_USABLE_USER_FLAGS_RELEASE

-- Performing Test DEAL_II_HAVE_USABLE_USER_FLAGS_RELEASE - Success

-- 

-- Include /Users/mmohebuj/dealii-candi/tmp/unpack/deal.II-v9.6.1/cmake/setup_compiler_flags_gnu.cmake

-- 

-- Include /Users/mmohebuj/dealii-candi/tmp/unpack/deal.II-v9.6.1/bundled/setup_bundled.cmake

-- 

-- Include /Users/mmohebuj/dealii-candi/tmp/unpack/deal.II-v9.6.1/cmake/checks/check_01_cpu_features.cmake

-- 


-- Include /Users/mmohebuj/dealii-candi/tmp/unpack/deal.II-v9.6.1/cmake/checks/check_01_cxx_features.cmake

-- C++17 support is disabled.

CMake Error at cmake/checks/check_01_cxx_features.cmake:368 (message):

 

  The current version of deal.II requires a compiler with enabled C++17

  support.  Make sure to use a modern enough compiler (GCC version 9 onwards,

  Clang version 10 onwards, or Microsoft MS VS 2019 onwards) and check that

  the compiler flag "-std=" is either unset, or set to at least c++17.

  Similarly, please make sure that the CMake variable CMAKE_CXX_STANDARD is

  either unset, or set at least to 17.



Call Stack (most recent call first):

  cmake/macros/macro_verbose_include.cmake:18 (include)

  CMakeLists.txt:116 (verbose_include)

-- Configuring incomplete, errors occurred!

Failure with exit status: 1

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dealii/87h66j7jeq.fsf%4043-1.org.

Matthias Maier

unread,
Jan 1, 2025, 3:15:47 PM1/1/25
to dea...@googlegroups.com
Would you mind to post the file

<build directory>/CMakeFiles/CMakeConfigureLog.yaml ?

Happy New Year,
Matthias
> *./candi.sh -j 8 --packages="hdf5 p4est trilinos dealii"*

akash ahmed

unread,
Jan 1, 2025, 3:26:50 PM1/1/25
to dea...@googlegroups.com
Dear Dr. Maier:

Sure, please find it attached to this email.

Thank you
Jaman

CMakeConfigureLog.yaml

Matthias Maier

unread,
Jan 2, 2025, 4:44:41 PM1/2/25
to dea...@googlegroups.com
It picks up the correct compiler:

/Library/Developer/CommandLineTools/usr/bin/c++

But then all of the copmiler invocations fail with something like:

ld: library not found for -lc++

This looks like that the C++ standard library (which is called libc++
for clang/llvm) is not installed properly.



Are you able to compile a simple hello world by hand? hello_world.cpp:

#include <iostream>
int main() { std::cout << "Hello World!" << std::endl; }

(If yes, did you use the compiler at
/Library/Developer/CommandLineTools/usr/bin/c++ ?)



Can you uninstall the "CommandLineTools" package, make sure that the
directory is completely removed, and reinstall? (This fixed a similar
issue lately for us.)



Best,
Matthias

akash ahmed

unread,
Jan 2, 2025, 8:07:39 PM1/2/25
to dea...@googlegroups.com
Dear Dr. Maier:

Good evening. Yes, I could compile the hello_world.cpp program with g++ and it works. Then

I uninstalled the "CommandLineTools" package and removed with sudo rm -rf /Library/Developer/CommandLineTools

Again, I installed homebrew which installed the Xcode.
Then installed with

./candi.sh -j 8 --packages="hdf5 p4est trilinos dealii"


and unfortunately, encountered the same issue. 


Thank you

Jaman



akash ahmed

unread,
Jan 6, 2025, 9:43:59 AM1/6/25
to dea...@googlegroups.com
Dear all,

The problem is resolved. Here is what I have done:

Upgraded the xcode, cmake and macOS then restarted the computer.

./candi.sh -j 8 --packages="hdf5 p4est trilinos dealii"
However, ended with exit 2, which was different from the previous (exit 1).
Remove hdf5 and run as below:
./candi.sh -j 8 --packages="p4est trilinos dealii"

Thank you for your support.
-Jaman
Reply all
Reply to author
Forward
0 new messages