Closed mkstoyanov closed 4 years ago
@mkstoyanov Sorry I just now saw this issue, and I'm not sure I understand the problem that you're having.
SWIG_EXECUTABLE
; SWIG_DIR
should automatically be set once the executable is found.SWIG_DIR
is not the "prefix" for swig; it's the root directory for the SWIG library .i
files. It should have a different path from SWIG_ROOT
.swig
or (on some systems) swigX.Y
. Spack shouldn't be installing the binary name as swigfortran
; does it?SWIG_DIR
is not needed, SWIG_EXECUTABLE
is sufficient
I tried to simply add SWIG_DIR and SWIG_ROOT to the root of the spack install (with the messy hash), but I see that I have to specify the executable.For me, spack created a folder:
cd opt/spack/linux-<ubuntu-version>/gcc-8.3.0/swig-fortran-<hash>
ls -al bin/
208696 Feb 24 14:51 ccache-swig
22970704 Feb 24 14:51 swig
4 Feb 24 14:51 swigfortran -> swig
So the swigfortran is a sym-link to swig, but it is there.
Also, for some strange reason, if I don't add include paths:
share/swig/4.0.2/
share/swig/4.0.2/fortran/
then I get some strange error about conflicting ierr, it goes away with those files ... but that may be some issue on my end.
I guess my main issue was that I could not find any documentation about the cmake options. You can close, if CMake is adding such documentation at the moment.
Currently SWIG Fortran uses the
SWIG_DIR
variables but also requires manually settingSWIG_EXECUTABLE
and the SWIG include dirs (if not set in the global environment). While spack does a pretty good job at adjusting the various environment variables, one possible use case is to install SWIG Fortran through spack and then use it from outside.Proposed changes:
swigfortran
in${SWIG_DIR}/bin/
${SWIG_DIR}/share/swig/4.0.2/
and${SWIG_DIR}/share/swig/4.0.2/fortran/
to the include paths for the build interface of all swig targets