diff options
author | AMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com> | 2020-12-02 14:16:54 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 09:46:54 +0100 |
commit | 721fdddde4bda8c12bdd0cc2b24d65985a022181 (patch) | |
tree | 1b8cedc6cc4cc0c58f636e33fe42918e00f0018f | |
parent | c0bbf5454c96c4ae4baad503851c43d235c12acd (diff) | |
download | spack-721fdddde4bda8c12bdd0cc2b24d65985a022181.tar.gz spack-721fdddde4bda8c12bdd0cc2b24d65985a022181.tar.bz2 spack-721fdddde4bda8c12bdd0cc2b24d65985a022181.tar.xz spack-721fdddde4bda8c12bdd0cc2b24d65985a022181.zip |
namd, charmpp: patch to allow build with AMD Toolchain support (#20083)
Co-authored-by: mohan babu <mohbabul@amd.com>
4 files changed, 378 insertions, 8 deletions
diff --git a/var/spack/repos/builtin/packages/charmpp/charm_6.7.1_aocc.patch b/var/spack/repos/builtin/packages/charmpp/charm_6.7.1_aocc.patch new file mode 100644 index 0000000000..3967e5fc3e --- /dev/null +++ b/var/spack/repos/builtin/packages/charmpp/charm_6.7.1_aocc.patch @@ -0,0 +1,188 @@ +diff -bur charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh updated-charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh +--- charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh 2016-11-07 20:14:26.000000000 +0530 ++++ updated-charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh 2019-08-26 16:55:40.868903291 +0530 +@@ -14,7 +14,7 @@ + + CMK_REAL_COMPILER=`$MPICXX -show 2>/dev/null | cut -d' ' -f1 ` + case "$CMK_REAL_COMPILER" in +-g++) CMK_AMD64="-m64 -fPIC" ;; ++clang++) CMK_AMD64="-m64 -fPIC" ;; + icpc) CMK_AMD64="-m64";; + pgCC) CMK_AMD64="-DCMK_FIND_FIRST_OF_PREDICATE=1 --no_using_std " ;; + FCC) CMK_AMD64="-Kfast -DCMK_FIND_FIRST_OF_PREDICATE=1 --variadic_macros";; +diff -bur charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh +--- charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh 2016-11-07 20:14:26.000000000 +0530 ++++ updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh 2019-08-26 16:55:40.868903291 +0530 +@@ -1,14 +1,14 @@ + + case "$CMK_CC" in + mpicc*) +- CMK_CPP_C="gcc -E " +- CMK_CC="gcc -fPIC" +- CMK_CC_RELIABLE="gcc -fPIC" +- CMK_CC_FASTEST="gcc -fPIC" +- CMK_CXX="g++ -fPIC" +- CMK_CXXPP="gcc -E " +- CMK_LD="gcc" +- CMK_LDXX="g++" ++ CMK_CPP_C="clang -E " ++ CMK_CC="clang -fPIC" ++ CMK_CC_RELIABLE="clang -fPIC" ++ CMK_CC_FASTEST="clang -fPIC" ++ CMK_CXX="clang++ -fPIC" ++ CMK_CXXPP="clang -E " ++ CMK_LD="clang" ++ CMK_LDXX="clang++" + + # native compiler for compiling charmxi, etc + CMK_NATIVE_CC="$CMK_CC" +Only in updated-charm-6.7.1/src/arch/mpi-linux-x86_64: conv-mach-scyld.sh.orig +Only in updated-charm-6.7.1/src/arch/mpi-linux-x86_64: conv-mach-scyld.sh.rej +diff -bur charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh +--- charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh 2016-11-07 20:14:26.000000000 +0530 ++++ updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh 2019-08-26 16:55:40.868903291 +0530 +@@ -23,7 +23,7 @@ + + CMK_REAL_COMPILER=`$MPICXX -show 2>/dev/null | cut -d' ' -f1 ` + case "$CMK_REAL_COMPILER" in +-g++) CMK_AMD64_CC="$CMK_GCC64"; CMK_AMD64_CXX="$CMK_GCC64" ;; ++clang++) CMK_AMD64_CC="$CMK_GCC64"; CMK_AMD64_CXX="$CMK_GCC64" ;; + pgCC) CMK_AMD64_CC="-fPIC"; CMK_AMD64_CXX="-fPIC -DCMK_FIND_FIRST_OF_PREDICATE=1 --no_using_std " ;; + charmc) echo "Error> charmc can not call AMPI's mpicxx/mpiCC wrapper! Please fix your PATH."; exit 1 ;; + esac +@@ -38,10 +38,10 @@ + CMK_LIBS="-lckqt $CMK_SYSLIBS " + CMK_LD_LIBRARY_PATH="-Wl,-rpath,$CHARMLIBSO/" + +-CMK_NATIVE_CC="gcc $CMK_GCC64 " +-CMK_NATIVE_LD="gcc $CMK_GCC64 " +-CMK_NATIVE_CXX="g++ $CMK_GCC64 " +-CMK_NATIVE_LDXX="g++ $CMK_GCC64 " ++CMK_NATIVE_CC="clang $CMK_GCC64 " ++CMK_NATIVE_LD="clang $CMK_GCC64 " ++CMK_NATIVE_CXX="clang++ $CMK_GCC64 " ++CMK_NATIVE_LDXX="clang++ $CMK_GCC64 " + CMK_NATIVE_LIBS="" + + # fortran compiler +@@ -51,7 +51,7 @@ + # CMK_FPP="/lib/cpp -P -CC" + # CMK_CF90="$CMK_CF90 -fpic -fautomatic -fdollar-ok " + # CMK_CF90_FIXED="$CMK_CF90 -ffixed-form " +-# CMK_F90LIBS="-lgfortran " ++# CMK_F90LIBS=" " + # CMK_F90_USE_MODDIR=1 + # CMK_F90_MODINC="-I" + # CMK_MOD_NAME_ALLCAPS= +diff -bur charm-6.7.1/src/libs/ck-libs/ckloop/Makefile updated-charm-6.7.1/src/libs/ck-libs/ckloop/Makefile +--- charm-6.7.1/src/libs/ck-libs/ckloop/Makefile 2016-11-07 20:14:28.000000000 +0530 ++++ updated-charm-6.7.1/src/libs/ck-libs/ckloop/Makefile 2019-08-26 16:55:40.852903122 +0530 +@@ -38,7 +38,7 @@ + for i in $(LIBOBJ) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$i : $$SRCFILE" ; \ +- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ ++ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; + +Only in updated-charm-6.7.1/src/libs/ck-libs/ckloop: Makefile.orig +Only in updated-charm-6.7.1/src/libs/ck-libs/ckloop: Makefile.rej +diff -bur charm-6.7.1/src/libs/ck-libs/completion/Makefile updated-charm-6.7.1/src/libs/ck-libs/completion/Makefile +--- charm-6.7.1/src/libs/ck-libs/completion/Makefile 2016-11-07 20:14:28.000000000 +0530 ++++ updated-charm-6.7.1/src/libs/ck-libs/completion/Makefile 2019-08-26 16:55:40.852903122 +0530 +@@ -45,7 +45,7 @@ + for i in $(LIBOBJ) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$i : $$SRCFILE" ; \ +- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ ++ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; + +Only in updated-charm-6.7.1/src/libs/ck-libs/completion: Makefile.orig +Only in updated-charm-6.7.1/src/libs/ck-libs/completion: Makefile.rej +diff -bur charm-6.7.1/src/libs/ck-libs/multicast/Makefile updated-charm-6.7.1/src/libs/ck-libs/multicast/Makefile +--- charm-6.7.1/src/libs/ck-libs/multicast/Makefile 2016-11-07 20:14:29.000000000 +0530 ++++ updated-charm-6.7.1/src/libs/ck-libs/multicast/Makefile 2019-08-26 16:55:40.852903122 +0530 +@@ -53,7 +53,7 @@ + for i in $(LIBOBJ) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$i : $$SRCFILE" ; \ +- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ ++ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; + +Only in updated-charm-6.7.1/src/libs/ck-libs/multicast: Makefile.orig +Only in updated-charm-6.7.1/src/libs/ck-libs/multicast: Makefile.rej +diff -bur charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile +--- charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile 2016-11-07 20:14:27.000000000 +0530 ++++ updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile 2019-08-26 16:55:40.852903122 +0530 +@@ -52,7 +52,7 @@ + for i in $(LIBOBJ) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$i : $$SRCFILE" ; \ +- g++ -MM -Wno-deprecated -I$(CDIR)/tmp -I../completion $$SRCFILE >> $(DEPENDFILE); \ ++ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp -I../completion $$SRCFILE >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; + +Only in updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer: Makefile.orig +Only in updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer: Makefile.rej +diff -bur charm-6.7.1/src/QuickThreads/Makefile updated-charm-6.7.1/src/QuickThreads/Makefile +--- charm-6.7.1/src/QuickThreads/Makefile 2016-11-07 20:14:25.000000000 +0530 ++++ updated-charm-6.7.1/src/QuickThreads/Makefile 2019-08-26 16:55:40.856903165 +0530 +@@ -1,5 +1,5 @@ + +-CC=gcc -I. -O2 ++CC=clang -I. -O2 + + all: qt stp testpgm + +diff -bur charm-6.7.1/src/scripts/Makefile updated-charm-6.7.1/src/scripts/Makefile +--- charm-6.7.1/src/scripts/Makefile 2016-11-07 20:14:29.000000000 +0530 ++++ updated-charm-6.7.1/src/scripts/Makefile 2019-08-26 16:55:40.840902996 +0530 +@@ -942,7 +942,7 @@ + SRCFILE=`basename $$i .o`.C ; \ + [ ! -f $$SRCFILE ] && SRCFILE=`basename $$i .o`.c ; \ + echo "checking dependencies for $$SRCFILE" ; \ +- if g++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ ++ if clang++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ + echo '' >> $(DEPENDFILE) ; \ + done; \ + +@@ -968,7 +968,7 @@ + found=`/usr/bin/find $$SRCDIR -depth 1 -name $$SRCFILE`; \ + [ ! $$found ] && SRCFILE=`basename $$i .o`.c ; \ + echo "checking dependencies for $$SRCFILE" ; \ +- if g++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ ++ if clang++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ + echo '' >> $(DEPENDFILE) ; \ + done; \ + +diff -bur charm-6.7.1/tests/charm++/megatest/Makefile updated-charm-6.7.1/tests/charm++/megatest/Makefile +--- charm-6.7.1/tests/charm++/megatest/Makefile 2016-11-07 20:14:30.000000000 +0530 ++++ updated-charm-6.7.1/tests/charm++/megatest/Makefile 2019-08-26 16:55:40.820902785 +0530 +@@ -118,7 +118,7 @@ + for i in $(OBJS) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$SRCFILE" ; \ +- g++ -MM -I$(CHARMINC) $$SRCFILE | \ ++ clang++ -MM -I$(CHARMINC) $$SRCFILE | \ + perl $(CHARMBIN)/dep.pl $(CHARMINC) /usr/include /usr/local >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; +--- charm-6.7.1/src/scripts/configure 2016-11-07 20:14:31.000000000 +0530 ++++ updated-charm/charm-6.7.1/src/scripts/configure 2020-10-21 12:54:06.476958828 +0530 +@@ -2141,8 +2141,8 @@ + $as_echo_n "checking \"$1\"... " >&6; } + echo "### $1" >> $charmout + cat $t >> $charmout +- echo $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -c $t -o test.o $4 >> $charmout +- $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -c $t -o test.o $4 > out 2>&1 ++ echo $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -Qunused-arguments -c $t -o test.o $4 >> $charmout ++ $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -Qunused-arguments -c $t -o test.o $4 > out 2>&1 + test_result $? "$1" "$2" "$3" + strictpass=$pass + strictfail=$fail diff --git a/var/spack/repos/builtin/packages/charmpp/charm_6.8.2_aocc.patch b/var/spack/repos/builtin/packages/charmpp/charm_6.8.2_aocc.patch new file mode 100644 index 0000000000..b1a736c2b6 --- /dev/null +++ b/var/spack/repos/builtin/packages/charmpp/charm_6.8.2_aocc.patch @@ -0,0 +1,165 @@ +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/cc-mpicxx.sh 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/cc-mpicxx.sh +--- 00/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/cc-mpicxx.sh 2018-01-11 19:06:19.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/cc-mpicxx.sh 2019-11-12 06:02:23.005454343 -0600 +@@ -15,6 +15,7 @@ + CMK_REAL_COMPILER=`$MPICXX -show 2>/dev/null | cut -d' ' -f1 ` + case "$CMK_REAL_COMPILER" in + g++) CMK_AMD64="-m64 -fPIC" ;; ++clang++) CMK_AMD64="-m64 -fPIC" ;; + icpc) CMK_AMD64="-m64";; + pgCC) CMK_AMD64="-DCMK_FIND_FIRST_OF_PREDICATE=1 --no_using_std " ;; + FCC) CMK_AMD64="-Kfast -DCMK_FIND_FIRST_OF_PREDICATE=1 --variadic_macros";; +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh +--- 00/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh 2018-01-11 19:06:19.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh 2019-11-12 06:05:22.666969636 -0600 +@@ -1,13 +1,14 @@ + + case "$CMK_CC" in + mpicc*) +- CMK_CPP_C="gcc -E " +- CMK_CC="gcc -fPIC" +- CMK_CC_RELIABLE="gcc -fPIC" +- CMK_CC_FASTEST="gcc -fPIC" +- CMK_CXX="g++ -fPIC" +- CMK_LD="gcc" +- CMK_LDXX="g++" ++ CMK_CPP_C="clang -E " ++ CMK_CC="clang -fPIC" ++ CMK_CC_RELIABLE="clang -fPIC" ++ CMK_CC_FASTEST="clang -fPIC" ++ CMK_CXXPP="clang -E " ++ CMK_CXX="clang++ -fPIC" ++ CMK_LD="clang" ++ CMK_LDXX="clang++" + + # native compiler for compiling charmxi, etc + CMK_NATIVE_CC="$CMK_CC" +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach.sh 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach.sh +--- 00/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach.sh 2018-01-11 19:06:19.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/arch/mpi-linux-x86_64/conv-mach.sh 2019-11-12 06:07:41.361999246 -0600 +@@ -23,6 +23,7 @@ + + CMK_REAL_COMPILER=`$MPICXX -show 2>/dev/null | cut -d' ' -f1 ` + case "$CMK_REAL_COMPILER" in ++clang++) CMK_AMD64_CC="$CMK_GCC64"; CMK_AMD64_CXX="$CMK_GCC64" ;; + g++) CMK_AMD64_CC="$CMK_GCC64"; CMK_AMD64_CXX="$CMK_GCC64" ;; + pgCC) CMK_AMD64_CC='-fPIC'; CMK_AMD64_CXX='-fPIC -DCMK_FIND_FIRST_OF_PREDICATE=1 --no_using_std ' ;; + charmc) echo "Error> charmc can not call AMPI's mpicxx/mpiCC wrapper! Please fix your PATH."; exit 1 ;; +@@ -37,10 +38,10 @@ + CMK_LIBS="-lckqt $CMK_SYSLIBS " + CMK_LD_LIBRARY_PATH="-Wl,-rpath,$CHARMLIBSO/" + +-CMK_NATIVE_CC="gcc $CMK_GCC64 " +-CMK_NATIVE_LD="gcc $CMK_GCC64 " +-CMK_NATIVE_CXX="g++ $CMK_GCC64 " +-CMK_NATIVE_LDXX="g++ $CMK_GCC64 " ++CMK_NATIVE_CC="clang $CMK_GCC64 " ++CMK_NATIVE_LD="clang $CMK_GCC64 " ++CMK_NATIVE_CXX="clang++ $CMK_GCC64 " ++CMK_NATIVE_LDXX="clang++ $CMK_GCC64 " + CMK_NATIVE_LIBS='' + + # fortran compiler +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/ckloop/Makefile 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/ckloop/Makefile +--- 00/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/ckloop/Makefile 2018-01-11 19:06:15.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/ckloop/Makefile 2019-11-12 06:09:16.200438412 -0600 +@@ -38,7 +38,7 @@ + for i in $(LIBOBJ) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$i : $$SRCFILE" ; \ +- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ ++ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; + +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/completion/Makefile 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/completion/Makefile +--- 00/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/completion/Makefile 2018-01-11 19:06:16.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/completion/Makefile 2019-11-12 06:09:41.247346697 -0600 +@@ -45,7 +45,7 @@ + for i in $(LIBOBJ) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$i : $$SRCFILE" ; \ +- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ ++ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; + +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/NDMeshStreamer/Makefile 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/NDMeshStreamer/Makefile +--- 00/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/NDMeshStreamer/Makefile 2018-01-11 19:06:15.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/libs/ck-libs/NDMeshStreamer/Makefile 2019-11-12 06:09:59.079993368 -0600 +@@ -52,7 +52,7 @@ + for i in $(LIBOBJ) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$i : $$SRCFILE" ; \ +- g++ -MM -Wno-deprecated -I$(CDIR)/tmp -I../completion $$SRCFILE >> $(DEPENDFILE); \ ++ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp -I../completion $$SRCFILE >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; + +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/QuickThreads/Makefile 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/QuickThreads/Makefile +--- 00/NAMD_2.13_Source/charm-6.8.2/src/QuickThreads/Makefile 2018-01-11 19:06:13.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/QuickThreads/Makefile 2019-11-12 06:10:37.744395459 -0600 +@@ -1,5 +1,5 @@ + +-CC=gcc -I. -O2 ++CC=clang -I. -O2 + + all: qt stp testpgm + +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/src/scripts/Makefile 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/scripts/Makefile +--- 00/NAMD_2.13_Source/charm-6.8.2/src/scripts/Makefile 2018-01-11 19:06:20.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/scripts/Makefile 2019-11-12 06:10:59.888198461 -0600 +@@ -962,7 +962,7 @@ + SRCFILE=`basename $$i .o`.C ; \ + [ ! -f $$SRCFILE ] && SRCFILE=`basename $$i .o`.c ; \ + echo "checking dependencies for $$SRCFILE" ; \ +- if g++ -std=c++0x -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ ++ if clang++ -std=c++0x -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ + echo '' >> $(DEPENDFILE) ; \ + done; \ + +@@ -988,7 +988,7 @@ + found=`/usr/bin/find $$SRCDIR -depth 1 -name $$SRCFILE`; \ + [ ! $$found ] && SRCFILE=`basename $$i .o`.c ; \ + echo "checking dependencies for $$SRCFILE" ; \ +- if g++ -std=c++0x -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ ++ if clang++ -std=c++0x -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \ + echo '' >> $(DEPENDFILE) ; \ + done; \ + +diff -ruN 00/NAMD_2.13_Source/charm-6.8.2/tests/charm++/megatest/Makefile 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/tests/charm++/megatest/Makefile +--- 00/NAMD_2.13_Source/charm-6.8.2/tests/charm++/megatest/Makefile 2018-01-11 19:06:18.000000000 -0600 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/tests/charm++/megatest/Makefile 2019-11-12 06:11:38.193587531 -0600 +@@ -116,7 +116,7 @@ + for i in $(OBJS) ; do \ + SRCFILE=`basename $$i .o`.C ; \ + echo "checking dependencies for $$SRCFILE" ; \ +- g++ -std=c++0x -MM -I$(CHARMINC) $$SRCFILE | \ ++ clang++ -std=c++0x -MM -I$(CHARMINC) $$SRCFILE | \ + perl $(CHARMBIN)/dep.pl $(CHARMINC) /usr/include /usr/local >> $(DEPENDFILE); \ + echo ' $$(CHARMC) -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \ + done; +--- 00/NAMD_2.13_Source/charm-6.8.2/src/scripts/configure 2018-01-12 06:36:21.000000000 +0530 ++++ 00_aocc-patch/NAMD_2.13_Source/charm-6.8.2/src/scripts/configure 2020-10-21 15:01:20.240748316 +0530 +@@ -2183,8 +2183,8 @@ + $as_echo_n "checking \"$1\"... " >&6; } + echo "### $1" >> $charmout + cat $tc >> $charmout +- echo $CMK_CC -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CC $OPTS_LD -c $tc -o test.o $4 >> $charmout +- $CMK_CC -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CC $OPTS_LD -c $tc -o test.o $4 > out 2>&1 ++ echo $CMK_CC -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CC $OPTS_LD -Qunused-arguments -c $tc -o test.o $4 >> $charmout ++ $CMK_CC -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CC $OPTS_LD -Qunused-arguments -c $tc -o test.o $4 > out 2>&1 + test_result $? "$1" "$2" "$3" + strictpass=$pass + strictfail=$fail +@@ -2208,8 +2208,8 @@ + $as_echo_n "checking \"$1\"... " >&6; } + echo "### $1" >> $charmout + cat $t >> $charmout +- echo $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -c $t -o test.o $4 >> $charmout +- $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -c $t -o test.o $4 > out 2>&1 ++ echo $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -Qunused-arguments -c $t -o test.o $4 >> $charmout ++ $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -Qunused-arguments -c $t -o test.o $4 > out 2>&1 + test_result $? "$1" "$2" "$3" + strictpass=$pass + strictfail=$fail diff --git a/var/spack/repos/builtin/packages/charmpp/package.py b/var/spack/repos/builtin/packages/charmpp/package.py index 0100be6dc1..b6522f003c 100644 --- a/var/spack/repos/builtin/packages/charmpp/package.py +++ b/var/spack/repos/builtin/packages/charmpp/package.py @@ -43,6 +43,10 @@ class Charmpp(Package): # Patch is no longer needed in versions 6.8.0+ patch("mpi.patch", when="@:6.7.1") + # Patch for AOCC + patch('charm_6.7.1_aocc.patch', when="@6.7.1 %aocc", level=1) + patch('charm_6.8.2_aocc.patch', when="@6.8.2 %aocc", level=3) + # support Fujitsu compiler patch("fj.patch", when="%fj") @@ -236,12 +240,15 @@ class Charmpp(Package): # not, then we need to query the compiler vendor from Spack # here. options = [ - os.path.basename(self.compiler.cc), - os.path.basename(self.compiler.fc), - "-j%d" % make_jobs, - "--destination=%s" % builddir, + os.path.basename(self.compiler.cc) ] + if '@:6.8.2 %aocc' not in spec: + options.append(os.path.basename(self.compiler.fc)) + + options.append("-j%d" % make_jobs) + options.append("--destination=%s" % builddir) + if "pmi=slurmpmi" in spec: options.append("slurmpmi") if "pmi=slurmpmi2" in spec: diff --git a/var/spack/repos/builtin/packages/namd/package.py b/var/spack/repos/builtin/packages/namd/package.py index 1da71d20f5..fe699ac1d9 100644 --- a/var/spack/repos/builtin/packages/namd/package.py +++ b/var/spack/repos/builtin/packages/namd/package.py @@ -26,8 +26,8 @@ class Namd(MakefilePackage): version('2.13', '9e3323ed856e36e34d5c17a7b0341e38') version('2.12', '2a1191909b1ab03bf0205971ad4d8ee9') - variant('fftw', default='3', values=('none', '2', '3', 'mkl'), - description='Enable the use of FFTW/FFTW3/MKL FFT') + variant('fftw', default='3', values=('none', '2', '3', 'mkl', 'amdfftw'), + description='Enable the use of FFTW/FFTW3/MKL FFT/AMDFFTW') variant('interface', default='none', values=('none', 'tcl', 'python'), description='Enables TCL and/or python interface') @@ -45,6 +45,8 @@ class Namd(MakefilePackage): depends_on('fftw@:2.99', when="fftw=2") depends_on('fftw@3:', when="fftw=3") + depends_on('amdfftw', when="fftw=amdfftw") + depends_on('intel-mkl', when="fftw=mkl") depends_on('tcl', when='interface=tcl') @@ -97,12 +99,16 @@ class Namd(MakefilePackage): optims_opts = { 'gcc': m64 + '-O3 -fexpensive-optimizations \ -ffast-math -lpthread ' + archopt, - 'intel': '-O2 -ip -qopenmp-simd' + archopt} + 'intel': '-O2 -ip -qopenmp-simd' + archopt, + 'aocc': m64 + '-O3 -ffp-contract=fast -ffast-math \ + -fopenmp ' + archopt} else: optims_opts = { 'gcc': m64 + '-O3 -fexpensive-optimizations \ -ffast-math ' + archopt, - 'intel': '-O2 -ip ' + archopt} + 'intel': '-O2 -ip ' + archopt, + 'aocc': m64 + '-O3 -ffp-contract=fast \ + -ffast-math ' + archopt} optim_opts = optims_opts[self.compiler.name] \ if self.compiler.name in optims_opts else '' @@ -187,6 +193,10 @@ class Namd(MakefilePackage): opts.append('--without-fftw') elif fftw_version == 'mkl': self._append_option(opts, 'mkl') + elif fftw_version == 'amdfftw': + self._copy_arch_file('fftw3') + opts.extend(['--with-fftw3', + '--fftw-prefix', spec['amdfftw'].prefix]) else: _fftw = 'fftw{0}'.format('' if fftw_version == '2' else '3') |