[Dune] Configuration problems in macOS - FortranCInterface

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Sun Oct 8 13:11:23 CEST 2017


Hi Santiago,

> Am 08.10.2017 um 04:52 schrieb HD <s.ospina at stud.uni-heidelberg.de>:
> 
> Dear DUNE developers,
> 
> I’m trying to install DUNE on my personal laptop, and I’m having troubles on the configuration phase.
> 
> My OS is macOS High Sierra. (I have updated my OS recently, then, my old mpi installation is probably not working, however, it seems to me that this problem is not related to that.)

that’s brave - I tend to wait at least until .1 or .2 before doing the plunge… so I’m still on Sierra, but this looks like
a compiler mixup - you’re using the C++ compiler (clang) shipped by Apple with XCode (/usr/bin/c++), but then
you also have a GCC installed in /usr/local (Homebrew?).

If you have a GCC available, try compiling everything with that (by setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER).
Also, you don’t need CMAKE_INSTALL_PREFIX - you typically don’t want to install a development version of DUNE.
Just put you own modules in the same directory as the upstream DUNE modules, and dunecontrol will piece
everything together correctly.

Cheers
Steffen

> 
> The following, are the steps I’ve done so far to get the error shown at the end:
> 
> mkdir DUNE
> cd DUNE
> git clone https://gitlab.dune-project.org/core/dune-common.git
> 
> echo "CMAKE_FLAGS=\"
> -DCMAKE_INSTALL_PREFIX=~/Codes/DUNE/install
> -DCMAKE_CXX_COMPILER='/usr/bin/c++'
> \"
> " > install.opts
> 
> ROOT_DIR=$(pwd)
> OPTS_FILE=$ROOT_DIR/install.opts
> BUILD_DIR=$ROOT_DIR/build
> 
> ./dune-common/bin/dunecontrol --opts=${OPTS_FILE} --builddir=${BUILD_DIR} all
> 
> OUTPUT:
> 
> ----- using default flags $CMAKE_FLAGS from /Users/soilros/Codes/DUNE/install.opts -----
> --- going to build dune-common  ---
> --- calling all for dune-common ---
> --- calling vcsetup for dune-common ---
> --- calling configure for dune-common ---
> find: dune: No such file or directory
>  cmake   -DCMAKE_INSTALL_PREFIX=~/Codes/DUNE/install -DCMAKE_CXX_COMPILER='/usr/bin/c++' "/Users/soilros/Codes/DUNE/dune-common"
> -- The C compiler identification is AppleClang 8.1.0.8020041
> -- The CXX compiler identification is AppleClang 8.1.0.8020041
> -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
> -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- The Fortran compiler identification is GNU 7.1.0
> -- Checking whether Fortran compiler has -isysroot
> -- Checking whether Fortran compiler has -isysroot - yes
> -- Checking whether Fortran compiler supports OSX deployment target flag
> -- Checking whether Fortran compiler supports OSX deployment target flag - yes
> -- Check for working Fortran compiler: /usr/local/bin/gfortran
> -- Check for working Fortran compiler: /usr/local/bin/gfortran  -- works
> -- Detecting Fortran compiler ABI info
> -- Detecting Fortran compiler ABI info - done
> -- Checking whether /usr/local/bin/gfortran supports Fortran 90
> -- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- yes
> -- Performing Test cxx_std_flag_17
> -- Performing Test cxx_std_flag_17 - Failed
> -- Performing Test cxx_std_flag_1z
> -- Performing Test cxx_std_flag_1z - Success
> -- Performing Test compiler_supports_cxx17
> -- Performing Test compiler_supports_cxx17 - Success
> -- Performing Test HAS_ATTRIBUTE_UNUSED
> -- Performing Test HAS_ATTRIBUTE_UNUSED - Success
> -- Performing Test HAS_ATTRIBUTE_DEPRECATED
> -- Performing Test HAS_ATTRIBUTE_DEPRECATED - Success
> -- Performing Test HAS_ATTRIBUTE_DEPRECATED_MSG
> -- Performing Test HAS_ATTRIBUTE_DEPRECATED_MSG - Success
> -- Performing Test HAVE_IS_INDEXABLE_SUPPORT
> -- Performing Test HAVE_IS_INDEXABLE_SUPPORT - Success
> -- Performing Test DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
> -- Performing Test DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION - Failed
> -- Performing Test DUNE_HAVE_CXX_OPTIONAL
> -- Performing Test DUNE_HAVE_CXX_OPTIONAL - Failed
> -- Looking for pthread.h
> -- Looking for pthread.h - found
> -- Looking for pthread_create
> -- Looking for pthread_create - found
> -- Found Threads: TRUE
> -- Performing Test STDTHREAD_WORKS
> -- Performing Test STDTHREAD_WORKS - Success
> -- Performing Test DUNE_SUPPORTS_CXX_THROW_IN_CONSTEXPR
> -- Performing Test DUNE_SUPPORTS_CXX_THROW_IN_CONSTEXPR - Success
> -- Looking for C++ include experimental/type_traits
> -- Looking for C++ include experimental/type_traits - found
> -- Looking for std::make_unique<int>
> -- Looking for std::make_unique<int> - found
> -- Looking for std::move<std::bool_constant<true>>
> -- Looking for std::move<std::bool_constant<true>> - found
> -- Looking for std::apply<std::negate<int>,std::tuple<int>>
> -- Looking for std::apply<std::negate<int>,std::tuple<int>> - not found
> -- Looking for std::experimental::apply<std::negate<int>,std::tuple<int>>
> -- Looking for std::experimental::apply<std::negate<int>,std::tuple<int>> - found
> -- Looking for std::experimental::make_array<int,int>
> -- Looking for std::experimental::make_array<int,int> - not found
> -- Looking for std::move<std::experimental::detected_t<std::decay_t,int>>
> -- Looking for std::move<std::experimental::detected_t<std::decay_t,int>> - not found
> -- Performing Test HAVE_CXA_DEMANGLE
> -- Performing Test HAVE_CXA_DEMANGLE - Success
> -- Found MPI_C: /usr/local/Cellar/open-mpi/2.0.1/lib/libmpi.dylib
> -- Found MPI_CXX: /usr/local/Cellar/open-mpi/2.0.1/lib/libmpi.dylib
> -- Found MPI_Fortran: /usr/local/Cellar/open-mpi/2.0.1/lib/libmpi_usempif08.dylib;/usr/local/Cellar/open-mpi/2.0.1/lib/libmpi_usempi_ignore_tkr.dylib;/usr/local/Cellar/open-mpi/2.0.1/lib/libmpi_mpifh.dylib;/usr/local/Cellar/open-mpi/2.0.1/lib/libmpi.dylib
> -- Detecting Fortran/C Interface
> -- Detecting Fortran/C Interface - Failed to compile
> -- Verifying Fortran/CXX Compiler Compatibility
> CMake Warning (dev) at /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface.cmake:309 (message):
>   No FortranCInterface mangling known for VerifyFortran
> Call Stack (most recent call first):
>   /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify/CMakeLists.txt:16 (FortranCInterface_HEADER)
> This warning is for project developers.  Use -Wno-dev to suppress it.
> -- Verifying Fortran/CXX Compiler Compatibility - Failed
> CMake Error at /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface.cmake:383 (message):
>   The Fortran compiler:
>     /usr/local/bin/gfortran
>   and the CXX compiler:
>     /usr/bin/c++
>   failed to compile a simple test project using both languages.  The output
>   was:
>     Change Dir: /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX
> 
>     Run Build Command:"/usr/bin/make" "VerifyFortranC"
>     /Applications/CMake.app/Contents/bin/cmake -H/Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify -B/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX --check-build-system CMakeFiles/Makefile.cmake 0
>     /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 VerifyFortranC
>     /Applications/CMake.app/Contents/bin/cmake -H/Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify -B/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX --check-build-system CMakeFiles/Makefile.cmake 0
>     /Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles 6
>     /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 CMakeFiles/VerifyFortranC.dir/all
>     /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/depend
>     cd /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles/VerifyFortran.dir/DependInfo.cmake
>     Scanning dependencies of target VerifyFortran
>     /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/requires
>     make[3]: Nothing to be done for `CMakeFiles/VerifyFortran.dir/requires'.
>     /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/build
>     [ 16%] Building Fortran object CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
>     /usr/local/bin/gfortran -DVERIFY_CXX -I/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX  -O3 -DNDEBUG -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk   -c /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify/VerifyFortran.f -o CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
>     [ 33%] Linking Fortran static library libVerifyFortran.a
>     /Applications/CMake.app/Contents/bin/cmake -P CMakeFiles/VerifyFortran.dir/cmake_clean_target.cmake
>     /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/VerifyFortran.dir/link.txt --verbose=1
>     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar qc libVerifyFortran.a  CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
>     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib libVerifyFortran.a
>     [ 33%] Built target VerifyFortran
>     /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/depend
>     cd /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles/VerifyFortranC.dir/DependInfo.cmake
>     Scanning dependencies of target VerifyFortranC
>     /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/build
>     [ 50%] Building C object CMakeFiles/VerifyFortranC.dir/main.c.o
>     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DVERIFY_CXX -I/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX  -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk   -o CMakeFiles/VerifyFortranC.dir/main.c.o   -c /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify/main.c
>     [ 66%] Building C object CMakeFiles/VerifyFortranC.dir/VerifyC.c.o
>     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DVERIFY_CXX -I/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX  -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk   -o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o   -c /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify/VerifyC.c
>     [ 83%] Building CXX object CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o
>     /usr/bin/c++  -DVERIFY_CXX -I/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX  -std=c++1z -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk   -o CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o -c /Applications/CMake.app/Contents/share/cmake-3.8/Modules/FortranCInterface/Verify/VerifyCXX.cxx
>     [100%] Linking CXX executable VerifyFortranC
>     /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/VerifyFortranC.dir/link.txt --verbose=1
>     /usr/bin/c++  -std=c++1z -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/VerifyFortranC.dir/main.c.o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o  -o VerifyFortranC  -L/usr/local/Cellar/gcc/7.1.0/lib/gcc/7/gcc/x86_64-apple-darwin16.5.0/7.1.0  -L/usr/local/Cellar/gcc/7.1.0/lib/gcc/7 libVerifyFortran.a -lgfortran -lquadmath -lm
>     Undefined symbols for architecture x86_64:
>       "_VerifyFortran", referenced from:
>           _main in main.c.o
>     ld: symbol(s) not found for architecture x86_64
>     clang: error: linker command failed with exit code 1 (use -v to see invocation)
>     make[3]: *** [VerifyFortranC] Error 1
>     make[2]: *** [CMakeFiles/VerifyFortranC.dir/all] Error 2
>     make[1]: *** [CMakeFiles/VerifyFortranC.dir/rule] Error 2
>     make: *** [VerifyFortranC] Error 2
> 
> Call Stack (most recent call first):
>   cmake/modules/DuneMacros.cmake:707 (FortranCInterface_VERIFY)
>   CMakeLists.txt:17 (dune_project)
> 
> -- Configuring incomplete, errors occurred!
> See also "/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/CMakeOutput.log".
> See also "/Users/soilros/Codes/DUNE/build/dune-common/CMakeFiles/CMakeError.log".
> --- Failed to build dune-common ---
> Terminating dunecontrol due to previous errors!
> 
> Thanks,
> Santiago O.
> _______________________________________________
> Dune mailing list
> Dune at lists.dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune



--------------------------------
Steffen Müthing
Interdisciplinary Center for Scientific Computing
Heidelberg University

Im Neuenheimer Feld 205
69120 Heidelberg
Germany

+49 6221 54 14516
steffen.muething at iwr.uni-heidelberg.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20171008/78ee2c6a/attachment.sig>


More information about the Dune mailing list