Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for header packaging #221

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
17 changes: 9 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

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)
6 changes: 3 additions & 3 deletions include/README.md
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 15 additions & 2 deletions include/mopac_api.h → include/mopac.h
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

/* 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,
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/run_mopac.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down