[Openmd-developers] QHULL as static while building

Dan Gezelter gezelter at nd.edu
Tue Sep 9 09:57:20 EDT 2014


I checked in an even simpler fix.  You can leave the FindQhull.cmake alone and just add these lines to src/math/qhull.hpp:

#ifdef qh_QHpointer
#define qh_QHpointer 0
#endif

above the extern "C"

 --Dan


On Sep 8, 2014, at 5:53 PM, Martin Vala <mvala at saske.sk> wrote:

> Hi Dan,
> 
> Yes, it works. Nice job.
> 
> I will apply to rpms, tomorrow. It's 23:52 in Slovakia. I go to bed and i will create rpms tomorrow.
> 
> It was pleasure to debug with you
> 
> Ciao
> 
> Martin
> 
> On 08/09/2014 23:50, Dan Gezelter wrote:
>> This hunch might pay off:
>> 
>> https://gitorious.org/qhull/gxzagas-qhull/commit/38bda5b8365668ab7927445347645d610000dbba
>> 
>> If you add the "=0"  to the qh_QHpointer definition in FindQhull.cmake
>> 
>> if(QHULL_FOUND)
>>   set(HAVE_QHULL ON)
>>   if(NOT QHULL_USE_STATIC)
>>     add_definitions("-Dqh_QHpointer=0")
>> 
>> It works!
>>  I think that's equivalent to using static data structures, but in the dynamic library.
>> 
>> 
>>  --Dan
>> 
>> 
>> 
>> 
>> On Sep 8, 2014, at 5:30 PM, Martin Vala <mvala at saske.sk> wrote:
>> 
>>> Hi Dan,
>>> 
>>> Yes you are right and when you do
>>> 
>>> make VERBOSE=1
>>> 
>>> then you would see that -Dqh_QHpointer is there when it is compiling
>>> 
>>>> Do we need to link to an additional library?
>>> I don't know yet.
>>> 
>>> Ciao
>>> 
>>> Martin
>>> 
>>> 
>>> 
>>> On 08/09/2014 23:24, Dan Gezelter wrote:
>>>> I think those are already added by FindQHull.cmake  (look at the last few lines)
>>>> 
>>>> And it looks like the flags.make files in the build directories all do have -Dqh_QHpointer defined in the CXX_DEFINES, so it should be compiling with that flag set.  Do we need to link to an additional library?
>>>> 
>>>>  --Dan
>>>> 
>>>> On Sep 8, 2014, at 5:13 PM, Martin Vala <mvala at saske.sk> wrote:
>>>> 
>>>>> Hi Dan,
>>>>> 
>>>>> what about this?
>>>>> 
>>>>> #if qh_QHpointer  /* see user.h */
>>>>>  if (qh_qh){
>>>>>      printf ("QH6238: Qhull link error.  The global variable qh_qh was not initialized\n\
>>>>>              to NULL by global.c.  Please compile this program with -Dqh_QHpointer_dllimport\n\
>>>>>              as well as -Dqh_QHpointer, or use libqhullstatic, or use a different tool chain.\n\n");
>>>>>      exit -1;
>>>>>  }
>>>>> #endif
>>>>> 
>>>>> Ciao
>>>>> 
>>>>> MArtin
>>>>> 
>>>>> On 08/09/2014 22:52, Martin Vala wrote:
>>>>>> Hi Dan,
>>>>>> 
>>>>>> I think this is good guess. I think we only need to Initialize 'qh' it once.
>>>>>> 
>>>>>> Ciao
>>>>>> 
>>>>>> Martin
>>>>>> On 08/09/2014 22:31, Dan Gezelter wrote:
>>>>>>>> facet variable (pointer) (line 76) is declared and it is not initialized so address is random. Then i don't see any "new" operator. Maybe it is hidden somewhere. Then at line 217
>>>>>>> The FORALLFacets iterator on line 214 is supposed to be setting that.   The qhull.h include file defines:
>>>>>>> 
>>>>>>> #define FORALLfacets for (facet=qh facet_list;facet && facet->next;facet=facet->next)
>>>>>>> 
>>>>>>> I think the problem might be the qh object.  The qhull site says this:
>>>>>>> 
>>>>>>> When you read the code, be aware of the macros "qh" and "qhstat", e.g., "qh hull_dim". They are defined in libqhull.h. They allow the global data structures to be pre-allocated (faster access) or dynamically allocated (allows multiple copies).
>>>>>>> 
>>>>>>> I'm not sure that object exits when we dynamically link.
>>>>>>> 
>>>>>>>  --Dan
>>>>>>> 
>>>>>>> 
>>>>>>> ***********************************************
>>>>>>>   J. Daniel Gezelter
>>>>>>>   Associate Professor of Chemistry
>>>>>>>   Department of Chemistry and Biochemistry
>>>>>>>   251 Nieuwland Science Hall
>>>>>>>   University of Notre Dame
>>>>>>>   Notre Dame, IN 46556-5670
>>>>>>> 
>>>>>>>   phone:  +1 (574) 631-7595
>>>>>>>   fax:    +1 (574) 631-6652
>>>>>>>   e-mail: gezelter at nd.edu
>>>>>>>   web:    http://www.nd.edu/~gezelter
>>>>>>> ************************************************
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> _______________________________________________
>>>>>> Openmd-developers mailing list
>>>>>> Openmd-developers at openmd.org
>>>>>> http://openmd.org/mailman/listinfo.cgi/openmd-developers
>>>>> _______________________________________________
>>>>> Openmd-developers mailing list
>>>>> Openmd-developers at openmd.org
>>>>> http://openmd.org/mailman/listinfo.cgi/openmd-developers
>>>> ***********************************************
>>>>   J. Daniel Gezelter
>>>>   Associate Professor of Chemistry
>>>>   Department of Chemistry and Biochemistry
>>>>   251 Nieuwland Science Hall
>>>>   University of Notre Dame
>>>>   Notre Dame, IN 46556-5670
>>>> 
>>>>   phone:  +1 (574) 631-7595
>>>>   fax:    +1 (574) 631-6652
>>>>   e-mail: gezelter at nd.edu
>>>>   web:    http://www.nd.edu/~gezelter
>>>> ************************************************
>>>> 
>>>> 
>>>> 
>> ***********************************************
>>   J. Daniel Gezelter
>>   Associate Professor of Chemistry
>>   Department of Chemistry and Biochemistry
>>   251 Nieuwland Science Hall
>>   University of Notre Dame
>>   Notre Dame, IN 46556-5670
>> 
>>   phone:  +1 (574) 631-7595
>>   fax:    +1 (574) 631-6652
>>   e-mail: gezelter at nd.edu
>>   web:    http://www.nd.edu/~gezelter
>> ************************************************
>> 
>> 
>> 
> 

***********************************************
  J. Daniel Gezelter
  Associate Professor of Chemistry
  Department of Chemistry and Biochemistry
  251 Nieuwland Science Hall
  University of Notre Dame
  Notre Dame, IN 46556-5670

  phone:  +1 (574) 631-7595
  fax:    +1 (574) 631-6652
  e-mail: gezelter at nd.edu
  web:    http://www.nd.edu/~gezelter
************************************************





More information about the Openmd-developers mailing list