[petsc-dev] [PATCH 3 of 3] cmake: replace invalid characters with underscores

Barry Smith bsmith at mcs.anl.gov
Mon Aug 27 21:15:27 CDT 2012


On Aug 27, 2012, at 7:22 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Mon, Aug 27, 2012 at 6:32 PM, Sean Farley <sean at mcs.anl.gov> wrote:
> On Mon, Aug 27, 2012 at 10:51 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> > Does this really work?
> 
> "Works for me."
> 
> > Barry's problem-configure from a while back left
> > stuff like this
> >
> > PETSC_-FRAMEWORK_LIB:FILEPATH=PETSC_-FRAMEWORK_LIB-NOTFOUND
> >
> > This came from passing --with-opengl-lib="-framework glut -framework opengl"
> > to configure.
> 
> One thing that changed is that Barry added '-framework opengl ...' here:
> 
> http://petsc.cs.iit.edu/petsc/petsc-dev/rev/86c9a3787fc2
> 
> and maybe this did something, too:
> 
> http://petsc.cs.iit.edu/petsc/petsc-dev/rev/40f9515d8b01
> 
> > I don't see the logic above that is going to produce
> > PETSC_GLUT_LIB and PETSC_OPENGL_LIB.
> 
> You are right. Though those symbols don't exist currently in
> petsc-dev. Based on your feedback, I was able to find
> PETSC_FRAMEWORK_OPENGL_LIB. This probably works for mac because the
> PETSC_HAVE_OPENGL test succeeded and -framework was passed blindly
> somewhere in the link line.
> 
> What about also getting rid of '_FRAMEWORK' by doing this instead:
> 
> diff --git a/config/PETSc/Configure.py b/config/PETSc/Configure.py
> --- a/config/PETSc/Configure.py
> +++ b/config/PETSc/Configure.py
> @@ -436,11 +436,11 @@
>        extendby(self.libraries.rt)
>        extendby(self.compilers.flibs)
>        extendby(self.compilers.cxxlibs)
>        extendby(self.compilers.LIBS.split())
>        for libname in nublast(lib_libs):
> -        libvar = 'PETSC_' + libname.upper() + '_LIB'
> +        libvar = 'PETSC_' + libname.upper().replace('-','').replace('
> ','_').replace('_FRAMEWORK','') + '_LIB'
>          addpath = ''
>          for lpath in nublast(lib_paths):
>            addpath += '"' + str(lpath) + '" '
>          fd.write('find_library (' + libvar + ' ' + libname + ' HINTS
> ' + addpath + ')\n')
>          libvars.append(libvar)
> 
> We still need to find a way to ensure that "-framework opengl" is passed to the linker. This just fixes the variable name, but doesn't parse the option and forward it to the linker (which CMake is very obstinate about).

   All you need do is search through the framework directories (Sean kindly provided the list) for xxxx.framework then the dynamic library is in that directory called xxxx (yup no suffix!).  Now you have a complete path to pass to cmake. I am kind of surprised that someone hasn't provided a cmake utility to do this already (since it must be very common), perhaps 

   Google finds some odds and ends like this http://twogregui.googlecode.com/svn/trunk/TwOgre/cmake/OgreFindFrameworks.cmake  but like everything associated with cmake it is incomprehensible.  Side question: why do all configure systems have to be so fucking incomprehensible?



    Barry

 
> 




More information about the petsc-dev mailing list