From 26ef278fe1c292a2d6250818b7e4562d5fcf8b45 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Jun 26 2022 18:43:18 +0000 Subject: Update to 22.0.3 and fix test failures. --- diff --git a/77.patch b/77.patch new file mode 100644 index 0000000..47ac13c --- /dev/null +++ b/77.patch @@ -0,0 +1,62 @@ +From fc2c852bede8372e054df67adbd0b37b884e21cc Mon Sep 17 00:00:00 2001 +From: Susi Lehtola +Date: Sat, 25 Jun 2022 12:40:38 -0400 +Subject: [PATCH] Fix handling of OpenMP. + +--- + CMakeLists.txt | 5 ++++- + src/input/wrtkey.F90 | 2 +- + src/run_mopac.F90 | 4 ++-- + 3 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 881a9fbb..5f6cba54 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -166,7 +166,10 @@ endif() + # Use OpenMP API in MOPAC for "THREADS" keyword + option(THREADS_KEYWORD "Enable THREADS keyword using OpenMP API" ON) + if(THREADS_KEYWORD) +- add_definitions(-DOMP_ENABLED) ++ find_package(OpenMP) ++ if(OPENMP_FOUND) ++ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") ++ endif() + endif() + + # Additional link line +diff --git a/src/input/wrtkey.F90 b/src/input/wrtkey.F90 +index 1043b092..d3a39b57 100644 +--- a/src/input/wrtkey.F90 ++++ b/src/input/wrtkey.F90 +@@ -1871,7 +1871,7 @@ subroutine wrtwor (allkey) + i = Index (keywrd, " THREADS") + i = nint(reada(keywrd, i)) + i = max(i,1) +-#ifdef OMP_ENABLED ++#ifdef _OPENMP + if (i == 1) then + write (iw,'(" * THREADS=1 - MULTI-THREADING NOT USED")') + else if (i < 10) then +diff --git a/src/run_mopac.F90 b/src/run_mopac.F90 +index 540ec53b..6a978c27 100644 +--- a/src/run_mopac.F90 ++++ b/src/run_mopac.F90 +@@ -67,7 +67,7 @@ subroutine run_mopac + logical :: exists, opend, sparkles_available, l_OLDDEN + double precision, external :: C_triple_bond_C, reada, seconds + character :: nokey(20)*10 +-#ifdef OMP_ENABLED ++#ifdef _OPENMP + integer :: num_threads, default_num_threads + integer, external :: omp_get_max_threads + #endif +@@ -246,7 +246,7 @@ subroutine run_mopac + if (moperr .and. numcal == 1 .and. index(keywrd_txt," GEO_DAT") == 0) goto 100 + if (moperr) goto 101 + ! Adjust maximum number of threads using the OpenMP API +-#ifdef OMP_ENABLED ++#ifdef _OPENMP + if (numcal == 1) default_num_threads = omp_get_max_threads() + i = index(keywrd, " THREADS") + if (i > 0) then