Skip to content
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c2c0f46
initial pcmsolver recipe
loriab Mar 14, 2023
7c04ce8
iter 1
loriab Mar 14, 2023
8e12350
iter 2
loriab Mar 15, 2023
43f18db
iter 3
loriab Mar 15, 2023
1408952
iter 4
loriab Mar 15, 2023
e78dede
iter 5
loriab Mar 15, 2023
5093f41
iter 6
loriab Mar 15, 2023
1148e6a
iter 7
loriab Mar 15, 2023
8758965
iter 8
loriab Mar 15, 2023
02e184d
iter 9
loriab Mar 15, 2023
05a9b6f
iter 10
loriab Mar 15, 2023
72bfdba
iter 11
loriab Mar 15, 2023
a51aefe
iter 12
loriab Mar 15, 2023
374636c
iter 13
loriab Mar 15, 2023
754ceab
iter 14
loriab Mar 15, 2023
f8d5052
iter 15
loriab Mar 15, 2023
c02c215
iter 16
loriab Mar 15, 2023
ab350bf
iter 17
loriab Mar 15, 2023
6063b3a
iter 18
loriab Mar 17, 2023
bd3d981
iter 19
loriab Mar 17, 2023
5e7f2ee
iter 20
loriab Mar 17, 2023
93cc3b7
iter 21
loriab Mar 17, 2023
732e699
iter 22
loriab Mar 17, 2023
af477f9
iter 23
loriab Mar 17, 2023
be01f5c
iter 24
loriab Mar 17, 2023
3c9ac63
iter 25
loriab Mar 17, 2023
1620813
iter 26
loriab Mar 17, 2023
738df10
iter 27
loriab Mar 18, 2023
6b31112
iter 28
loriab Apr 6, 2023
e34b63b
iter 29
loriab Apr 6, 2023
d838870
iter 30
loriab Apr 6, 2023
58ba26b
iter 31
loriab Apr 6, 2023
6cfa44c
iter 32
loriab Apr 6, 2023
94becf9
iter 33
loriab Apr 6, 2023
ae66011
iter 34
loriab Apr 6, 2023
94e5021
iter 35
loriab Apr 7, 2023
a3f1575
iter 36
loriab Apr 7, 2023
7ac2bc2
iter 37
loriab Apr 7, 2023
4593f5e
iter 38
loriab Apr 7, 2023
f65686a
iter 39 -- review
loriab Apr 18, 2023
3224aef
licensing
loriab Apr 18, 2023
d5c0ddb
REF: Split outputs into python and non-python bits
carterbox Apr 25, 2023
a55f9c3
iter 40
loriab May 2, 2023
708cc34
iter 41
loriab May 2, 2023
6a26338
iter 42
loriab May 2, 2023
655182c
iter 43
loriab May 2, 2023
7104e5c
Merge branch 'main' into loriab-pcmsolver
carterbox May 26, 2023
aab04e2
One build string for noarch python
carterbox May 26, 2023
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
51 changes: 51 additions & 0 deletions recipes/pcmsolver/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@ECHO ON

set "CC=gcc.exe"
set "CXX=g++.exe"
set "FC=gfortran.exe"

cmake %CMAKE_ARGS% ^
-G "MinGW Makefiles" ^
-S %SRC_DIR% ^
-B build ^
-D CMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-D CMAKE_BUILD_TYPE=Release ^
-D CMAKE_C_FLAGS="%CFLAGS%" ^
-D CMAKE_CXX_FLAGS="%CXXFLAGS%" ^
-D CMAKE_Fortran_FLAGS="%FFLAGS%" ^
-D CMAKE_INSTALL_LIBDIR="lib" ^
-D CMAKE_INSTALL_INCLUDEDIR="include" ^
-D CMAKE_INSTALL_BINDIR="bin" ^
-D CMAKE_INSTALL_DATADIR="share" ^
-D PYMOD_INSTALL_LIBDIR="/../../Lib/site-packages" ^
-D Python_EXECUTABLE="%PYTHON%" ^
-D CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ^
-D CMAKE_GNUtoMS=ON ^
-D BUILD_TESTING=OFF ^
-D CMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-D ENABLE_OPENMP=OFF ^
-D ENABLE_GENERIC=OFF ^
-D ENABLE_TESTS=ON ^
-D ENABLE_TIMER=OFF ^
-D ENABLE_LOGGER=OFF ^
-D BUILD_STANDALONE=ON ^
-D ENABLE_CXX11_SUPPORT=ON
if errorlevel 1 exit 1

cmake --build build ^
--config Release ^
--target install ^
-- -j %CPU_COUNT%
if errorlevel 1 exit 1

:: Building both static & shared (instead of SHARED_LIBRARY_ONLY) since the tests
:: only build with static lib. Don't want to distribute static, though, so
:: removing all the static lib stuff immediately after install.
del %LIBRARY_PREFIX%\\share\\cmake\\PCMSolver\\PCMSolverTargets-static-release.cmake
del %LIBRARY_PREFIX%\\share\\cmake\\PCMSolver\\PCMSolverTargets-static.cmake
del %LIBRARY_PREFIX%\\lib\\libpcm.a

cd build
ctest --rerun-failed --output-on-failure
if errorlevel 1 exit 1

39 changes: 39 additions & 0 deletions recipes/pcmsolver/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

set -ex

${BUILD_PREFIX}/bin/cmake ${CMAKE_ARGS} \
-S ${SRC_DIR} \
-B build \
-G "Ninja" \
-D CMAKE_INSTALL_PREFIX=${PREFIX} \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_COMPILER=${CC} \
-D CMAKE_C_FLAGS="${CFLAGS}" \
-D CMAKE_CXX_COMPILER=${CXX} \
-D CMAKE_CXX_FLAGS="${CXXFLAGS}" \
-D CMAKE_Fortran_COMPILER=${FC} \
-D CMAKE_Fortran_FLAGS="${FFLAGS}" \
-D CMAKE_INSTALL_LIBDIR=lib \
-D PYMOD_INSTALL_LIBDIR="/python${PY_VER}/site-packages" \
-D Python_EXECUTABLE=${PYTHON} \
-D ENABLE_OPENMP=OFF \
-D ENABLE_GENERIC=OFF \
-D ENABLE_TESTS=ON \
-D ENABLE_TIMER=OFF \
-D ENABLE_LOGGER=OFF \
-D BUILD_STANDALONE=ON \
-D ENABLE_CXX11_SUPPORT=ON

cmake --build build --target install -j${CPU_COUNT}

# Building both static & shared (instead of SHARED_LIBRARY_ONLY) since the tests
# only build with static lib. Don't want to distribute static, though, so
# removing all the static lib stuff immediately after install.
rm ${PREFIX}/share/cmake/PCMSolver/PCMSolverTargets-static-release.cmake
rm ${PREFIX}/share/cmake/PCMSolver/PCMSolverTargets-static.cmake
rm ${PREFIX}/lib/libpcm.a

cd build
ctest --rerun-failed --output-on-failure -j${CPU_COUNT}

95 changes: 95 additions & 0 deletions recipes/pcmsolver/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{% set name = "PCMSolver" %}
{% set version = "1.2.3" %}
{% set sha256 = "d22157f37cb64c1324246ae2278bdf8ec0581b0ba4ad58d4d9c209efd0dfa61f" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
# url: https://github.com/{{ name }}/{{ name|lower }}/archive/v{{ version }}.tar.gz
url: https://github.com/loriab/pcmsolver/archive/8f72076.tar.gz # v1.2.3 plus build commits
sha256: {{ sha256 }}

build:
number: 0
run_exports:
- {{ pin_subpackage('pcmsolver', max_pin='x.x.x') }}

requirements:
build:
- {{ compiler('c') }} # [unix]
- {{ compiler('cxx') }} # [unix]
- {{ compiler('fortran') }} # [unix]
- {{ compiler('m2w64_c') }} # [win]
- {{ compiler('m2w64_fortran') }} # [win]
- cmake
- ninja
host:
# below two are header-only deps that pcmsolver supplies when missing
# - boost-cpp
# - eigen
- python
- zlib
run:
- m2w64-gcc-libgfortran # [win]
- python

test:
imports:
- pcmsolver
files:
- molecule.inp
requires:
- m2w64-binutils # [win] # provides objdump.exe
commands:
- ls -l $PREFIX/lib # [unix]
- ls -l $PREFIX/share/cmake/PCMSolver # [unix]
- ls -l $SP_DIR/pcmsolver # [unix]
- dir %PREFIX%\\Library\\lib # [win]
- dir %PREFIX%\\Library\\share\\cmake\\pcmsolver # [win]
- dir %SP_DIR%\\pcmsolver # [win]
# Verify library
- test -L $PREFIX/lib/libpcm$SHLIB_EXT # [unix]
- test ! -f $PREFIX/lib/libpcm.a # [unix]
- test -f $SP_DIR/pcmsolver/pcmparser.py # [unix]
- if not exist %PREFIX%\\Library\\lib\\libpcm.dll.a exit 1 # [win] # gnu import lib
- if not exist %PREFIX%\\Library\\lib\\libpcm.lib exit 1 # [win] # ms import lib
- if not exist %PREFIX%\\Library\\bin\\libpcm.dll exit 1 # [win] # gnu/ms dyn lib
- if exist %PREFIX%\\Library\\lib\\libpcm.a exit 1 # [win] # gnu static lib removed
- if not exist %SP_DIR%\\pcmsolver\\pcmparser.py exit 1 # [win]
# Verify executable
- test -f $PREFIX/bin/go_pcm.py # [unix]
- test -f $PREFIX/bin/run_pcm # [unix]
- if not exist %PREFIX%\\Library\\bin\\go_pcm.py exit 1 # [win]
- if not exist %PREFIX%\\Library\\bin\\run_pcm.exe exit 1 # [win]
# Verify accessories
- test -e $PREFIX/include/PCMSolver/pcmsolver.h # [unix]
- test -e $PREFIX/share/cmake/PCMSolver/PCMSolverConfig.cmake # [unix]
- if not exist %PREFIX%\\Library\\include\\PCMSolver\\pcmsolver.h exit 1 # [win]
- if not exist %PREFIX%\\Library\\share\\cmake\\PCMSolver\\PCMSolverConfig.cmake exit 1 # [win]
# Inspect linkage
- ldd -v $PREFIX/lib/libpcm$SHLIB_EXT # [linux and build_platform == target_platform]
- otool -L $PREFIX/lib/libpcm$SHLIB_EXT # [osx]
- objdump.exe -p %PREFIX%\\Library\\bin\\libpcm.dll | findstr /i "dll" # [win]
# Actually test
- python $PREFIX/bin/go_pcm.py --inp molecule.inp --exe $PREFIX/bin # [unix]
- python %PREFIX%\\Library\\bin\\go_pcm.py --inp molecule.inp --exe %PREFIX%\\Library\\bin # [win]
- cat molecule.out # [unix]
- type molecule.out # [win]

about:
home: https://github.com/PCMSolver/pcmsolver
dev_url: https://github.com/PCMSolver/pcmsolver
doc_url: https://pcmsolver.readthedocs.io/en/stable/
doc_source_url: https://github.com/PCMSolver/pcmsolver/tree/master/doc
license: LGPL-3.0-only

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "AND" to include the license types of the projects in /external

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGPL3 + MIT + MIT-0 should cover it.

license_url: https://opensource.org/license/lgpl-3-0/
license_file: LICENSE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to list the license files of the projects in /external, they are not all LGPL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I never noticed libtaylor was brought in as a header-only library.

  • Catch -- only used in tests so never becomes part of the project, so I didn't add its license
  • eigen -- I switched to forcing it to detect the conda pkg, so the external/ copy no longer used
  • boost -- same situation as eigen
  • libtaylor -- MIT

Then I started hunting through the source a little more and found 10 in total, so I added a THIRD-PARTY-LICENSE file to the upstream repo to cover them all.

license_family: LGPL
summary: "R. Di Remigio & L. Frediani's Polarizable Continuum Model (PCM)"

extra:
recipe-maintainers:
- loriab
- robertodr
24 changes: 24 additions & 0 deletions recipes/pcmsolver/molecule.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
units = angstrom
codata = 2002
medium
{
solvertype = cpcm
correction = 0.5
solvent = cyclohexane
}

cavity
{
type = gepol
area = 0.6
radiiset = uff
mode = implicit
}

molecule
{
# x, y, z, q
geometry = [0.000000000, 0.00000000, 0.08729478, 9.0,
0.000000000, 0.00000000, -1.64558444, 1.0]
}