openmopac / mopac

Molecular Orbital PACkage
http://openmopac.net
GNU Lesser General Public License v3.0
115 stars 31 forks source link

OpenMP linkage was broken again #85

Closed susilehtola closed 2 years ago

susilehtola commented 2 years ago

Fixes the link to OpenMP that was broken again by https://github.com/openmopac/mopac/commit/cc58cbf18086233b535a5083687c2e7c1a312c1b.

Closes #76 and #82

Status

codecov-commenter commented 2 years ago

Codecov Report

Merging #85 (3e7917d) into main (992869b) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #85   +/-   ##
=======================================
  Coverage   68.26%   68.26%           
=======================================
  Files         330      330           
  Lines       71696    71696           
=======================================
  Hits        48946    48946           
  Misses      22750    22750           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 992869b...3e7917d. Read the comment docs.

godotalgorithm commented 2 years ago

I've reproduced the problem on a Linux system, and I've tweaked your fix to use the OpenMP compiler flag rather than direct calls to libraries. Direct linking of OpenMP can (and has) caused linking of multiple, disjoint OpenMP libraries because the OpenMP detection in find_package(BLAS) is not synchronized with find_package(OpenMP). I think that the compiler flag is more intelligent in avoiding this issue. My previous tweak broke your original flag-based fix because I failed to add the flag at link time (your global change to compiler flags applied both to all targets and at both compile and link times).