From 9207198cddd90b47412738062f9bd7ed5e4fdd9b Mon Sep 17 00:00:00 2001 From: Darth Vader Date: Sat, 30 Oct 2021 22:54:23 +0000 Subject: [PATCH] Squashed 'examples/fortran/' changes from c5f2dba4..2d5cce26 2d5cce26 [iphreeqccom] updated date ca1fa62b [iphreeqc] updated image location f39a9de6 added README to examples f5e8d59e added CMakeLists.txt to examples c311b23b fixed to run on linux; cleaned examples ee7d1026 [phreeqc] Testing subtree merges 795138ac [phreeqc] Testing subtree merges 2 46d70ad2 [phreeqc] Testing subtree merges 35cae109 Added .gitlab-ci.yml 73e2f7fc Closes https://gitlab.cr.usgs.gov/coupled/IPhreeqc/issues/6 git-subtree-dir: examples/fortran git-subtree-split: 2d5cce26a1a9e8bc2e9cca70188d3f37c88667f5 --- .gitlab-ci.yml | 49 +++++++++++++++++++++ advect/CMakeLists.txt | 7 +++ advect/CMakeLists.txt.in | 24 ++++++++++ advect/Makefile | 36 --------------- advect/README.txt | 45 +++++++++++++++++++ advect/advect.sln | 38 ---------------- advect/advect.vfproj | 94 ---------------------------------------- 7 files changed, 125 insertions(+), 168 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 advect/CMakeLists.txt.in delete mode 100644 advect/Makefile create mode 100644 advect/README.txt delete mode 100644 advect/advect.sln delete mode 100644 advect/advect.vfproj diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..e4b2c77a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +# +# https://code.chs.usgs.gov/coupled/subtrees/phreeqc-COMManuscript-CGfinal-examples-fortran +# SRC 2020-12-02T18:39:55-07:00 +# +image: ${CI_REGISTRY}/coupled/containers/buildpack-deps:bionic-scm + +stages: + - trigger + +before_script: + - eval $(ssh-agent -s) + - echo "${SSH_PRIVATE_KEY_ENC}" | base64 --decode | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan ${CI_SERVER_HOST} >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - git config --global user.email "darth@empire.com" + - git config --global user.name "Darth Vader" + +trigger-downstream: + stage: trigger + ## + ## Only run if on the master branch and the variable GROUP is set + ## + ## change this to + ## only: + ## - master@$GROUP/subtrees/phreeqc-COMManuscript-CGfinal-examples-fortran + ## and set GROUP to coupled before merge + only: + refs: + - master + variables: + - $GROUP + + ## Downstream Projects + ## triggers and ids are stored at the group level + ## iphreeqc https://code.chs.usgs.gov/coupled/iphreeqc + ## iphreeqccom https://code.chs.usgs.gov/coupled/iphreeqccom + ## phreeqc https://code.chs.usgs.gov/coupled/phreeqc + script: + - echo triggering iphreeqc + - curl -X POST -F token=${IPHREEQC_TRIGGER} -F ref=master https://code.chs.usgs.gov/api/v4/projects/${IPHREEQC_ID}/trigger/pipeline + - echo triggering iphreeqccom + - curl -X POST -F token=${IPHREEQCCOM_TRIGGER} -F ref=master https://code.chs.usgs.gov/api/v4/projects/${IPHREEQCCOM_ID}/trigger/pipeline + - echo triggering phreeqc + - curl -X POST -F token=${PHREEQC_TRIGGER} -F ref=master https://code.chs.usgs.gov/api/v4/projects/${PHREEQC_ID}/trigger/pipeline + + ## Upstream Projects + ## none diff --git a/advect/CMakeLists.txt b/advect/CMakeLists.txt index c4acd8da..f4c18dd0 100644 --- a/advect/CMakeLists.txt +++ b/advect/CMakeLists.txt @@ -1,13 +1,20 @@ # project if (IPHREEQC_FORTRAN_TESTING AND IPHREEQC_ENABLE_MODULE) project(example_advect_f90 Fortran) + + configure_file(phreeqc.dat phreeqc.dat COPYONLY) + configure_file(ic ic COPYONLY) endif() +configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY) + # files SET(FORTRAN_Advect_Files +${IPhreeqc_BINARY_DIR}/examples/fortran/advect/CMakeLists.txt advect.F90 ic phreeqc.dat +README.txt ) if (IPHREEQC_FORTRAN_TESTING AND IPHREEQC_ENABLE_MODULE) diff --git a/advect/CMakeLists.txt.in b/advect/CMakeLists.txt.in new file mode 100644 index 00000000..723ab453 --- /dev/null +++ b/advect/CMakeLists.txt.in @@ -0,0 +1,24 @@ +# set minimum cmake version +cmake_minimum_required(VERSION 3.10) + +# set project name along with language +# iphreeqc requires CXX +project(advect_f90 CXX Fortran) + +# copy necessary files into build directory +configure_file(phreeqc.dat phreeqc.dat COPYONLY) +configure_file(ic ic COPYONLY) + +# find IPhreeqc export package +# set CMAKE_PREFIX_PATH or IPhreeqc_DIR to the +# location of the IPhreeqcConfig.cmake file +find_package(IPhreeqc 3 REQUIRED) + +# add executable target +add_executable(advect_f90 advect.F90) + +# add source for iphreeqc fortran module +target_sources(advect_f90 PRIVATE ../../../src/IPhreeqc_interface.F90) + +# set link libraries as well as include paths +target_link_libraries(advect_f90 IPhreeqc::IPhreeqc) diff --git a/advect/Makefile b/advect/Makefile deleted file mode 100644 index f7087f5a..00000000 --- a/advect/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -SHELL=/bin/bash -HOSTNAME ?= $(shell hostname) - -ifeq (${HOSTNAME}, ubuntu) - LDFLAGS = -L../../../_build/INSTALL/lib - IPHREEQC_LA = ../../../_build/INSTALL/lib/libiphreeqc.la - LIBTOOL = /usr/bin/libtool - FC = gfortran - FFLAGS = - MOD_FILES = callback.mod iphreeqc.mod mydata.mod subs.mod -endif - -all: advect advect-lt - -advect: advect.o - gfortran -o advect advect.o IPhreeqc_interface.o $(LDFLAGS) -liphreeqc -lstdc++ - -#advect.o: advect.F90 IPhreeqc_interface.o -# gfortran -c $< -advect.o: advect.lo - -#IPhreeqc_interface.o: ../../../src/IPhreeqc_interface.F90 -# gfortran -c $< -IPhreeqc_interface.o: IPhreeqc_interface.lo - -advect-lt: advect.lo $(IPHREEQC_LA) - $(LIBTOOL) --mode=link $(FC) -o $@ $< IPhreeqc_interface.lo $(IPHREEQC_LA) - -advect.lo: advect.F90 IPhreeqc_interface.lo - $(LIBTOOL) --mode=compile $(FC) $(FFLAGS) -c -o $@ $< - -IPhreeqc_interface.lo: ../../../src/IPhreeqc_interface.F90 - $(LIBTOOL) --mode=compile $(FC) $(FFLAGS) -c -o $@ $< - -clean: - ${LIBTOOL} --mode=clean rm -f advect advect-lt advect.lo IPhreeqc_interface.lo ${MOD_FILES} diff --git a/advect/README.txt b/advect/README.txt new file mode 100644 index 00000000..dbfeb229 --- /dev/null +++ b/advect/README.txt @@ -0,0 +1,45 @@ +Example usage + +-------------------------------------------------------------------------------------- +Windows +-------------------------------------------------------------------------------------- +Configure, build, test and install IPhreeqc + 1. cd iphreeqc-@VERSION@-@REVISION@ + 2. mkdir _build + 3. cd _build + 4. cmake -S .. -B . -DCMAKE_INSTALL_PREFIX:PATH=c:/Users/charlton/iphreeqc + 5. cmake --build . --config debug + 6. ctest -C debug + 7. cmake --build . --config release + 8. ctest -C release + 9. cmake --build . --config debug --target install + 10. cmake --build . --config release --target install + + +Build example: + 1. cd c:\Users\charlton\iphreeqc\examples\fortran\advect + 2. mkdir _build + 3. cd _build + 4. cmake -DCMAKE_PREFIX_PATH:PATH=c:/Users/charlton/iphreeqc .. + 5. cmake --build . --config release + +-------------------------------------------------------------------------------------- +Linux/macOS +-------------------------------------------------------------------------------------- +Configure, build, test and install IPhreeqc + 1. cd iphreeqc-@VERSION@-@REVISION@ + 2. mkdir _build + 3. cd _build + 4. cmake -S .. -B . -DCMAKE_INSTALL_PREFIX:PATH=/home/charlton/iphreeqc + 5. cmake --build . + 6. ctest + 7. cmake --build . --target install + + +Build example: + 1. cd /home/charlton/iphreeqc/share/doc/IPhreeqc/examples/fortran/advect + 2. mkdir _build + 3. cd _build + 4. cmake -DCMAKE_PREFIX_PATH:PATH=/home/charlton/iphreeqc .. + 5. cmake --build . + \ No newline at end of file diff --git a/advect/advect.sln b/advect/advect.sln deleted file mode 100644 index 74a43672..00000000 --- a/advect/advect.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "advect", "advect.vfproj", "{28459FF2-3C6C-469E-B0C3-2E4D483E7025}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - DebugDll|Win32 = DebugDll|Win32 - DebugDll|x64 = DebugDll|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - ReleaseDll|Win32 = ReleaseDll|Win32 - ReleaseDll|x64 = ReleaseDll|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Debug|Win32.ActiveCfg = Debug|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Debug|Win32.Build.0 = Debug|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Debug|x64.ActiveCfg = Debug|x64 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Debug|x64.Build.0 = Debug|x64 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.DebugDll|Win32.ActiveCfg = DebugDll|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.DebugDll|Win32.Build.0 = DebugDll|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.DebugDll|x64.ActiveCfg = DebugDll|x64 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.DebugDll|x64.Build.0 = DebugDll|x64 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Release|Win32.ActiveCfg = Release|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Release|Win32.Build.0 = Release|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Release|x64.ActiveCfg = Release|x64 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.Release|x64.Build.0 = Release|x64 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.ReleaseDll|x64.ActiveCfg = ReleaseDll|x64 - {28459FF2-3C6C-469E-B0C3-2E4D483E7025}.ReleaseDll|x64.Build.0 = ReleaseDll|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/advect/advect.vfproj b/advect/advect.vfproj deleted file mode 100644 index 030d65d3..00000000 --- a/advect/advect.vfproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -