To unsubscribe from the SUNDIALS-USERS list: write to: mailto:SUNDIALS-USERS-...@LISTSERV.LLNL.GOV
Hi Debadutta,
Does “cmake --version" return 3.17.3? If so, try configuring with “cmake” rather than “ccmake”. If an older version is returned, you might need to update your PATH environment variable to include the path to where CMake 3.17.3 is installed. Updating PATH might also make a newer version of “ccmake” available (depending on how CMake 3.17.3 was built), try “ccmake --version” to see if that’s the case.
Hope that helps,
David
Hi Debadutta,
To enable the F2003 interface use “-DBUILD_FORTRAN_INTERFACE=ON” rather than “-DENABLE_FORTRAN=ON”.
If your code is using the F77 interface to KINSOL, it’s recommended to update to the F2003 interface. This will require using the Fortran interface modules, replacing the F77 interface calls with calls to the appropriate F2003 function(s), and some minor modifications to the user-supplied function signatures e.g., the nonlinear residual function:
Hopefully, that should be most of the changes necessary but, without knowing more about the F77 code, it’s hard to say. The KINSOL F2003 examples might also be helpful, see https://github.com/LLNL/sundials/tree/main/examples/kinsol/F2003_serial
~David
My mistake, it should be BUILD_FORTRAN_MODULE_INTERFACE.
~David
From:
Debadutta Prusty <debaduttap...@u.northwestern.edu>
Date: Wednesday, June 29, 2022 at 2:04 PM
To: Gardner, David James <gard...@llnl.gov>
Cc: sundials-users <sundial...@llnl.gov>
Subject: Re: [sundials-users] KINSOL latest version installation
Thank you David for the information. However, the cmake problem still remains. It still gives the warning "CMake Warning:
Manually-specified variables were not used by the project:
BUILD_FORTRAN_INTERFACE
"
Hi Debadutta,
The changes are a bit more involved than just changing the types. The SUNDIALS functions to call are different as well. You should not need significant restructuring of the code though. Ill note that the Fortran 2003 interface closely follows the C interface. I recommend reviewing the Fortran 2003 examples in the SUNDIALS repository to understand what needs to be changed.
Cheers,
Cody
Correction- I copied the portion of the output to the right of -O3. And also I realized that the flags not showing up in the initial compilation command is not an error. It's just the way it is done in normal processes. However, my code doesn't compile due to a few intrinsic subroutines not being recognized. I am attaching the error message and the relevant portion of my Makefile below.
# put the name of the target program here
TARGET = brush.weak.geo # the list of source files
SRC = precision.f90 mathconst.f90 physconst.f90 globals.f90 myutils.f90 molecule.f90 L2norm.f90 chains.f90 volume.f90 loop.f90 parameter.f90 field.f90 init.f90 chaingenerator.f90 bulk-pot.f90 integration.f90 myio.f90 ref-den-profile.f90 fcn-new.f90 kinsolsolver.f90 solver.f90 brush.weak.geo_fp.f90
# some definitions
SHELL = /bin/bash
# get git version
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags)
FFLAGS=-cpp -DVERSION=\"$(GIT_VERSION)\" -fcheck=all -O3
LDFLAGS= -I/home/debadutta/Downloads/KINSOL-INSTALL-NEW/INSTDIR/fortran -L/home/debadutta/Downloads/KINSOL-INSTALL-NEW/INSTDIR/lib -lsundials_fkinsol_mod -lsundials_kinsol -lm -Wl,-rpath,/home/debadutta/Downloads/KINSOL-INSTALL-NEW/INSTDIR/lib
# -lm /usr/lib/x86_64-linux-gnu/librt.so -L/home/debadutta/sundials/instdir/lib -lsundials_fkinsol -lsundials_kinsol -lsundials_fnvecserial -lsundials_nvecserial /usr/lib/liblapack.so /usr/lib/libblas.so -Wl,-rpath,/home/debadutta/sundials/instdir/lib
#-I/home/debadutta/Downloads/KINSOL-INSTALL-NEW/INSTDIR/fortran -L/home/debadutta/Downloads/KINSOL-INSTALL-NEW/INSTDIR/lib -lsundials_fkinsol_mod -lsundials_kinsol -lm -Wl,-rpath,/home/debadutta/Downloads/KINSOL-INSTALL-NEW/INSTDIR/lib
LFFLAGS=$(LDFLAGS)
FF= /usr/bin/mpif90
all: $(TARGET)
$(TARGET): $(SRC:.f90=.o)
$(FF) -o $(TARGET) $(SRC:.f90=.o) $(LDFLAGS) $(LFLAGS)
#$(SRC:.f90=.o):
# ${FF} -c ${FFLAGS} $(SRC)
%.o: %.f90
#.f90.o :
${FF} ${FFLAGS} -c $(SRC)
install: all
cp $(TARGET) ~/bin
clean:
@rm -f $(SRC:.f90=.o) $(SRC:.f90=.d) $(TARGET) *~ *.mod
realclean: clean
@rm -f .depend
depend dep:
@$(FF) $(CFLAGS) -MM $(SRC) > .depend
ifeq (.depend, $(wildcard .depend))
include .depend
endifSo what I did is copied the portion of the output message of the example programs to the left of -O3 and pasted it in the entry for LDFLAGS, which is highlighted in red above. The errors generated are given below.
fcn-new.f90:26:8:
use fsundials_nvector_mod
1
Fatal Error: Can't open module file ‘fsundials_nvector_mod.mod’ for reading at (1): No such file or directory
compilation terminated.Since the error is with this newly introduced subroutine in the code, I believe the flags I am getting are wrong, probably due to my faulty understanding of extracting linker flags.