diff --git a/CITATION.cff b/CITATION.cff index 02617ab4..bf86d3d1 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,9 +2,9 @@ cff-version: 1.2.0 message: "If you use this software for a scientific publication, please cite it as below." title: MOPAC type: software -version: 23.0.0 +version: 23.0.1 doi: 10.5281/zenodo.6511958 -date-released: 2024-01-29 +date-released: 2024-11-10 authors: - family-names: Moussa given-names: "Jonathan E." diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a5625a1..f40750cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,12 +177,13 @@ endif() # Pass version & commit information to MOPAC's Fortran source target_compile_definitions(mopac-core PRIVATE MOPAC_VERSION_FULL="${PROJECT_VERSION}") -if(NOT GIT_HASH) - execute_process(COMMAND git rev-parse HEAD OUTPUT_VARIABLE GIT_HASH) -endif() +option(GIT_HASH "Enable THREADS keyword using OpenMP API" ON) if(GIT_HASH) - string(STRIP ${GIT_HASH} GIT_HASH) - target_compile_definitions(mopac-core PRIVATE MOPAC_GIT_HASH="${GIT_HASH}") + execute_process(COMMAND git rev-parse HEAD OUTPUT_VARIABLE GIT_HASH_VAL) + if(GIT_HASH_VAL) + string(STRIP ${GIT_HASH_VAL} GIT_HASH_VAL) + target_compile_definitions(mopac-core PRIVATE MOPAC_GIT_HASH="${GIT_HASH_VAL}") + endif() endif() # Try to use CMake's system of finding BLAS & LAPACK libraries @@ -324,9 +325,9 @@ install(FILES "${CMAKE_SOURCE_DIR}/.github/mopac.ico" DESTINATION "." COMPONENT install(FILES "${CMAKE_SOURCE_DIR}/CITATION.cff" "${CMAKE_SOURCE_DIR}/COPYING" "${CMAKE_SOURCE_DIR}/COPYING.lesser" DESTINATION "." COMPONENT redist EXCLUDE_FROM_ALL) -install(FILES "${CMAKE_SOURCE_DIR}/include/mopac_api.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT redist EXCLUDE_FROM_ALL) -install(FILES "${CMAKE_SOURCE_DIR}/include/mopac_api_internal.F90" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT redist EXCLUDE_FROM_ALL) -install(FILES "${CMAKE_SOURCE_DIR}/include/mopac_api_f.F90" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT redist EXCLUDE_FROM_ALL) +install(FILES "${CMAKE_SOURCE_DIR}/include/mopac.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT main) +install(FILES "${CMAKE_SOURCE_DIR}/include/mopac_wrapper_internal.F90" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT redist EXCLUDE_FROM_ALL) +install(FILES "${CMAKE_SOURCE_DIR}/include/mopac_wrapper.F90" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT redist EXCLUDE_FROM_ALL) install(FILES "${CMAKE_SOURCE_DIR}/include/LICENSE" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT redist EXCLUDE_FROM_ALL) # Install the executables and library diff --git a/README.md b/README.md index bdc1d677..3396e8cd 100644 --- a/README.md +++ b/README.md @@ -110,10 +110,10 @@ the subroutine `run_mopac_from_input_f(path_to_file)` in the `mopac_api_f` modul ### Diskless/stateless API -A subset of MOPAC calculations can be run through a C-like Application Programming Interface (API) defined by the `mopac_api.h` C header file +A subset of MOPAC calculations can be run through a C-like Application Programming Interface (API) defined by the `mopac.h` C header file in the `include` directory, which also has a Fortran wrapper for convenience to Fortran software developers. Calculations run through this API do not use any input or output files or any other form of disk access, and the data structures of the API contain all relevant information -regarding the input and output of the MOPAC calculation. The functionality and data exposed by this API is limited, and has been designed to +regarding the input and output of the MOPAC calculation. The functionality and data exposed by this API is limited and has been designed to align with the most common observed uses of MOPAC. Future expansion of this functionality and data will be considered upon request. ## Citation diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 1ab8df15..e905924e 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -14,5 +14,5 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . -target_sources(mopac-api-test PRIVATE mopac_api_f.F90) -target_sources(mopac-api-test PRIVATE mopac_api_internal.F90) +target_sources(mopac-api-test PRIVATE mopac_wrapper.F90) +target_sources(mopac-api-test PRIVATE mopac_wrapper_internal.F90) diff --git a/include/README.md b/include/README.md index 38d721c5..0b339f92 100644 --- a/include/README.md +++ b/include/README.md @@ -1,6 +1,6 @@ # MOPAC include files For OS-level ABI-compatibility, the MOPAC API is bound to C. The data structures and function prototypes of this C-like API -are provided in the `mopac_api.h` header file. It is possible but inconvenient to use the C-like API in other Fortran software, -so a Fortran convenience wrapper is also provided here. Because this wrapper needs to be compiled with the software using the -MOPAC API, it is being provided with a permissive MIT license to allow broad use. +are provided in the `mopac.h` header file. It is possible but inconvenient to use the C-like API in other Fortran software, +so a Fortran convenience wrapper is also provided here. Because it needs to be compiled with the software that is calling the +MOPAC API, the Fortran wrapper source files are being provided with a permissive MIT license to allow for broad use. diff --git a/include/mopac_api.h b/include/mopac.h similarity index 93% rename from include/mopac_api.h rename to include/mopac.h index 26443a5b..bd91d2a3 100644 --- a/include/mopac_api.h +++ b/include/mopac.h @@ -1,10 +1,23 @@ /* Molecular Orbital PACkage (MOPAC) * Copyright (C) 2021, Virginia Polytechnic Institute and State University + * + * MOPAC is free software: you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MOPAC is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . */ /* Diskless/stateless Application Programming Interface (API) to core MOPAC operations */ -#ifndef MOPAC_API_H -#define MOPAC_API_H +#ifndef MOPAC_H +#define MOPAC_H /* This C-like MOPAC API consists of 4 data structures - mopac_system, mopac_properties, mopac_state, diff --git a/include/mopac_api_f.F90 b/include/mopac_wrapper.F90 similarity index 100% rename from include/mopac_api_f.F90 rename to include/mopac_wrapper.F90 diff --git a/include/mopac_api_internal.F90 b/include/mopac_wrapper_internal.F90 similarity index 100% rename from include/mopac_api_internal.F90 rename to include/mopac_wrapper_internal.F90 diff --git a/src/run_mopac.F90 b/src/run_mopac.F90 index 00efd586..a3ee681e 100644 --- a/src/run_mopac.F90 +++ b/src/run_mopac.F90 @@ -116,7 +116,11 @@ subroutine run_mopac call getarg (i, jobnam) #endif if (jobnam == '-V' .OR. jobnam == '--version') then +#ifdef MOPAC_GIT_HASH write(*,"(a)") "MOPAC version "//trim(verson)//" commit "//trim(git_hash) +#else + write(*,"(a)") "MOPAC version "//trim(verson) +#endif stop endif end do