From c311b23bc3c1d16ec84b02bddc38264fc40df069 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R" Date: Wed, 28 Oct 2020 15:11:29 -0600 Subject: [PATCH 1/2] fixed to run on linux; cleaned examples --- advect/Makefile | 36 ----------------- advect/advect.sln | 38 ------------------ advect/advect.vfproj | 94 -------------------------------------------- 3 files changed, 168 deletions(-) delete mode 100644 advect/Makefile delete mode 100644 advect/advect.sln delete mode 100644 advect/advect.vfproj 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/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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From f5e8d59e52c3c52aa75f5bc2e8499384da6012dd Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R" Date: Wed, 28 Oct 2020 17:29:24 -0600 Subject: [PATCH 2/2] added CMakeLists.txt to examples --- advect/CMakeLists.txt | 6 ++++-- advect/CMakeLists.txt.in | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 advect/CMakeLists.txt.in diff --git a/advect/CMakeLists.txt b/advect/CMakeLists.txt index 2b5dc31e..a49d3027 100644 --- a/advect/CMakeLists.txt +++ b/advect/CMakeLists.txt @@ -3,12 +3,14 @@ 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) + 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 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)