Open tesari opened 1 year ago
Hi,
I had this problem some time ago and posted the solution here: https://github.com/AMReX-Codes/Amrvis/issues/27#issuecomment-1315471957
A slightly easier way to specify the path to gcc is this: https://github.com/AMReX-Codes/amrex/issues/3033#issuecomment-1315608917
Hi,
Building Amrvis on Apple M2 Pro (Ventura 13.4.1) fails with:
Xm/Xm.h:1514:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
I get the same error with clang and with gcc. Could you advice, please?
Thanks, Ted
tsar@Amrvis % tsar@Amrvis % make Loading ../amrex/Tools/GNUMake/comps/llvm.mak... Loading ../amrex/Tools/GNUMake/sites/Make.unknown... ../amrex/Tools/GNUMake/Make.rules:505: tmp_build_dir/d/2d.llvm.DEBUG.EXE/f90.depends: No such file or directory Generating AMReX_Config.H ... Generating AMReX_Version.H ... Building f90/F90 dependency File ... ../amrex/Tools/F_scripts/dep.py --prefix tmp_build_dir/o/2d.llvm.DEBUG.EXE \ --temp_dir tmp_build_dir/f/2d.llvm.DEBUG.EXE \ --cpp "cpp -E -traditional-cpp -P" \ --defines "-DBL_LANG_FORT -DAMREX_LANG_FORT -DAMREX_EXPORT_DYNAMIC -DAMREX_DEBUG -DAMREX_GPU_MAX_THREADS=0 -DBL_SPACEDIM=2 -DAMREX_SPACEDIM=2 -DBL_FORT_USE_UNDERSCORE -DAMREX_FORT_USE_UNDERSCORE -DBL_Darwin -DAMREX_Darwin -DBL_USE_ASSERTION -DAMREX_USE_ASSERTION -DBL_OPTIO -Itmp_build_dir/s/2d.llvm.DEBUG.EXE -I. -I. -I../amrex/Src/Base -I../amrex/Src/Extern/amrdata -I/opt/homebrew/include -I/usr/include/ -I/usr/local/include -I/opt/local/include -I/opt/X11/include -I../amrex/Src/Base -I../amrex/Src/Base/Parser -I../amrex/Src/Extern/amrdata " \ --f90_preprocess "cat " ../amrex/Src/Base/AMReX_constants_mod.f90 ../amrex/Src/Base/AMReX_FILCC_2D.F90 ../amrex/Src/Base/AMReX_BLutil_F.F90 ../amrex/Src/Base/AMReX_BLProfiler_F.F90 ../amrex/Src/Base/AMReX_filcc_mod.F90 ../amrex/Src/Base/AMReX_omp_mod.F90 ../amrex/Src/Base/AMReX_acc_mod.F90 ../amrex/Src/Base/AMReX_fort_mod.F90 ../amrex/Src/Base/AMReX_error_mod.F90 ../amrex/Src/Base/AMReX_parmparse_mod.F90 ../amrex/Src/Base/AMReX_string_mod.F90 ../amrex/Src/Base/AMReX_bc_types_mod.F90 ../amrex/Src/Base/AMReX_io_mod.F90 ../amrex/Src/Base/AMReX_ParallelDescriptor_F.F90 ../amrex/Src/Base/AMReX_mempool_mod.F90 tmp_build_dir/s/2d.llvm.DEBUG.EXE/AMReX_Config.H tmp_build_dir/s/2d.llvm.DEBUG.EXE/AMReX_Version.H > tmp_build_dir/d/2d.llvm.DEBUG.EXE/f90.depends Depending ../amrex/Src/Extern/amrdata/AMReX_FABUTIL_2D.F ... /usr/include/ does not exist Loading ../amrex/Tools/GNUMake/comps/llvm.mak... Loading ../amrex/Tools/GNUMake/sites/Make.unknown... Compiling AmrPicture.cpp ... clang++ -MMD -MP -g -O0 -ftrapv -Wall -Wextra -Wno-sign-compare -Wunreachable-code -Wnull-dereference -Wfloat-conversion -Wextra-semi -Wpedantic -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wno-c++17-extensions -std=c++17 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -pthread -DAMREX_EXPORT_DYNAMIC -DAMREX_DEBUG -DAMREX_GPU_MAX_THREADS=0 -DBL_SPACEDIM=2 -DAMREX_SPACEDIM=2 -DBL_FORT_USE_UNDERSCORE -DAMREX_FORT_USE_UNDERSCORE -DBL_Darwin -DAMREX_Darwin -DBL_USE_ASSERTION -DAMREX_USE_ASSERTION -DBL_OPTIO -Itmp_build_dir/s/2d.llvm.DEBUG.EXE -I. -I. -I../amrex/Src/Base -I../amrex/Src/Extern/amrdata -I/opt/homebrew/include -I/usr/include/ -I/usr/local/include -I/opt/local/include -I/opt/X11/include -I../amrex/Src/Base -I../amrex/Src/Base/Parser -I../amrex/Src/Extern/amrdata -c AmrPicture.cpp -o tmp_build_dir/o/2d.llvm.DEBUG.EXE/AmrPicture.o In file included from AmrPicture.cpp:7: In file included from ./PltApp.H:9: /opt/homebrew/include/Xm/Xm.h:1514:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_type, ^
~~~~ /opt/homebrew/include/Xm/Xm.h:1515:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_val, ^~~~~ zsh: command not found: tsar@Amrvis zsh: command not found: Loading zsh: command not found: Loading zsh: no such file or directory: ../amrex/Tools/GNUMake/Make.rules:505: zsh: command not found: Generating zsh: command not found: Generating zsh: command not found: Building zsh: command not found: Depending zsh: no such file or directory: /usr/include/ zsh: command not found: Loading zsh: command not found: Loading zsh: command not found: Compiling In file included from AmrPicture.cpp:7: In file included from ./PltApp.H:9: /opt/homebrew/include/Xm/Xm.h:1514:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_type, ^~~~~ /opt/homebrew/include/Xm/Xm.h:1515:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_val, ^~~~~ /opt/homebrew/include/Xm/Xm.h:1516:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int to_type) ; ^~~~~ /opt/homebrew/include/Xm/Xm.h:1519:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_val, ^~~~~ /opt/homebrew/include/Xm/Xm.h:1520:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_type) ; ^~~~~ /opt/homebrew/include/Xm/Xm.h:1523:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_val, ^~~~~ /opt/homebrew/include/Xm/Xm.h:1524:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_type) ; ^~~~~ /opt/homebrew/include/Xm/Xm.h:1527:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_val, ^~~~~ /opt/homebrew/include/Xm/Xm.h:1528:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int to_type) ; ^~~~~ /opt/homebrew/include/Xm/Xm.h:1531:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int from_val, ^~~~~ /opt/homebrew/include/Xm/Xm.h:1532:25: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int to_type) ; ^~~~~ AmrPicture.cpp:1604:3: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(buffer, "Creating frames..."); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'define deprecated_msg(_msg) attribute((deprecated__(_msg)))
AmrPicture.cpp:1734:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(buffer, "Cancelled.\n"); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
define deprecated_msg(_msg) attribute((deprecated__(_msg)))
AmrPicture.cpp:1770:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(buffer, "Done.\n"); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
define deprecated_msg(_msg) attribute((deprecated__(_msg)))
In file included from AmrPicture.cpp:6: ./AmrPicture.H:129:25: warning: private field 'myColor' is not used [-Wunused-private-field] int hColor, vColor, myColor, slice, sliceDir; ^ ./AmrPicture.H:131:40: warning: private field 'isSubDomain' is not used [-Wunused-private-field] bool pixMapCreated, isSubDomain, findSubRange; ^ ./AmrPicture.H:131:53: warning: private field 'findSubRange' is not used [-Wunused-private-field] bool pixMapCreated, isSubDomain, findSubRange; ^ 6 warnings and 11 errors generated. zsh: command not found: In zsh: command not found: In zsh: no matches found: [-Wregister] zsh: command not found: register zsh: command not found: ^
~~~~ zsh: no matches found: [-Wregister] zsh: command not found: register zsh: command not found: ^~~~~ tsar@Amrvis %