swig-fortran / swig

This fork of SWIG creates Fortran wrapper code from C++ headers.
http://www.swig.org
Other
42 stars 11 forks source link

Improved CMake Find #158

Closed mkstoyanov closed 4 years ago

mkstoyanov commented 4 years ago

Currently SWIG Fortran uses the SWIG_DIR variables but also requires manually setting SWIG_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:

sethrj commented 4 years ago

@mkstoyanov Sorry I just now saw this issue, and I'm not sure I understand the problem that you're having.

mkstoyanov commented 4 years ago

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.