Compiling HANDE on macOS Monterey

235 views
Skip to first unread message

juan fernandez pottecher

unread,
Jul 22, 2022, 4:08:46 PM7/22/22
to HANDE users
This is a report of my experience compiling HANDE on macOS Monterey, with GCC and CMake.

Problem: macOS seems to be using clang (seemingly at the same time as GCC, even after adding GCC to the path), the default compiler in macOS. This causes an error when CMake tries to compile HANDE:

CMake Error at /usr/local/Cellar/cmake/3.23.2/share/cmake/Modules/CMakeTestFortranCompiler.cmake:61 (message): The Fortran compiler "/usr/local/bin/gfortran" is not able to compile a simple test program. It fails with the following output: Change Dir: /Users/jdf54/Desktop/2022internship/calculations/bin/hande/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make -f Makefile cmTC_edfbb/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_edfbb.dir/build.make CMakeFiles/cmTC_edfbb.dir/build Building Fortran object CMakeFiles/cmTC_edfbb.dir/testFortranCompiler.f.o /usr/local/bin/gfortran -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -c /Users/jdf54/Desktop/2022internship/calculations/bin/hande/build/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_edfbb.dir/testFortranCompiler.f.o clang: error: invalid version number in '-mmacosx-version-min=12.5' make[1]: *** [CMakeFiles/cmTC_edfbb.dir/testFortranCompiler.f.o] Error 1 make: *** [cmTC_edfbb/fast] Error 2 CMake will not be able to correctly generate this project.

Information on the clang error (clang: error: invalid version number in '-mmacosx-version-min=12.5'): the last comment in this source (https://stackoverflow.com/questions/25352389/what-is-the-difference-between-macosx-deployment-target-and-mmacosx-version-min ) says "Keep in mind, that apple changed default compiler to clang. Currently clang tries to translate gcc flags to his own. But it doesn't cover 100%. So it might happen that --mmacosx-version-min will stop working one day." which may explain things. In addition to that, this source ( https://stackoverflow.com/questions/63972113/big-sur-clang-invalid-version-error-due-to-macosx-deployment-target) suggests that reinstalling the Command Line Tools and exporting

export SYSTEM_VERSION_COMPAT=1

would work. 

Found solution: reinstalling the Command Line Tools and exporting SYSTEM_VERSION_COMPAT=1 worked for me. Another possible solution could be to force the compilation to occur through GCC only, but this is not something I tried.

note: compilation was performed without including MPI software.
note2: pkg-config had to be installed as an extra dependency, but this was probably required by CMake.

Testing: the results of running the tests (I have not looked into this further):


All done. ERROR: only 70 out of 119 tests passed (2 skipped).

Failed tests in:

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ccmc/np2/H2O-cc-pVDZ_ccsdt/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ccmc/np2/H2O-cc-pVDZ_tau_search/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ccmc/np2/Ne-RHF-cc-pVDZ-Lz-CAS8_12-CCSDT-hdf5-system/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ccmc/np2/Ne-RHF-cc-pVDZ_ccmc_linked/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ccmc/np2/Ne-aug-cc-pVDZ-ccsdtq_nc/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ccmc/np2/ringium_ccsd_restart/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ccmc/np4/H2O-cc-pVDZ_ccsdmc_continue/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/dmqmc/np2/hubbard_k_1d/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/dmqmc/np2/n2_sto3g/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/dmqmc/np4/h6_sto3g/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/dmqmc/np4/ueg_n7_rs1_e1_dmqmc/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/dmqmc_real_32/np2/heisenberg_4_gs_entropy/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/dmqmc_real_32/np4/ueg_n4_rs2_e4/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc/np2/polyyne_complex_replica_restart/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc/np2/polyyne_complex_replica_restart_legacyv1/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc/np2/ueg_n10_rs2_e4_tau_search/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc/np4/Ne-RHF-cc-pVDZ_calc_interact/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc/np4/Ne-RHF-cc-pVDZ_softexit/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc_real_32/np2/ueg_n10_rs2_e4_fciqmc_real_32_SS_large_restart/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc_real_32/np4/heisenberg_4x4_real_32_SS/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/fciqmc_real_32/np4/ueg_n7_rs1_e1_SS_cisdtq_replica/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ifciqmc/np4/H2O-RHF-cc-pVTZ-non-block-hdf5-system/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ifciqmc/np4/H2O-RHF-cc-pVTZ-non-block/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ifciqmc/np4/hubbard_k_1d_ifciqmc_load/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ifciqmc_real_32/np2/polyyne_complex_ifciqmc-real32/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ifciqmc_real_32/np4/H2O-RHF-cc-pVTZ-non-block/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/ifciqmc_real_32/np4/hubbard_k_1d_ifciqmc_ss_restart/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/mc_canonical_estimates/np2/H2O_ccpvdz_RHF/

   /Users/jdf54/Desktop/2022internship/calculations/bin/hande/test_suite/mc_canonical_estimates/np4/H2O_ccpvdz_RHF/


Thank you.


Reply all
Reply to author
Forward
0 new messages