SLEPC_DIR in slepcconf.h set to destdir not prefix

Issue #12 resolved
Drew Parsons created an issue

In commit 25fa25f (Issue #11) we got the value of SLEPC_DIR in slepcconf.h to be reset at install time. Previously it held the value of builddir. We missed a detail, however. Now SLEPC_DIR gets set to a value of destdir instead of prefix.

I didn't catch that earlier because I've been applying a patch, https://salsa.debian.org/science-team/slepc/blob/experimental/debian/patches/install_destdir which removes the assignment

self.installDir        = self.destDir

in install.py

That patch also adds an explicit INSTALL_DIR argument to install.py. Likely there's a better way to do it using prefix or SLEPC_DESTDIR from slepcvariables.

Comments (5)

  1. Jose E. Roman

    Your patch requires a new variable SLEPC_INSTALLDIR. Is this set by the user? What if the user does not set it?

  2. Drew Parsons reporter

    You're absolutely right, that's what I meant by "better way" (i.e. my patch is not the better way :) In the Debian build we control the setting, of course, but I don't recommend applying the patch directly. I linked to it just to give the idea of what's missing.

    Is there a different way for install.py to get access to prefix, that can be used to set self.installDir?

    Reading SLEPC_DESTDIR from installed-arch-linux2-c++-opt/lib/slepc/conf/slepcvariables is one possibility. Or taking slepc_dir from installed-arch-linux2-c++-opt/lib/slepc/conf/modules/slepc/3.9.0.

  3. Jose E. Roman

    Something like this?

      def readDestDir(self, src):
        try:
          f = open(src)
          for l in f.readlines():
            r = l.split('=',1)
            if len(r)!=2: continue
            if r[0].strip() == 'SLEPC_DESTDIR':
              break
          f.close()
        except:
          print('***********************************************')
          print('Error reading SLEPC_DESTDIR from slepcvariables')
          print('***********************************************')
          sys.exit(1)
        return r[1].strip()
    

    and then

        self.installDir = self.readDestDir(os.path.join(self.archConfDir,'slepcvariables'))
    
  4. Drew Parsons reporter

    That should work. It looks a bit odd to "readDestDir" when it's actually installDir (or prefix), but it is consistent with the name SLEPC_DESTDIR in slepcvariables that's being read. Apart from that it looks fine.

  5. Log in to comment